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 { class Audio extends Page {
constructor() { constructor() {
super('audio-test'); super();
} }
async test() { async test() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,8 +16,8 @@ const devices = require('./devices');
const linuxDesktop = devices['Linux Desktop']; const linuxDesktop = devices['Linux Desktop'];
class Page { class Page {
constructor(name) { constructor(page) {
this.name = name; this.page = page;
this.screenshotIndex = 0; this.screenshotIndex = 0;
this.meetingId; this.meetingId;
this.parentDir = this.getParentDir(__dirname); this.parentDir = this.getParentDir(__dirname);
@ -305,6 +305,15 @@ class Page {
await this.page.keyboard.up(key); 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) { async waitAndClick(element, timeout = ELEMENT_WAIT_TIME, relief = false) {
if (relief) await helper.sleep(1000); if (relief) await helper.sleep(1000);
await this.waitForSelector(element, timeout); await this.waitForSelector(element, timeout);

View File

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

View File

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

View File

@ -10,7 +10,7 @@ const { checkElementTextIncludes } = require('../core/util');
class Notifications extends MultiUsers { class Notifications extends MultiUsers {
constructor() { constructor() {
super('notifications'); super();
this.page1 = new Page(); this.page1 = new Page();
this.page2 = new Page(); this.page2 = new Page();
this.page3 = new Page(); this.page3 = new Page();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ const { VIDEO_LOADING_WAIT_TIME } = require('../core/constants'); // core consta
class Share extends Page { class Share extends Page {
constructor() { constructor() {
super('webcam-share-test'); super();
} }
async test() { async test() {

View File

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