diff --git a/bigbluebutton-html5/tests/puppeteer/notifications.test.js b/bigbluebutton-html5/tests/puppeteer/notifications.test.js index 7e12f608e43d667e9ddd2deb181e250b5325094b..7af3f8cb6b3ecc87df9ca2db4217ef9e6fe5336f 100644 --- a/bigbluebutton-html5/tests/puppeteer/notifications.test.js +++ b/bigbluebutton-html5/tests/puppeteer/notifications.test.js @@ -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'); + }); }); diff --git a/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js b/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js index 383655d32baa642ea7dc97a4adfd17226e69d3b2..c3c6cbc3ba929868f9b9bbcb695ebf6a98cc7843 100644 --- a/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js +++ b/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js @@ -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(); diff --git a/bigbluebutton-html5/tests/puppeteer/screenshare/screenshare.js b/bigbluebutton-html5/tests/puppeteer/screenshare/screenshare.js index 80a09df9d61921e106a45d8bf4fbf51304b6e9ce..521367e3c3e6be8327207f092ba77db47ce805fa 100644 --- a/bigbluebutton-html5/tests/puppeteer/screenshare/screenshare.js +++ b/bigbluebutton-html5/tests/puppeteer/screenshare/screenshare.js @@ -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;