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');
|
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 {
|
|
|
|
await test.waitForSelector(se.sharedNotes, ELEMENT_WAIT_TIME);
|
|
|
|
await test.click(se.sharedNotes, true);
|
|
|
|
await test.waitForSelector(se.hideNoteLabel, ELEMENT_WAIT_LONGER_TIME);
|
2021-08-21 04:33:57 +08:00
|
|
|
const resp = await test.page.evaluate(getElementLength, se.etherpad) >= 1;
|
2021-08-20 04:22:31 +08:00
|
|
|
await test.waitForSelector(se.etherpad, ELEMENT_WAIT_TIME);
|
|
|
|
return resp === true;
|
|
|
|
} catch (e) {
|
|
|
|
await test.logger(e);
|
|
|
|
return false;
|
|
|
|
}
|
2020-03-25 02:13:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
exports.startSharedNotes = startSharedNotes;
|