add lastTargetPage handler

This commit is contained in:
Anton Barboza 2021-09-22 16:22:47 -03:00
parent 2e9f92096f
commit 91b1bed661
18 changed files with 28 additions and 19 deletions

View File

@ -3,7 +3,7 @@ const util = require('./util');
class Audio extends Page {
constructor() {
super('audio-test');
super();
}
async test() {

View File

@ -10,7 +10,7 @@ const today = moment().format('DD-MM-YYYY');
class Join extends Create {
constructor() {
super('join-breakout');
super();
}
// Join Existing Breakoutrooms

View File

@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class Clear extends Page {
constructor() {
super('chat-clear');
super();
}
async test(testName) {

View File

@ -7,7 +7,7 @@ const util = require('./util');
class Copy extends Page {
constructor() {
super('chat-copy');
super();
}
async test(testName) {

View File

@ -6,7 +6,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class Poll extends Notifications {
constructor() {
super('poll-result-message');
super();
}
async test(testName) {

View File

@ -6,7 +6,7 @@ const util = require('./util');
class Save extends Page {
constructor() {
super('chat-save');
super();
}
async test(testName) {

View File

@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class Send extends Page {
constructor() {
super('chat-send');
super();
}
async test(testName) {

View File

@ -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);

View File

@ -7,7 +7,7 @@ const { checkElementLengthDifferentTo } = require('../core/util');
class Trigger extends Page {
constructor() {
super('trigger-events');
super();
}
async triggerMeteorDisconnect(testName) {

View File

@ -3,7 +3,7 @@ const util = require('./util');
class SharedNotes extends Create {
constructor() {
super('shared-notes');
super();
}
async test() {

View File

@ -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();

View File

@ -5,7 +5,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class Polling extends Page {
constructor() {
super('polling-test');
super();
}
async test(testName) {

View File

@ -6,7 +6,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class ShareScreen extends Page {
constructor() {
super('share-screen');
super();
}
async test() {

View File

@ -7,7 +7,7 @@ const { checkElementLengthEqualTo } = require('../core/util');
class Stress extends Page {
constructor() {
super('stress');
super();
}
async moderatorAsPresenter(testName) {

View File

@ -9,7 +9,7 @@ const { checkElementLengthEqualTo, checkElementLengthDifferentTo } = require('..
class Status extends Page {
constructor() {
super('user-status');
super();
}
async test() {

View File

@ -3,7 +3,7 @@ const util = require('./util');
class Check extends Share {
constructor() {
super('webcam-check-content-test');
super();
}
async compare() {

View File

@ -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() {

View File

@ -3,7 +3,7 @@ const e = require('../core/elements');
class Draw extends Page {
constructor() {
super('whiteboard-draw');
super();
}
async test() {