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

35 lines
1.2 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');
2022-07-21 03:44:09 +08:00
const { expect } = require('@playwright/test');
2021-11-30 02:39:52 +08:00
async function startSharedNotes(test) {
await test.waitAndClick(e.sharedNotes);
await test.waitForSelector(e.hideNotesLabel, ELEMENT_WAIT_LONGER_TIME);
2022-01-29 03:52:22 +08:00
await test.hasElement(e.etherpadFrame);
}
function getNotesLocator(test) {
return test.page.frameLocator(e.etherpadFrame)
.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);
}
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;