2021-10-20 04:12:00 +08:00
|
|
|
const e = require('../core/elements');
|
|
|
|
|
2021-10-25 23:01:40 +08:00
|
|
|
async function openPoll(test) {
|
2021-10-20 04:12:00 +08:00
|
|
|
await test.waitAndClick(e.actions);
|
|
|
|
await test.waitAndClick(e.polling);
|
|
|
|
await test.waitForSelector(e.hidePollDesc);
|
2021-10-25 23:01:40 +08:00
|
|
|
await test.waitAndClick(e.pollLetterAlteratives);
|
|
|
|
await test.waitForSelector(e.pollOptionItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function startPoll(test, shouldPublishPoll = false, isAnonymous = false) {
|
|
|
|
await openPoll(test);
|
2021-10-21 22:11:43 +08:00
|
|
|
if (isAnonymous) test.waitAndClickElement(e.anonymousPoll);
|
2021-10-20 04:12:00 +08:00
|
|
|
await test.waitAndClick(e.startPoll);
|
|
|
|
if (shouldPublishPoll) await test.waitAndClick(e.publishPollingLabel);
|
|
|
|
}
|
|
|
|
|
2021-10-25 23:01:40 +08:00
|
|
|
exports.openPoll = openPoll;
|
2023-04-04 04:23:26 +08:00
|
|
|
exports.startPoll = startPoll;
|