2021-11-03 00:45:52 +08:00
|
|
|
const { test } = require('@playwright/test');
|
2022-01-20 03:50:59 +08:00
|
|
|
const { Chat } = require('./chat');
|
2022-01-20 04:02:54 +08:00
|
|
|
const { PrivateChat } = require('./privateChat');
|
2021-11-03 00:45:52 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test.describe.parallel('Chat', () => {
|
2021-11-16 00:42:29 +08:00
|
|
|
test('Send public message', async ({ browser, page }) => {
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.sendPublicMessage();
|
2021-11-03 00:45:52 +08:00
|
|
|
});
|
2022-01-20 04:02:54 +08:00
|
|
|
|
|
|
|
test('Send private message', async ({ browser, context, page }) => {
|
|
|
|
const privateChat = new PrivateChat(browser, context);
|
|
|
|
await privateChat.initPages(page);
|
|
|
|
await privateChat.sendPrivateMessage();
|
|
|
|
});
|
|
|
|
|
2021-11-16 00:42:29 +08:00
|
|
|
test('Clear chat', async ({ browser, page }) => {
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.clearChat();
|
2021-11-03 00:45:52 +08:00
|
|
|
});
|
|
|
|
|
2022-01-13 23:11:17 +08:00
|
|
|
test('Copy chat', async ({ browser, context, page }, testInfo) => {
|
|
|
|
test.fixme(testInfo.config.projects[0].use.headless, 'Only works in headed mode');
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.copyChat(context);
|
2021-12-01 04:10:38 +08:00
|
|
|
});
|
|
|
|
|
2022-01-13 23:11:17 +08:00
|
|
|
test.skip('Save chat', async ({ browser, page }) => {
|
2021-11-03 00:45:52 +08:00
|
|
|
test.fixme();
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.saveChat();
|
2021-11-03 00:45:52 +08:00
|
|
|
});
|
2022-01-13 23:11:17 +08:00
|
|
|
|
|
|
|
test('Verify character limit (5000 characters)', async ({ browser, page }) => {
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.characterLimit();
|
2022-01-13 23:11:17 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Not able to send an empty message', async ({ browser, page }) => {
|
2022-01-20 03:50:59 +08:00
|
|
|
const chat = new Chat(browser, page);
|
|
|
|
await chat.init(true, true);
|
|
|
|
await chat.emptyMessage();
|
2022-01-13 23:11:17 +08:00
|
|
|
});
|
2022-02-05 03:26:35 +08:00
|
|
|
|
|
|
|
test('Close private chat', async ({ browser, context, page }) => {
|
|
|
|
const privateChat = new PrivateChat(browser, context);
|
|
|
|
await privateChat.initPages(page);
|
|
|
|
await privateChat.closeChat();
|
|
|
|
});
|
2022-02-10 23:17:12 +08:00
|
|
|
|
|
|
|
test('Private chat disabled when user leaves meeting', async ({ browser, context, page }) => {
|
|
|
|
const privateChat = new PrivateChat(browser, context);
|
|
|
|
await privateChat.initPages(page);
|
|
|
|
await privateChat.chatDisabledUserLeaves();
|
|
|
|
});
|
2021-11-03 06:50:20 +08:00
|
|
|
});
|