2021-12-02 12:12:14 +08:00
|
|
|
const { MultiUsers } = require('../user/multiusers');
|
2021-11-30 21:42:57 +08:00
|
|
|
const e = require('../core/elements');
|
|
|
|
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
|
2022-09-23 04:17:15 +08:00
|
|
|
const { expect } = require('@playwright/test');
|
2021-11-30 21:42:57 +08:00
|
|
|
|
2021-12-02 12:12:14 +08:00
|
|
|
class Create extends MultiUsers {
|
2021-11-30 21:42:57 +08:00
|
|
|
constructor(browser, context) {
|
2021-12-02 12:12:14 +08:00
|
|
|
super(browser, context);
|
2021-11-30 21:42:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Create Breakoutrooms
|
2022-12-31 05:49:18 +08:00
|
|
|
async create(captureNotes = false, captureWhiteboard = false) {
|
2021-12-02 12:12:14 +08:00
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
//Randomly assignment
|
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
2022-12-31 05:49:18 +08:00
|
|
|
|
|
|
|
if(captureNotes) await this.modPage.page.check(e.captureBreakoutSharedNotes);
|
|
|
|
if(captureWhiteboard) await this.modPage.page.check(e.captureBreakoutWhiteboard);
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
|
|
|
|
await this.userPage.hasElement(e.modalConfirmButton);
|
|
|
|
await this.userPage.waitAndClick(e.modalDismissButton);
|
|
|
|
await this.modPage.hasElement(e.breakoutRoomsItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
async changeNumberOfRooms() {
|
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
|
|
|
|
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
2022-09-10 00:54:50 +08:00
|
|
|
await this.modPage.getLocator(e.selectNumberOfRooms).selectOption('7');
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
await this.modPage.waitAndClick(e.breakoutRoomsItem);
|
|
|
|
await this.modPage.checkElementCount(e.userNameBreakoutRoom7, 1);
|
|
|
|
}
|
2022-09-10 00:54:50 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
async changeDurationTime() {
|
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
|
|
|
|
|
|
|
//test minimum 5 minutes
|
|
|
|
await this.modPage.getLocator(e.durationTime).press('Backspace');
|
|
|
|
await this.modPage.getLocator(e.durationTime).press('Backspace');
|
|
|
|
await this.modPage.type(e.durationTime, '5');
|
2022-09-10 00:54:50 +08:00
|
|
|
await this.modPage.waitAndClick(e.decreaseBreakoutTime);
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.hasValue(e.durationTime, '5');
|
|
|
|
|
|
|
|
await this.modPage.getLocator(e.durationTime).press('Backspace');
|
|
|
|
await this.modPage.type(e.durationTime, '15');
|
|
|
|
await this.modPage.waitAndClick(e.increaseBreakoutTime);
|
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
await this.modPage.waitAndClick(e.breakoutRoomsItem);
|
2022-11-26 03:54:32 +08:00
|
|
|
await this.modPage.hasText(e.breakoutRemainingTime, /15:[0-5][0-9]/, ELEMENT_WAIT_LONGER_TIME);
|
2022-09-30 19:17:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async changeRoomsName() {
|
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
|
|
|
//Change room's name
|
|
|
|
await this.modPage.type(e.roomNameInput, 'Test');
|
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
|
|
|
|
await this.modPage.waitAndClick(e.breakoutRoomsItem);
|
|
|
|
await this.modPage.hasText(e.roomName1Test, /Test/);
|
|
|
|
}
|
|
|
|
|
|
|
|
async removeAndResetAssignments() {
|
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
2022-09-10 00:54:50 +08:00
|
|
|
|
|
|
|
//Reset assignments
|
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
2022-09-23 04:17:15 +08:00
|
|
|
await this.modPage.hasText(e.breakoutBox1, /Attendee/);
|
2022-09-10 00:54:50 +08:00
|
|
|
await this.modPage.waitAndClick(e.resetAssignments);
|
2022-09-23 04:17:15 +08:00
|
|
|
await this.modPage.hasText(e.breakoutBox0, /Attendee/);
|
2022-09-10 00:54:50 +08:00
|
|
|
|
|
|
|
//Remove specific assignment
|
2022-09-17 04:21:47 +08:00
|
|
|
await this.modPage.waitAndClick(e.randomlyAssign);
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.dragDropSelector(e.moveUser, e.breakoutBox0);
|
2022-09-17 04:21:47 +08:00
|
|
|
await this.modPage.hasText(e.breakoutBox0, /Attendee/);
|
2022-09-30 19:17:15 +08:00
|
|
|
}
|
2022-09-10 00:54:50 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
async dragDropUserInRoom() {
|
|
|
|
await this.modPage.waitAndClick(e.manageUsers);
|
|
|
|
await this.modPage.waitAndClick(e.createBreakoutRooms);
|
2022-09-16 02:31:10 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
//testing no user assigned
|
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton);
|
|
|
|
await this.modPage.hasElement(e.warningNoUserAssigned);
|
2022-11-26 03:54:32 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
//await this.modPage.hasElementDisabled(e.modalConfirmButton);
|
|
|
|
const modalConfirmButton = await this.modPage.getLocator(e.modalConfirmButton);
|
|
|
|
await expect(modalConfirmButton, 'Getting error when trying to create a breakout room without designating any user.').toBeDisabled();
|
2022-09-16 02:31:10 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.dragDropSelector(e.userTest, e.breakoutBox1);
|
|
|
|
await this.modPage.hasText(e.breakoutBox1, /Attendee/);
|
2021-12-02 12:12:14 +08:00
|
|
|
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.userPage.waitAndClick(e.modalConfirmButton);
|
2021-11-30 21:42:57 +08:00
|
|
|
|
2022-09-30 19:17:15 +08:00
|
|
|
await this.modPage.waitAndClick(e.breakoutRoomsItem);
|
|
|
|
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/);
|
2021-11-30 21:42:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-04 01:01:36 +08:00
|
|
|
exports.Create = Create;
|