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');
|
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
|
|
|
});
|
|
|
|
|
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
|
|
|
});
|
2021-11-03 06:50:20 +08:00
|
|
|
});
|
2022-01-13 23:11:17 +08:00
|
|
|
|