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

55 lines
1.9 KiB
JavaScript
Raw Normal View History

2021-11-30 02:39:52 +08:00
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
const e = require('../core/elements');
async function startSharedNotes(test) {
await test.waitAndClick(e.sharedNotes);
await test.waitForSelector(e.hideNotesLabel, ELEMENT_WAIT_LONGER_TIME);
2023-02-14 21:59:46 +08:00
await test.hasElement(e.etherpadFrame, ELEMENT_WAIT_LONGER_TIME);
2022-01-29 03:52:22 +08:00
}
function getNotesLocator(test) {
return test.page.frameLocator(e.etherpadFrame).last()
2022-01-29 03:52:22 +08:00
.frameLocator(e.etherpadOuter)
.frameLocator(e.etherpadInner)
.locator(e.etherpadEditable);
2021-11-30 02:39:52 +08:00
}
2022-07-21 03:44:09 +08:00
function getShowMoreButtonLocator(test) {
return test.page.frameLocator(e.etherpadFrame).locator(e.showMoreSharedNotesButton);
}
function getExportButtonLocator(test) {
return test.page.frameLocator(e.etherpadFrame).locator(e.exportSharedNotesButton);
}
function getExportPlainTextLocator(test) {
return test.page.frameLocator(e.etherpadFrame).locator(e.exportPlainButton);
}
2023-02-10 02:10:50 +08:00
function getExportHTMLLocator(test) {
return test.page.frameLocator(e.etherpadFrame).locator(e.exporthtml);
}
function getExportEtherpadLocator(test) {
return test.page.frameLocator(e.etherpadFrame).locator(e.exportetherpad);
}
2022-11-08 00:18:52 +08:00
function getMoveToWhiteboardLocator(test) {
return test.page.locator(e.sendNotesToWhiteboard);
}
function getSharedNotesUserWithoutPermission(test) {
return test.page.frameLocator(e.sharedNotesViewingMode)
.locator('body');
}
2021-11-30 02:39:52 +08:00
exports.startSharedNotes = startSharedNotes;
2022-01-29 03:52:22 +08:00
exports.getNotesLocator = getNotesLocator;
2022-07-21 03:44:09 +08:00
exports.getShowMoreButtonLocator = getShowMoreButtonLocator;
exports.getExportButtonLocator = getExportButtonLocator;
exports.getExportPlainTextLocator = getExportPlainTextLocator;
2022-11-08 00:18:52 +08:00
exports.getMoveToWhiteboardLocator = getMoveToWhiteboardLocator;
2023-02-10 02:10:50 +08:00
exports.getSharedNotesUserWithoutPermission = getSharedNotesUserWithoutPermission;
exports.getExportHTMLLocator = getExportHTMLLocator;
exports.getExportEtherpadLocator = getExportEtherpadLocator;