bigbluebutton-Github/bigbluebutton-tests/playwright/chat/chat.spec.js
2022-03-29 10:53:07 -03:00

61 lines
2.0 KiB
JavaScript

const { test } = require('@playwright/test');
const { Chat } = require('./chat');
const { PrivateChat } = require('./privateChat');
test.describe.parallel('Chat', () => {
test('Send public message', async ({ browser, page }) => {
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.sendPublicMessage();
});
test('Send private message', async ({ browser, context, page }) => {
const privateChat = new PrivateChat(browser, context);
await privateChat.initPages(page);
await privateChat.sendPrivateMessage();
});
test('Clear chat', async ({ browser, page }) => {
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.clearChat();
});
test('Copy chat', async ({ browser, context, page }, testInfo) => {
test.fixme(testInfo.project.use.headless, 'Only works in headed mode');
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.copyChat(context);
});
test('Save chat', async ({ browser, page }, testInfo) => {
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.saveChat(testInfo);
});
test('Verify character limit', async ({ browser, page }) => {
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.characterLimit();
});
test('Not able to send an empty message', async ({ browser, page }) => {
const chat = new Chat(browser, page);
await chat.init(true, true);
await chat.emptyMessage();
});
test('Close private chat', async ({ browser, context, page }) => {
const privateChat = new PrivateChat(browser, context);
await privateChat.initPages(page);
await privateChat.closeChat();
});
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();
});
});