2021-09-22 21:11:56 +08:00
|
|
|
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
|
2021-09-22 11:51:29 +08:00
|
|
|
const e = require('../core/elements');
|
2021-08-21 04:33:57 +08:00
|
|
|
const { getElementLength } = require('../core/util');
|
2020-03-25 02:13:51 +08:00
|
|
|
|
|
|
|
async function startSharedNotes(test) {
|
2021-08-20 04:22:31 +08:00
|
|
|
try {
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitAndClick(e.sharedNotes);
|
2021-09-22 11:51:29 +08:00
|
|
|
await test.waitForSelector(e.hideNoteLabel, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
const resp = await test.page.evaluate(getElementLength, e.etherpad) >= 1;
|
2021-09-22 21:11:56 +08:00
|
|
|
await test.waitForSelector(e.etherpad);
|
2021-08-20 04:22:31 +08:00
|
|
|
return resp === true;
|
2021-09-22 11:51:29 +08:00
|
|
|
} catch (err) {
|
|
|
|
await test.logger(err);
|
2021-08-20 04:22:31 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-03-25 02:13:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
exports.startSharedNotes = startSharedNotes;
|