bigbluebutton-Github/bigbluebutton-tests/puppeteer/polling/poll.js
2021-08-19 17:22:31 -03:00

28 lines
748 B
JavaScript

const Page = require('../core/page');
const e = require('../core/elements');
const utilNotification = require('../notifications/util');
class Polling extends Page {
constructor() {
super('polling-test');
}
async test(testName) {
try {
await utilNotification.startPoll(this);
if (process.env.GENERATE_EVIDENCES === 'true') {
await this.screenshot(`${testName}`, `01-before-chat-message-send-[${this.meetingId}]`);
}
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;