Skip to content
Snippets Groups Projects
Commit 33c41fc8 authored by Mohamed Amine Ben Salah's avatar Mohamed Amine Ben Salah
Browse files

adds shared notes single user test

parent 65c3a8b1
No related branches found
No related tags found
No related merge requests found
exports.sharedNotes = 'div[data-test="sharedNotes"]';
exports.hideNoteLabel = 'button[data-test="hideNoteLabel"]';
exports.etherpad = 'iframe[title="etherpad"]';
const Create = require('../breakout/create');
const util = require('./util');
class SharedNotes extends Create {
constructor() {
super('shared-notes');
}
async test() {
const response = await util.startSharedNotes(this.page1);
return response;
}
async close() {
await this.page1.close();
await this.page2.close();
}
}
module.exports = exports = SharedNotes;
const se = require('./elements');
async function startSharedNotes(test) {
await test.waitForSelector(se.sharedNotes);
await test.click(se.sharedNotes, true);
await test.waitForSelector(se.hideNoteLabel);
const resp = await test.page.evaluate(getTestElement, se.etherpad);
await test.waitForSelector(se.etherpad);
return resp;
}
async function getTestElement(element) {
const response = document.querySelectorAll(element).length >= 1;
return response;
}
exports.getTestElement = getTestElement;
exports.startSharedNotes = startSharedNotes;
const SharedNotes = require('./notes/sharednotes');
describe('Shared notes', () => {
test('Open Shared notes', async () => {
const test = new SharedNotes();
let response;
try {
await test.init();
response = await test.test();
} catch (e) {
console.log(e);
} finally {
await test.close();
}
expect(response).toBe(true);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment