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

26 lines
791 B
JavaScript
Raw Normal View History

const Page = require('../core/page');
const utilNotification = require('../notifications/util');
const { ELEMENT_WAIT_TIME, VIDEO_LOADING_WAIT_TIME } = require('../core/constants'); // core constants (Timeouts vars imported)
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}]`);
}
const resp = this.page.evaluate(() => document.querySelectorAll('[data-test="pollMenuButton"]').length === 1);
return resp;
} catch (e) {
console.log(e);
return false;
}
}
}
module.exports = exports = Polling;