From 91b1bed6617f62e1db7bb9b51c8fe72caf2c5095 Mon Sep 17 00:00:00 2001 From: Anton Barboza Date: Wed, 22 Sep 2021 16:22:47 -0300 Subject: [PATCH] add lastTargetPage handler --- bigbluebutton-tests/puppeteer/audio/audio.js | 2 +- bigbluebutton-tests/puppeteer/breakout/join.js | 2 +- bigbluebutton-tests/puppeteer/chat/clear.js | 2 +- bigbluebutton-tests/puppeteer/chat/copy.js | 2 +- bigbluebutton-tests/puppeteer/chat/poll.js | 2 +- bigbluebutton-tests/puppeteer/chat/save.js | 2 +- bigbluebutton-tests/puppeteer/chat/send.js | 2 +- bigbluebutton-tests/puppeteer/core/page.js | 13 +++++++++++-- bigbluebutton-tests/puppeteer/events/trigger.js | 2 +- bigbluebutton-tests/puppeteer/notes/sharednotes.js | 2 +- .../puppeteer/notifications/notifications.js | 2 +- bigbluebutton-tests/puppeteer/polling/poll.js | 2 +- .../puppeteer/screenshare/screenshare.js | 2 +- bigbluebutton-tests/puppeteer/stress/stress.js | 2 +- bigbluebutton-tests/puppeteer/user/status.js | 2 +- bigbluebutton-tests/puppeteer/webcam/check.js | 2 +- bigbluebutton-tests/puppeteer/webcam/share.js | 2 +- bigbluebutton-tests/puppeteer/whiteboard/draw.js | 2 +- 18 files changed, 28 insertions(+), 19 deletions(-) diff --git a/bigbluebutton-tests/puppeteer/audio/audio.js b/bigbluebutton-tests/puppeteer/audio/audio.js index 09984bc6f1..7ed202d7d1 100644 --- a/bigbluebutton-tests/puppeteer/audio/audio.js +++ b/bigbluebutton-tests/puppeteer/audio/audio.js @@ -3,7 +3,7 @@ const util = require('./util'); class Audio extends Page { constructor() { - super('audio-test'); + super(); } async test() { diff --git a/bigbluebutton-tests/puppeteer/breakout/join.js b/bigbluebutton-tests/puppeteer/breakout/join.js index d95974ab48..28f368a74e 100644 --- a/bigbluebutton-tests/puppeteer/breakout/join.js +++ b/bigbluebutton-tests/puppeteer/breakout/join.js @@ -10,7 +10,7 @@ const today = moment().format('DD-MM-YYYY'); class Join extends Create { constructor() { - super('join-breakout'); + super(); } // Join Existing Breakoutrooms diff --git a/bigbluebutton-tests/puppeteer/chat/clear.js b/bigbluebutton-tests/puppeteer/chat/clear.js index 5c76343f96..c156044cef 100644 --- a/bigbluebutton-tests/puppeteer/chat/clear.js +++ b/bigbluebutton-tests/puppeteer/chat/clear.js @@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class Clear extends Page { constructor() { - super('chat-clear'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/chat/copy.js b/bigbluebutton-tests/puppeteer/chat/copy.js index 39e042d4fa..f130b4f1f9 100644 --- a/bigbluebutton-tests/puppeteer/chat/copy.js +++ b/bigbluebutton-tests/puppeteer/chat/copy.js @@ -7,7 +7,7 @@ const util = require('./util'); class Copy extends Page { constructor() { - super('chat-copy'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/chat/poll.js b/bigbluebutton-tests/puppeteer/chat/poll.js index 3d34c362e7..d1906c1351 100644 --- a/bigbluebutton-tests/puppeteer/chat/poll.js +++ b/bigbluebutton-tests/puppeteer/chat/poll.js @@ -6,7 +6,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class Poll extends Notifications { constructor() { - super('poll-result-message'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/chat/save.js b/bigbluebutton-tests/puppeteer/chat/save.js index b2d4698828..96efc61efa 100644 --- a/bigbluebutton-tests/puppeteer/chat/save.js +++ b/bigbluebutton-tests/puppeteer/chat/save.js @@ -6,7 +6,7 @@ const util = require('./util'); class Save extends Page { constructor() { - super('chat-save'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/chat/send.js b/bigbluebutton-tests/puppeteer/chat/send.js index 0a5bc31333..58cef52d80 100644 --- a/bigbluebutton-tests/puppeteer/chat/send.js +++ b/bigbluebutton-tests/puppeteer/chat/send.js @@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class Send extends Page { constructor() { - super('chat-send'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/core/page.js b/bigbluebutton-tests/puppeteer/core/page.js index 9815dba0eb..baa85f05d1 100644 --- a/bigbluebutton-tests/puppeteer/core/page.js +++ b/bigbluebutton-tests/puppeteer/core/page.js @@ -16,8 +16,8 @@ const devices = require('./devices'); const linuxDesktop = devices['Linux Desktop']; class Page { - constructor(name) { - this.name = name; + constructor(page) { + this.page = page; this.screenshotIndex = 0; this.meetingId; this.parentDir = this.getParentDir(__dirname); @@ -305,6 +305,15 @@ class Page { await this.page.keyboard.up(key); } + async bringToFront() { + await this.page.bringToFront(); + } + + async getLastTargetPage() { + const browserPages = await this.browser.pages(); + return new Page(browserPages[browserPages.length - 1]); + } + async waitAndClick(element, timeout = ELEMENT_WAIT_TIME, relief = false) { if (relief) await helper.sleep(1000); await this.waitForSelector(element, timeout); diff --git a/bigbluebutton-tests/puppeteer/events/trigger.js b/bigbluebutton-tests/puppeteer/events/trigger.js index 2fbd9cfe23..3def84c8f6 100644 --- a/bigbluebutton-tests/puppeteer/events/trigger.js +++ b/bigbluebutton-tests/puppeteer/events/trigger.js @@ -7,7 +7,7 @@ const { checkElementLengthDifferentTo } = require('../core/util'); class Trigger extends Page { constructor() { - super('trigger-events'); + super(); } async triggerMeteorDisconnect(testName) { diff --git a/bigbluebutton-tests/puppeteer/notes/sharednotes.js b/bigbluebutton-tests/puppeteer/notes/sharednotes.js index 5f4e2bfbf0..e272ced4a9 100644 --- a/bigbluebutton-tests/puppeteer/notes/sharednotes.js +++ b/bigbluebutton-tests/puppeteer/notes/sharednotes.js @@ -3,7 +3,7 @@ const util = require('./util'); class SharedNotes extends Create { constructor() { - super('shared-notes'); + super(); } async test() { diff --git a/bigbluebutton-tests/puppeteer/notifications/notifications.js b/bigbluebutton-tests/puppeteer/notifications/notifications.js index 2e0cfcfd85..a4e8ff9c62 100644 --- a/bigbluebutton-tests/puppeteer/notifications/notifications.js +++ b/bigbluebutton-tests/puppeteer/notifications/notifications.js @@ -10,7 +10,7 @@ const { checkElementTextIncludes } = require('../core/util'); class Notifications extends MultiUsers { constructor() { - super('notifications'); + super(); this.page1 = new Page(); this.page2 = new Page(); this.page3 = new Page(); diff --git a/bigbluebutton-tests/puppeteer/polling/poll.js b/bigbluebutton-tests/puppeteer/polling/poll.js index 7fad7f6255..5020b7eff7 100644 --- a/bigbluebutton-tests/puppeteer/polling/poll.js +++ b/bigbluebutton-tests/puppeteer/polling/poll.js @@ -5,7 +5,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class Polling extends Page { constructor() { - super('polling-test'); + super(); } async test(testName) { diff --git a/bigbluebutton-tests/puppeteer/screenshare/screenshare.js b/bigbluebutton-tests/puppeteer/screenshare/screenshare.js index 3328b0fae6..e3e016a9ba 100644 --- a/bigbluebutton-tests/puppeteer/screenshare/screenshare.js +++ b/bigbluebutton-tests/puppeteer/screenshare/screenshare.js @@ -6,7 +6,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class ShareScreen extends Page { constructor() { - super('share-screen'); + super(); } async test() { diff --git a/bigbluebutton-tests/puppeteer/stress/stress.js b/bigbluebutton-tests/puppeteer/stress/stress.js index e5e8a1f61a..9ae70c403b 100644 --- a/bigbluebutton-tests/puppeteer/stress/stress.js +++ b/bigbluebutton-tests/puppeteer/stress/stress.js @@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util'); class Stress extends Page { constructor() { - super('stress'); + super(); } async moderatorAsPresenter(testName) { diff --git a/bigbluebutton-tests/puppeteer/user/status.js b/bigbluebutton-tests/puppeteer/user/status.js index ab68a3322c..d308840240 100644 --- a/bigbluebutton-tests/puppeteer/user/status.js +++ b/bigbluebutton-tests/puppeteer/user/status.js @@ -9,7 +9,7 @@ const { checkElementLengthEqualTo, checkElementLengthDifferentTo } = require('.. class Status extends Page { constructor() { - super('user-status'); + super(); } async test() { diff --git a/bigbluebutton-tests/puppeteer/webcam/check.js b/bigbluebutton-tests/puppeteer/webcam/check.js index 65cf1e43e2..7ebfb269a8 100644 --- a/bigbluebutton-tests/puppeteer/webcam/check.js +++ b/bigbluebutton-tests/puppeteer/webcam/check.js @@ -3,7 +3,7 @@ const util = require('./util'); class Check extends Share { constructor() { - super('webcam-check-content-test'); + super(); } async compare() { diff --git a/bigbluebutton-tests/puppeteer/webcam/share.js b/bigbluebutton-tests/puppeteer/webcam/share.js index 2ba4f72ecf..db4b0adb06 100644 --- a/bigbluebutton-tests/puppeteer/webcam/share.js +++ b/bigbluebutton-tests/puppeteer/webcam/share.js @@ -6,7 +6,7 @@ const { VIDEO_LOADING_WAIT_TIME } = require('../core/constants'); // core consta class Share extends Page { constructor() { - super('webcam-share-test'); + super(); } async test() { diff --git a/bigbluebutton-tests/puppeteer/whiteboard/draw.js b/bigbluebutton-tests/puppeteer/whiteboard/draw.js index 0c6acf0f6b..1489d81537 100644 --- a/bigbluebutton-tests/puppeteer/whiteboard/draw.js +++ b/bigbluebutton-tests/puppeteer/whiteboard/draw.js @@ -3,7 +3,7 @@ const e = require('../core/elements'); class Draw extends Page { constructor() { - super('whiteboard-draw'); + super(); } async test() {