bigbluebutton-Github/bigbluebutton-tests/puppeteer/polling/poll.js

28 lines
748 B
JavaScript
Raw Normal View History

const Page = require('../core/page');
2021-08-20 04:22:31 +08:00
const e = require('../core/elements');
const utilNotification = require('../notifications/util');
class Polling extends Page {
constructor() {
super('polling-test');
}
2021-04-15 00:16:41 +08:00
async test(testName) {
try {
await utilNotification.startPoll(this);
2021-04-15 00:16:41 +08:00
if (process.env.GENERATE_EVIDENCES === 'true') {
await this.screenshot(`${testName}`, `01-before-chat-message-send-[${this.meetingId}]`);
}
2021-08-20 04:22:31 +08:00
const resp = this.page.evaluate((pollMenuSelector) => {
return document.querySelectorAll(pollMenuSelector).length === 1;
}, e.pollMenuButton);
return resp;
} catch (e) {
console.log(e);
return false;
}
}
}
module.exports = exports = Polling;