2020-05-22 00:45:52 +08:00
|
|
|
const path = require('path');
|
2020-05-13 21:53:14 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const params = require('../params');
|
2020-05-22 00:45:52 +08:00
|
|
|
const helper = require('../core/helper');
|
2021-02-17 04:57:10 +08:00
|
|
|
const pe = require('../core/elements');
|
2020-05-13 21:53:14 +08:00
|
|
|
const cpe = require('./elements');
|
2021-02-17 04:57:10 +08:00
|
|
|
const we = require('../webcam/elements');
|
|
|
|
const ae = require('../audio/elements');
|
2020-05-13 21:53:14 +08:00
|
|
|
const util = require('./util');
|
2020-05-15 22:49:03 +08:00
|
|
|
const c = require('./constants');
|
2021-02-17 04:57:10 +08:00
|
|
|
const { ELEMENT_WAIT_TIME, VIDEO_LOADING_WAIT_TIME } = require('../core/constants'); // core constants (Timeouts vars imported)
|
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.name = name;
|
|
|
|
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('/');
|
|
|
|
}
|
|
|
|
|
|
|
|
async autoJoin(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector('div[data-test="chatMessages"]', ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.audioModal) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.audioModal) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return resp === true;
|
2020-05-13 21:53:14 +08:00
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
async listenOnlyMode(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(pe.audioDialog, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
const audioOptionsButton = await this.page1.page.evaluate(async () => {
|
|
|
|
const countFoundElements = await document.querySelectorAll('[class^="audioOptions"] > button').length;
|
|
|
|
return countFoundElements;
|
|
|
|
});
|
|
|
|
if (audioOptionsButton === 1) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return true;
|
|
|
|
} if (audioOptionsButton !== 1) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-13 23:26:30 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
async forceListenOnly(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page2.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page2.init(args, meetingId, { ...params, fullName: 'Attendee', moderatorPW: '' }, customParameter, testName);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page2.logger('after init ', testName);
|
2020-05-14 00:54:56 +08:00
|
|
|
if (await this.page2.page.$('[data-test="audioModalHeader"]')) {
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `02-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page2.logger(testName, ' failed');
|
2020-05-14 00:54:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page2.waitForSelector(cpe.toastContainer, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `02-success-${testName}`);
|
2020-05-14 00:54:56 +08:00
|
|
|
const resp = await util.forceListenOnly(this.page2);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page2.logger(testName, ' passed');
|
2020-05-14 00:54:56 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
async skipCheck(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2021-02-23 21:53:37 +08:00
|
|
|
await this.page1.click(ae.microphone, true);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(ae.connectingStatus, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.elementRemoved(ae.connectingStatus);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
2020-05-15 22:49:03 +08:00
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.echoTestYesButton) === true) {
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.echoTestYesButton) === false;
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2021-02-17 04:57:10 +08:00
|
|
|
async skipCheckOnFirstJoin(testName, args, meetingId, customParameter) {
|
|
|
|
const parsedSettings = await this.page1.getSettingsYaml();
|
|
|
|
const listenOnlyCallTimeout = parseInt(parsedSettings.public.media.listenOnlyCallTimeout);
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
const firstCheck = await this.page1.page.evaluate(util.getTestElement, ae.microphone) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.elementRemoved(ae.connectingStatus);
|
|
|
|
await this.page1.leaveAudio();
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
|
|
|
await this.page1.waitForSelector(pe.joinAudio, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page1.click(pe.joinAudio, true);
|
|
|
|
const secondCheck = await this.page1.page.evaluate(util.getTestElement, ae.microphone) === false;
|
|
|
|
|
|
|
|
if (firstCheck !== secondCheck) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
async clientTitle(testName, args, meetingId, customParameter) {
|
|
|
|
testName = 'clientTitle';
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(pe.whiteboard, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-05-15 22:49:03 +08:00
|
|
|
if (await !(await this.page1.page.title()).includes(c.docTitle)) {
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await (await this.page1.page.title()).includes(c.docTitle);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2020-05-22 00:45:52 +08:00
|
|
|
async askForFeedbackOnLogout(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-15 22:49:03 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-05-15 22:49:03 +08:00
|
|
|
await this.page1.logoutFromMeeting();
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.meetingEndedModal, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `04-${testName}`);
|
2020-06-16 01:21:44 +08:00
|
|
|
this.page1.logger('audio modal closed');
|
2020-05-15 22:49:03 +08:00
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.rating) === false) {
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `05-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.rating) === true;
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `05-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async displayBrandingArea(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-06-16 01:21:44 +08:00
|
|
|
this.page1.logger('audio modal closed');
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.userListContent, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.brandingAreaLogo) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.brandingAreaLogo) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async shortcuts(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-06-16 01:21:44 +08:00
|
|
|
this.page1.logger('audio modal closed');
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(pe.options, ELEMENT_WAIT_TIME);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.page.keyboard.down('Alt');
|
|
|
|
await this.page1.page.keyboard.press('O');
|
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.verticalListOptions) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.verticalListOptions) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async enableScreensharing(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
2020-05-22 20:39:16 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-22 00:45:52 +08:00
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.screenShareButton) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 00:45:52 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.screenShareButton) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-15 22:49:03 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2020-05-22 20:39:16 +08:00
|
|
|
async enableVideo(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 20:39:16 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-22 20:39:16 +08:00
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.shareWebcamButton) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 20:39:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.shareWebcamButton) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 20:39:16 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async autoShareWebcam(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-22 20:39:16 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-22 20:39:16 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === true) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-22 20:39:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === false;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-22 20:39:16 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2020-05-28 01:32:11 +08:00
|
|
|
async multiUserPenOnly(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Moderator2' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page2.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.multiUsersWhiteboard, ELEMENT_WAIT_TIME);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.click(cpe.multiUsersWhiteboard, true);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page2.waitForSelector(cpe.tools, ELEMENT_WAIT_TIME);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page2.click(cpe.tools, true);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
if (await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.childElementCount === 2)) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.childElementCount === 1);
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async presenterTools(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.tools, ELEMENT_WAIT_TIME);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.click(cpe.tools, true);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-${testName}`);
|
|
|
|
if (await this.page1.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 7)) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 2);
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async multiUserTools(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Moderator2' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page2.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.multiUsersWhiteboard), ELEMENT_WAIT_TIME;
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.click(cpe.multiUsersWhiteboard, true);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page2.waitForSelector(cpe.tools, ELEMENT_WAIT_TIME);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page2.click(cpe.tools, true);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
if (await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 7)) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 2);
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async customStyle(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.whiteboard, ELEMENT_WAIT_TIME);
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-09-22 02:22:11 +08:00
|
|
|
const isHidden = await this.page1.page.$eval('[class="presentationTitle--1LT79g"]', elem => elem.offsetHeight == 0);
|
2020-08-27 20:44:36 +08:00
|
|
|
if (isHidden === false) {
|
2020-05-28 01:32:11 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-05-28 01:32:11 +08:00
|
|
|
return false;
|
2020-09-22 02:22:11 +08:00
|
|
|
} if (isHidden === true) {
|
2020-08-27 20:44:36 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
const resp = isHidden;
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
2020-05-28 01:32:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-02 02:42:56 +08:00
|
|
|
async customStyleUrl(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.whiteboard, ELEMENT_WAIT_TIME);
|
2020-09-22 02:22:11 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
const isHidden = await this.page1.page.$eval('[class="presentationTitle--1LT79g"]', elem => elem.offsetHeight == 0);
|
2020-08-27 20:44:36 +08:00
|
|
|
if (isHidden === false) {
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
2020-09-22 02:22:11 +08:00
|
|
|
} if (isHidden === true) {
|
2020-08-27 20:44:36 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
const resp = isHidden;
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
2020-06-02 02:42:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async autoSwapLayout(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.container, ELEMENT_WAIT_TIME);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-09-22 02:22:11 +08:00
|
|
|
const isNotHidden = await this.page1.page.$eval(cpe.restorePresentation, elem => elem.offsetHeight !== 0);
|
2020-08-27 20:44:36 +08:00
|
|
|
console.log(isNotHidden);
|
|
|
|
if (isNotHidden === false) {
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
2020-09-22 02:22:11 +08:00
|
|
|
} if (isNotHidden === true) {
|
2020-08-27 20:44:36 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
const resp = isNotHidden;
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
2020-06-02 02:42:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async hidePresentation(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.actions, ELEMENT_WAIT_TIME);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async bannerText(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.actions, ELEMENT_WAIT_TIME);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.notificationBar) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.notificationBar) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-06-02 02:42:56 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async bannerColor(testName, args, meetingId, customParameter, colorToRGB) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.notificationBar, ELEMENT_WAIT_TIME);
|
2020-06-02 02:42:56 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2020-09-22 02:22:11 +08:00
|
|
|
const notificationBarColor = await this.page1.page.$eval('div[class^="notificationsBar--"]', elem => getComputedStyle(elem).backgroundColor);
|
|
|
|
console.log('colorToRGB => ', colorToRGB);
|
|
|
|
console.log('notificationBarColor => ', notificationBarColor);
|
2020-08-27 20:44:36 +08:00
|
|
|
if (notificationBarColor !== colorToRGB) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
2020-09-22 02:22:11 +08:00
|
|
|
} if (notificationBarColor === colorToRGB) {
|
2020-08-27 20:44:36 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return true;
|
|
|
|
}
|
2020-06-02 02:42:56 +08:00
|
|
|
}
|
|
|
|
|
2020-06-09 03:40:28 +08:00
|
|
|
async hideAndSwapPresentation(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.container, ELEMENT_WAIT_TIME);
|
2020-06-09 03:40:28 +08:00
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === false && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === true && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
2020-06-16 01:21:44 +08:00
|
|
|
|
2020-06-09 03:40:28 +08:00
|
|
|
async showPublicChatOnLogin(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.closeAudioModal();
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.container, ELEMENT_WAIT_TIME);
|
2020-06-09 03:40:28 +08:00
|
|
|
if (await this.page1.page.evaluate(util.countTestElements, cpe.chat) === true) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.chat) === false;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async forceRestorePresentationOnNewEvents(testName, args, meetingId, customParameter) {
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('before init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Viewer1', moderatorPW: '' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger('after init ', testName);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.closeAudioModal();
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.container, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page2.waitForSelector(cpe.hidePresentation, ELEMENT_WAIT_TIME);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page2.click(cpe.hidePresentation, true);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
|
|
|
const zoomInCase = await util.zoomIn(this.page1);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
const zoomOutCase = await util.zoomOut(this.page1);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
const pollCase = await util.poll(this.page1, this.page2);
|
2020-06-09 03:40:28 +08:00
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
const previousSlideCase = await util.previousSlide(this.page1);
|
|
|
|
await this.page1.screenshot(`${testName}`, `04-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-${testName}`);
|
|
|
|
const nextSlideCase = await util.nextSlide(this.page1);
|
|
|
|
await this.page1.screenshot(`${testName}`, `05-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `06-page2-${testName}`);
|
|
|
|
const annotationCase = await util.annotation(this.page1);
|
|
|
|
await this.page1.screenshot(`${testName}`, `06-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `07-page2-${testName}`);
|
2020-06-16 01:21:44 +08:00
|
|
|
if (zoomInCase === true && zoomOutCase === true && pollCase === true && previousSlideCase === true && nextSlideCase === true && annotationCase === true
|
|
|
|
&& await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === true) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `08-page2-fail-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' failed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === false;
|
2020-06-16 01:21:44 +08:00
|
|
|
await this.page2.screenshot(`${testName}`, `08-page2-success-${testName}`);
|
2020-08-27 20:44:36 +08:00
|
|
|
this.page1.logger(testName, ' passed');
|
2020-06-09 03:40:28 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-02-17 04:57:10 +08:00
|
|
|
async forceRestorePresentationOnNewPollResult(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
|
|
|
|
await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Viewer1', moderatorPW: '' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
|
|
|
|
await this.page2.closeAudioModal();
|
|
|
|
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
|
|
|
|
await this.page1.waitForSelector(cpe.container, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page2.waitForSelector(cpe.hidePresentation, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page2.click(cpe.hidePresentation, true);
|
|
|
|
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
|
|
|
|
const pollCase = await util.poll(this.page1, this.page2);
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
|
|
|
|
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
|
|
|
|
if (pollCase === true
|
|
|
|
&& await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === true) {
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === false;
|
|
|
|
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-09-22 02:22:11 +08:00
|
|
|
async recordMeeting(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.recordingIndicator) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.recordingIndicator) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async skipVideoPreview(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.shareWebcamButton, ELEMENT_WAIT_TIME);
|
2020-09-22 02:22:11 +08:00
|
|
|
await this.page1.click(cpe.shareWebcamButton, true);
|
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2021-02-17 04:57:10 +08:00
|
|
|
async skipVideoPreviewOnFirstJoin(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
|
|
|
await this.page1.waitForSelector(we.joinVideo, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page1.click(we.joinVideo, true);
|
|
|
|
const firstCheck = await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === true;
|
|
|
|
await this.page1.waitForSelector(we.leaveVideo, VIDEO_LOADING_WAIT_TIME);
|
|
|
|
await this.page1.click(we.leaveVideo, true);
|
|
|
|
await this.page1.elementRemoved(we.webcamVideo);
|
|
|
|
await this.page1.elementRemoved(we.leaveVideo);
|
|
|
|
|
|
|
|
await this.page1.waitForSelector(we.joinVideo, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page1.click(we.joinVideo, true);
|
|
|
|
const parsedSettings = await this.page1.getSettingsYaml();
|
|
|
|
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
|
|
|
|
await this.page1.waitForSelector(cpe.webcamVideoPreview, videoPreviewTimeout);
|
|
|
|
await this.page1.waitForSelector(cpe.startSharingWebcamButton, ELEMENT_WAIT_TIME);
|
|
|
|
const secondCheck = await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === false;
|
|
|
|
await this.page1.click(cpe.startSharingWebcamButton, true);
|
|
|
|
await this.page1.waitForSelector(we.webcamConnecting, ELEMENT_WAIT_TIME);
|
|
|
|
|
|
|
|
if (firstCheck !== secondCheck) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-09-22 02:22:11 +08:00
|
|
|
async mirrorOwnWebcam(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.shareWebcamButton, ELEMENT_WAIT_TIME);
|
2020-09-22 02:22:11 +08:00
|
|
|
await this.page1.click(cpe.shareWebcamButton, true);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.webcamMirroredVideoPreview, ELEMENT_WAIT_TIME);
|
|
|
|
await this.page1.waitForSelector(cpe.startSharingWebcamButton, ELEMENT_WAIT_TIME);
|
2020-09-22 02:22:11 +08:00
|
|
|
await this.page1.click(cpe.startSharingWebcamButton, true);
|
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.webcamMirroredVideoContainer) === true) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.webcamMirroredVideoContainer) === false;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async showParticipantsOnLogin(testName, args, meetingId, customParameter) {
|
|
|
|
this.page1.logger('before init ', testName);
|
|
|
|
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);
|
|
|
|
await this.page1.screenshot(`${testName}`, `01-${testName}`);
|
|
|
|
this.page1.logger('after init ', testName);
|
|
|
|
await this.page1.closeAudioModal();
|
|
|
|
await this.page1.screenshot(`${testName}`, `02-${testName}`);
|
2021-02-17 04:57:10 +08:00
|
|
|
await this.page1.waitForSelector(cpe.whiteboard, ELEMENT_WAIT_TIME);
|
2020-09-22 02:22:11 +08:00
|
|
|
if (await this.page1.page.evaluate(util.getTestElement, cpe.userslistContainer) === false) {
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
|
|
|
|
this.page1.logger(testName, ' failed');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const resp = await this.page1.page.evaluate(util.getTestElement, cpe.userslistContainer) === true;
|
|
|
|
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
|
|
|
|
this.page1.logger(testName, ' passed');
|
|
|
|
return resp === true;
|
|
|
|
}
|
|
|
|
|
2020-05-13 21:53:14 +08:00
|
|
|
async closePage(page) {
|
|
|
|
page.close();
|
|
|
|
}
|
|
|
|
|
2020-05-13 23:26:30 +08:00
|
|
|
async close(page1, page2) {
|
2020-05-13 21:53:14 +08:00
|
|
|
page1.close();
|
|
|
|
page2.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = CustomParameters;
|