2020-05-13 21:53:14 +08:00
|
|
|
const Page = require('../core/page');
|
2021-09-22 11:51:29 +08:00
|
|
|
const e = require('../core/elements');
|
|
|
|
const c = require('./constants');
|
2020-05-13 21:53:14 +08:00
|
|
|
const util = require('./util');
|
2021-09-22 21:11:56 +08:00
|
|
|
const { VIDEO_LOADING_WAIT_TIME, ELEMENT_WAIT_LONGER_TIME } = require('../core/constants'); // core constants (Timeouts vars imported)
|
2021-10-07 22:29:18 +08:00
|
|
|
const { checkElementLengthEqualTo, checkElement } = require('../core/util');
|
2020-05-13 21:53:14 +08:00
|
|
|
|
|
|
|
class CustomParameters {
|
|
|
|
constructor() {
|
|
|
|
this.page1 = new Page();
|
|
|
|
this.page2 = new Page();
|
2020-05-22 00:45:52 +08:00
|
|
|
this.screenshotIndex = 0;
|
|
|
|
this.parentDir = this.getParentDir(__dirname);
|
2020-05-13 21:53:14 +08:00
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
getParentDir(dir) {
|
|
|
|
const tmp = dir.split('/');
|
|
|
|
tmp.pop();
|
|
|
|
return tmp.join('/');
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async autoJoin(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, false, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.chatMessages);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.wasRemoved(e.audioModal);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-05-13 21:53:14 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async listenOnlyMode(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, false, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.waitForSelector(e.audioModal);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
const audioOptionsButton = await this.page1.page.evaluate(checkElementLengthEqualTo, e.audioOptionsButtons, 1);
|
|
|
|
if (!audioOptionsButton) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-13 23:26:30 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async forceListenOnly(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.init(false, false, testName, 'Attendee', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page2.startRecording(testName);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
if (await this.page2.page.$(e.audioModalHeader)) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
await this.page2.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page2.waitForSelector(e.toastContainer);
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
const resp = await util.forceListenOnly(this.page2);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page2.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page2.logger(err);
|
2020-05-14 00:54:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async skipCheck(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(false, false, testName, 'Attendee', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.microphoneButton);
|
|
|
|
await this.page1.waitForSelector(e.connectingStatus);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.waitForElementHandleToBeRemoved(e.connectingStatus, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.wasRemoved(e.echoYesButton);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-15 22:49:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async skipCheckOnFirstJoin(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, false, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.microphoneButton);
|
2021-10-07 22:29:18 +08:00
|
|
|
const firstCheck = await this.page1.hasElement(e.connecting);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.leaveAudio();
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.joinAudio);
|
|
|
|
await this.page1.waitAndClick(e.microphoneButton);
|
2021-10-07 22:29:18 +08:00
|
|
|
const secondCheck = await this.page1.hasElement(e.connectingToEchoTest);
|
2021-09-23 02:53:46 +08:00
|
|
|
|
|
|
|
if (firstCheck !== secondCheck) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2021-02-17 04:57:10 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async clientTitle(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.whiteboard);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
const resp = await (await this.page1.page.title()).includes(c.docTitle);
|
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-15 22:49:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async askForFeedbackOnLogout(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.logoutFromMeeting();
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.meetingEndedModal);
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-${testName}`);
|
|
|
|
await this.page1.logger('audio modal closed');
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.hasElement(e.rating);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `05-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `05-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-22 00:45:52 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async displayBrandingArea(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.logger('audio modal closed');
|
|
|
|
await this.page1.waitForSelector(e.userListContent);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.hasElement(e.brandingAreaLogo);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async shortcuts(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-10-18 22:23:00 +08:00
|
|
|
await this.page2.init(false, true, testName, 'Attendee', this.page1.meetingId);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
2021-10-18 22:23:00 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, '01-after-close-audio-modal');
|
2021-09-23 02:53:46 +08:00
|
|
|
|
2021-10-18 22:23:00 +08:00
|
|
|
// Check the initial shortcuts that can be used right after joining the meeting
|
|
|
|
const check1 = await util.checkShortcutsArray(this.page1, c.initialShortcuts);
|
|
|
|
if (!check1) return false;
|
|
|
|
await this.page1.bringToFront();
|
|
|
|
|
|
|
|
// Join audio
|
|
|
|
await this.page1.waitAndClick(e.joinAudio);
|
|
|
|
await this.page1.joinMicrophone();
|
|
|
|
await this.page1.screenshot(`${testName}`, '02-after-join-audio');
|
|
|
|
|
|
|
|
// Open private chat
|
|
|
|
await this.page1.waitAndClick(e.userListItem);
|
|
|
|
await this.page1.waitAndClick(e.activeChat);
|
|
|
|
await this.page1.waitForSelector(e.hidePrivateChat);
|
|
|
|
await this.page1.screenshot(`${testName}`, '03-after-open-private-chat');
|
|
|
|
|
|
|
|
// Check the later shortcuts that can be used after joining audio and opening private chat
|
|
|
|
const check2 = await util.checkShortcutsArray(this.page1, c.laterShortcuts);
|
|
|
|
|
|
|
|
return check2 === true;
|
2021-09-23 02:53:46 +08:00
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-22 00:45:52 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async enableScreensharing(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.wasRemoved(e.startScreenSharing);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-05-15 22:49:03 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async enableVideo(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2021-10-05 04:42:58 +08:00
|
|
|
const resp = await this.page1.wasRemoved(e.joinVideo);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-22 20:39:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async autoShareWebcam(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-09-23 05:16:31 +08:00
|
|
|
const resp = await this.page1.hasElement(e.webcamSettingsModal);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-05-22 20:39:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async multiUserPenOnly(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.init(true, true, testName, 'Moderator2', this.page1.meetingId, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page2.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.multiUsersWhiteboard);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.waitAndClick(e.tools);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
const resp = await this.page2.page.evaluate((toolsElement) => {
|
|
|
|
return document.querySelectorAll(toolsElement)[0].parentElement.childElementCount === 1;
|
|
|
|
}, e.tools);
|
|
|
|
if (!resp) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-28 01:32:11 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async presenterTools(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.tools);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
|
|
|
const resp = await this.page1.page.evaluate((toolsElement, toolbarListSelector) => {
|
|
|
|
return document.querySelectorAll(toolsElement)[0].parentElement.querySelector(toolbarListSelector).childElementCount === 2;
|
|
|
|
}, e.tools, e.toolbarListClass);
|
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-28 01:32:11 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async multiUserTools(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.init(true, true, testName, 'Moderator2', this.page1.meetingId, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page2.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.multiUsersWhiteboard);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.waitAndClick(e.tools);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
const resp = await this.page2.page.evaluate((toolsElement, toolbarListSelector) => {
|
|
|
|
return document.querySelectorAll(toolsElement)[0].parentElement.querySelector(toolbarListSelector).childElementCount === 2;
|
|
|
|
}, e.tools, e.toolbarListClass);
|
|
|
|
if (!resp) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-28 01:32:11 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async customStyle(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.whiteboard);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
const isHidden = await this.page1.page.$eval(e.presentationTitle, elem => elem.offsetHeight == 0);
|
|
|
|
if (isHidden !== true) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
const resp = isHidden;
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async autoSwapLayout(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.actions);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
const isNotHidden = await this.page1.page.$eval(e.restorePresentation, elem => elem.offsetHeight !== 0);
|
|
|
|
if (isNotHidden !== true) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
const resp = isNotHidden;
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async hidePresentation(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.actions);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-10-07 22:29:18 +08:00
|
|
|
const checkPresentationButton = await this.page1.page.evaluate(checkElement, e.restorePresentation);
|
|
|
|
const checkPresentationPlaceholder = await this.page1.page.evaluate(checkElement, e.presentationPlaceholder);
|
|
|
|
const resp = !(checkPresentationButton || checkPresentationPlaceholder);
|
|
|
|
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async bannerText(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.actions);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.hasElement(e.notificationBar);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async bannerColor(testName, customParameter, colorToRGB) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.notificationBar);
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
const notificationBarColor = await this.page1.page.$eval(e.notificationBar, elem => getComputedStyle(elem).backgroundColor);
|
|
|
|
if (notificationBarColor !== colorToRGB) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-08-27 20:44:36 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-06-02 02:42:56 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async hideAndSwapPresentation(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.actions);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.hasElement(e.restorePresentation) && await this.page1.hasElement(e.defaultContent);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-09 03:40:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2020-06-16 01:21:44 +08:00
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async showPublicChatOnLogin(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.actions);
|
|
|
|
const resp = await this.page1.page.evaluate(checkElementLengthEqualTo, e.chat, 0);
|
|
|
|
if (!resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-06-09 03:40:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async forceRestorePresentationOnNewEvents(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.init(true, true, testName, 'Moderator2', this.page1.meetingId, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page2.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
2021-10-27 01:52:52 +08:00
|
|
|
await this.page2.waitAndClick(e.minimizePresentation);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
const zoomInCase = await util.zoomIn(this.page1);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
const zoomOutCase = await util.zoomOut(this.page1);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
const pollCase = await util.poll(this.page1, this.page2);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
|
|
|
const previousSlideCase = await util.previousSlide(this.page1);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
2021-09-30 20:36:08 +08:00
|
|
|
const nextSlideCase = await util.nextSlide(this.page1);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `04-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-${testName}`);
|
2021-09-30 20:36:08 +08:00
|
|
|
const annotationCase = await util.annotation(this.page1);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `05-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `06-page2-${testName}`);
|
|
|
|
|
2021-10-07 22:29:18 +08:00
|
|
|
const test = await this.page2.page.evaluate(checkElement, e.restorePresentation);
|
2021-09-23 02:53:46 +08:00
|
|
|
const resp = (zoomInCase && zoomOutCase && pollCase && previousSlideCase && nextSlideCase && annotationCase && test);
|
|
|
|
if (resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `07-page2-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `07-page2-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2020-06-09 03:40:28 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async forceRestorePresentationOnNewPollResult(customParameter, testName) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
|
|
|
await this.page2.init(false, true, testName, 'Viewer1', this.page1.meetingId, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page2.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
2021-10-27 01:52:52 +08:00
|
|
|
await this.page2.waitAndClick(e.minimizePresentation);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
const pollCase = await util.poll(this.page1, this.page2) === true;
|
|
|
|
await this.page2.waitForSelector(e.smallToastMsg);
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
|
2021-10-07 22:29:18 +08:00
|
|
|
const test = await this.page2.page.evaluate(checkElement, e.restorePresentation);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (pollCase && test) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2021-02-17 04:57:10 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async recordMeeting(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
const resp = await this.page1.page.evaluate(checkElementLengthEqualTo, e.recordingIndicator, 0);
|
|
|
|
if (!resp) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async skipVideoPreview(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.joinVideo);
|
|
|
|
const resp = await this.page1.page.evaluate(checkElementLengthEqualTo, e.webcamSettingsModal, 0);
|
|
|
|
if (!resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async skipVideoPreviewOnFirstJoin(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2021-10-05 04:42:58 +08:00
|
|
|
await this.page1.shareWebcam(false);
|
|
|
|
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.waitAndClick(e.leaveVideo, VIDEO_LOADING_WAIT_TIME);
|
2021-09-23 06:13:12 +08:00
|
|
|
await this.page1.waitForElementHandleToBeRemoved(e.webcamVideo, ELEMENT_WAIT_LONGER_TIME);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.waitForElementHandleToBeRemoved(e.leaveVideo, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
|
|
|
|
const parsedSettings = await this.page1.getSettingsYaml();
|
|
|
|
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
|
2021-10-05 04:42:58 +08:00
|
|
|
await this.page1.shareWebcam(true, videoPreviewTimeout);
|
2021-09-23 02:53:46 +08:00
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} catch (err) {
|
2021-10-05 04:42:58 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(err);
|
|
|
|
return false;
|
|
|
|
}
|
2021-02-17 04:57:10 +08:00
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async mirrorOwnWebcam(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitAndClick(e.joinVideo);
|
|
|
|
await this.page1.waitForSelector(e.webcamMirroredVideoPreview);
|
|
|
|
await this.page1.waitAndClick(e.startSharingWebcam);
|
2021-10-07 22:29:18 +08:00
|
|
|
const resp = await this.page1.hasElement(e.webcamMirroredVideoContainer);
|
2021-09-23 02:53:46 +08:00
|
|
|
if (!resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:36:08 +08:00
|
|
|
async showParticipantsOnLogin(testName, customParameter) {
|
2021-09-23 02:53:46 +08:00
|
|
|
try {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.init(true, true, testName, 'Moderator1', undefined, customParameter);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.startRecording(testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
await this.page1.waitForSelector(e.whiteboard);
|
|
|
|
const resp = await this.page1.page.evaluate(checkElementLengthEqualTo, e.userslistContainer, 0);
|
|
|
|
if (!resp) {
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
2021-09-30 20:36:08 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2021-09-23 02:53:46 +08:00
|
|
|
await this.page1.logger(testName, ' passed');
|
|
|
|
|
|
|
|
return resp === true;
|
|
|
|
} catch (err) {
|
|
|
|
await this.page1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2020-05-13 21:53:14 +08:00
|
|
|
}
|
|
|
|
|
2023-04-04 04:23:26 +08:00
|
|
|
module.exports = exports = CustomParameters;
|