bigbluebutton-v2.5.11/bigbluebutton-tests/puppeteer/user/util.js
2023-01-16 14:25:39 +08:00

26 lines
765 B
JavaScript

const e = require('../core/elements');
async function setStatus(test, status) {
await test.waitAndClick(e.firstUser);
await test.waitAndClick(e.setStatus);
await test.waitAndClick(status);
}
async function connectionStatus(test) {
await test.waitAndClick(e.connectionStatusBtn);
await test.waitForSelector(e.connectionStatusModal);
}
function checkNetworkStatus(dataContainer, networdData) {
const values = Array.from(document.querySelectorAll(`${dataContainer} > ${networdData}`));
values.splice(4, values.length - 4);
const check = values.filter(e => e.textContent.includes(' 0 k'))[0];
if (!check) return true;
}
exports.setStatus = setStatus;
exports.connectionStatus = connectionStatus;
exports.checkNetworkStatus = checkNetworkStatus;