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

27 lines
735 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');
2021-08-21 04:33:57 +08:00
const { checkElementLengthEqualTo } = require('../core/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-21 04:33:57 +08:00
const resp = this.page.evaluate(checkElementLengthEqualTo, e.pollMenuButton, 1);
return resp;
} catch (e) {
console.log(e);
return false;
}
}
}
module.exports = exports = Polling;