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

23 lines
676 B
JavaScript

const { default: test } = require('@playwright/test');
const e = require('../core/elements');
const { getSettings } = require('../core/settings');
async function openChat(testPage) {
const { chatEnabled } = getSettings();
test.fail(!chatEnabled, 'Chat is disabled');
await testPage.waitForSelector(e.chatBox);
await testPage.waitForSelector(e.chatMessages);
}
async function openPrivateChat(testPage) {
const { chatEnabled } = getSettings();
test.fail(!chatEnabled, 'Chat is disabled');
await testPage.waitAndClick(e.userListItem);
await testPage.waitAndClick(e.startPrivateChat);
}
exports.openChat = openChat;
exports.openPrivateChat = openPrivateChat;