bigbluebutton-Github/bigbluebutton-tests/playwright/learningdashboard/util.js

26 lines
808 B
JavaScript
Raw Normal View History

2023-03-09 04:34:54 +08:00
const { test } = require('@playwright/test');
const e = require('../core/elements.js');
const { getSettings } = require('../core/settings.js');
async function openPoll(testPage) {
const { pollEnabled } = getSettings();
test.fail(!pollEnabled, 'Polling is disabled');
2023-03-10 22:24:14 +08:00
2023-03-09 04:34:54 +08:00
await testPage.waitAndClick(e.actions);
await testPage.waitAndClick(e.polling);
}
2023-03-10 22:24:14 +08:00
function timeInSeconds(locator){
const [hours, minutes, seconds] = locator.split(':').map(Number);
return hours * 3600 + minutes * 60 + seconds;
}
2023-03-30 21:01:01 +08:00
async function rowFilter(testPage, locator, role, selector) {
const locatorToFilter = await testPage.getLocator(locator);
return locatorToFilter.filter({ hasText: role }).locator(selector);
}
exports.openPoll = openPoll;
exports.timeInSeconds = timeInSeconds;
exports.rowFilter = rowFilter;