bigbluebutton-Github/bigbluebutton-html5/tests/puppeteer/user/util.js

20 lines
615 B
JavaScript
Raw Normal View History

const { ELEMENT_WAIT_TIME } = require('../core/constants');
2018-11-23 20:55:16 +08:00
const e = require('./elements');
async function setStatus(test, status) {
await test.waitForSelector(e.firstUser, ELEMENT_WAIT_TIME);
await test.click(e.firstUser, true);
await test.waitForSelector(e.setStatus, ELEMENT_WAIT_TIME);
2018-11-23 20:55:16 +08:00
await test.click(e.setStatus, true);
await test.waitForSelector(status, ELEMENT_WAIT_TIME);
2018-11-23 20:55:16 +08:00
await test.click(status, true);
}
async function countTestElements(element) {
return document.querySelectorAll(element).length !== 0;
}
exports.countTestElements = countTestElements;
2018-11-23 20:55:16 +08:00
exports.setStatus = setStatus;