bigbluebutton-Github/bigbluebutton-tests/playwright/chat/util.js

23 lines
676 B
JavaScript
Raw Normal View History

2022-03-29 21:53:07 +08:00
const { default: test } = require('@playwright/test');
2021-11-18 04:07:14 +08:00
const e = require('../core/elements');
2022-03-29 21:53:07 +08:00
const { getSettings } = require('../core/settings');
2022-03-29 21:53:07 +08:00
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);
}
2021-11-03 06:50:20 +08:00
exports.openChat = openChat;
2022-03-29 21:53:07 +08:00
exports.openPrivateChat = openPrivateChat;