2021-02-17 04:57:10 +08:00
|
|
|
const { ELEMENT_WAIT_TIME, ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
|
2020-03-25 02:13:51 +08:00
|
|
|
const se = require('./elements');
|
|
|
|
|
|
|
|
async function startSharedNotes(test) {
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(se.sharedNotes, ELEMENT_WAIT_TIME);
|
2020-03-25 02:13:51 +08:00
|
|
|
await test.click(se.sharedNotes, true);
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(se.hideNoteLabel, ELEMENT_WAIT_LONGER_TIME);
|
2020-03-25 02:13:51 +08:00
|
|
|
const resp = await test.page.evaluate(getTestElement, se.etherpad);
|
2021-02-17 04:57:10 +08:00
|
|
|
await test.waitForSelector(se.etherpad, ELEMENT_WAIT_TIME);
|
2020-03-25 02:13:51 +08:00
|
|
|
return resp;
|
|
|
|
}
|
|
|
|
|
|
|
|
async function getTestElement(element) {
|
2020-07-21 05:19:24 +08:00
|
|
|
const response = await document.querySelectorAll(element).length >= 1;
|
2020-03-25 02:13:51 +08:00
|
|
|
return response;
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getTestElement = getTestElement;
|
|
|
|
exports.startSharedNotes = startSharedNotes;
|