fix guest policy tests

This commit is contained in:
Anton 2022-02-03 17:10:26 -03:00
parent 88277f587b
commit 19070895ee
2 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,7 @@
const { MultiUsers } = require("./multiusers");
const e = require('../core/elements');
const { sleep } = require('../core/helpers');
const { setGuestPolicyOption } = require("./util");
class GuestPolicy extends MultiUsers {
constructor(browser, context) {
@ -8,25 +9,22 @@ class GuestPolicy extends MultiUsers {
}
async askModerator() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.guestPolicyLabel);
await this.modPage.waitAndClick(e.askModerator);
await setGuestPolicyOption(this.modPage, e.askModerator);
await sleep(500);
await this.initUserPage(false);
await this.modPage.hasElement(e.waitingUsersBtn);
}
async alwaysAccept() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.guestPolicyLabel);
await this.modPage.waitAndClick(e.alwaysAccept);
await setGuestPolicyOption(this.modPage, e.askModerator);
await setGuestPolicyOption(this.modPage, e.alwaysAccept);
await sleep(500);
await this.initUserPage(false);
await this.userPage.hasElement(e.audioModal);
}
async alwaysDeny() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.guestPolicyLabel);
await this.modPage.waitAndClick(e.alwaysDeny);
await setGuestPolicyOption(this.modPage, e.alwaysDeny);
await sleep(1500);
await this.initUserPage(false);
await this.userPage.hasElement(e.joinMeetingDemoPage);

View File

@ -11,5 +11,12 @@ async function openLockViewers(test) {
await test.waitAndClick(e.lockViewersButton);
}
async function setGuestPolicyOption(test, option) {
await test.waitAndClick(e.manageUsers);
await test.waitAndClick(e.guestPolicyLabel);
await test.waitAndClick(option);
}
exports.setStatus = setStatus;
exports.openLockViewers = openLockViewers;
exports.setGuestPolicyOption = setGuestPolicyOption;