2020-02-22 02:06:05 +08:00
|
|
|
const e = require('./elements');
|
|
|
|
const pe = require('../core/elements');
|
|
|
|
|
|
|
|
async function waitForBreakoutElements(page1) {
|
2020-06-30 09:25:04 +08:00
|
|
|
await page1.waitForSelector(e.manageUsers);
|
|
|
|
await page1.waitForSelector(e.createBreakoutRooms);
|
2020-02-22 02:06:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async function createBreakoutRooms(page1, page2) {
|
2020-06-30 09:25:04 +08:00
|
|
|
await page1.click(e.manageUsers, true);
|
|
|
|
await page1.click(e.createBreakoutRooms, true);
|
|
|
|
await page1.waitForSelector(e.randomlyAssign);
|
|
|
|
await page1.click(e.randomlyAssign, true);
|
|
|
|
await page1.waitForSelector(e.modalConfirmButton);
|
|
|
|
await page1.click(e.modalConfirmButton, true);
|
|
|
|
await page2.waitForSelector(e.modalConfirmButton);
|
|
|
|
await page2.click(e.modalConfirmButton, true);
|
2020-02-22 02:06:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async function getTestElement(element) {
|
2020-06-30 09:25:04 +08:00
|
|
|
return document.querySelectorAll(element)[0] !== null;
|
2020-02-22 02:06:05 +08:00
|
|
|
}
|
|
|
|
|
2020-06-30 09:25:04 +08:00
|
|
|
async function clickTestElement(element) {
|
|
|
|
await document.querySelectorAll(element)[0].click();
|
2020-02-22 02:06:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
exports.getTestElement = getTestElement;
|
|
|
|
exports.createBreakoutRooms = createBreakoutRooms;
|
|
|
|
exports.waitForBreakoutElements = waitForBreakoutElements;
|
2020-06-30 09:25:04 +08:00
|
|
|
exports.clickTestElement = clickTestElement;
|