adds screensharing notification test spec

This commit is contained in:
Mohamed Amine Ben Salah 2020-03-23 11:14:56 -03:00
parent 16c920c301
commit 41255afa3a
3 changed files with 30 additions and 5 deletions

View File

@ -1,4 +1,5 @@
const Notifications = require('./notifications/notifications');
const ShareScreen = require('./screenshare/screenshare');
describe('Notifications', () => {
test('Save settings notification', async () => {
@ -86,4 +87,19 @@ describe('Notifications', () => {
}
expect(response).toContain('Poll results were published to Public Chat and Whiteboard');
});
test('Screenshare notification', async () => {
const test = new ShareScreen();
const page = new Notifications()
let response;
try {
await page.initUser3();
response = await test.toast(page.page3);
} catch (e) {
console.log(e);
} finally {
await page.closePage(page.page3);
}
expect(response).toBe('Screenshare has started');
});
});

View File

@ -1,7 +1,7 @@
const Page = require('../core/page');
const util = require('./util');
const MultiUsers = require('../user/multiusers');
const Page = require('../core/page');
const params = require('../params');
const util = require('./util');
const ne = require('./elements');
const we = require('../whiteboard/elements');
@ -92,6 +92,10 @@ class Notifications extends MultiUsers {
return resp;
}
async getLastToastElement() {
await util.getLastToastValue(this.page3);
}
async closePages() {
await this.page3.close();
await this.page4.close();

View File

@ -1,4 +1,5 @@
const Page = require('../core/page');
const utilNotifications = require('../notifications/util');
const util = require('./util');
const e = require('../core/elements');
@ -9,13 +10,17 @@ class ShareScreen extends Page {
async test() {
await util.startScreenshare(this.page);
this.page.on('dialog', async (dialog) => {
await dialog.accept();
});
await this.page.waitForSelector(e.screenShareVideo);
const response = await util.getScreenShareContainer(this.page);
return response;
}
async toast(page) {
await util.startScreenshare(page);
const response = await utilNotifications.getLastToastValue(page);
return response;
}
}
module.exports = exports = ShareScreen;