test: Add message to the test expect (#20718)

* first steps

* few messages added

* added more messages to the failed tests

* layouts,notifications

* more messages to help

* adding messages to the upload other presentations format

* messages for upload multiple presentation test

* added most of the expect messages

* updates for merging

* fixed broken tests
This commit is contained in:
Gabriel Luiz Porfirio 2024-07-30 19:49:02 -03:00 committed by GitHub
parent 2e9134a02f
commit aa57d4528b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 716 additions and 716 deletions

View File

@ -18,10 +18,10 @@ class Audio extends MultiUsers {
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitAndClick(e.listenOnlyButton);
await this.modPage.waitForSelector(e.establishingAudioLabel);
await this.modPage.wasRemoved(e.establishingAudioLabel, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.establishingAudioLabel, 'Should have audio established.', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitForSelector(e.leaveListenOnly, listenOnlyCallTimeout);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.hasElement(e.leaveAudio);
await this.modPage.hasElement(e.leaveAudio, 'Should have the microphone connected.');
await this.modPage.waitAndClick(e.leaveAudio);
}
@ -29,9 +29,9 @@ class Audio extends MultiUsers {
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
await this.modPage.hasElement(e.muteMicButton);
await this.modPage.hasElement(e.muteMicButton, 'Should have the microphone connected.');
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.hasElement(e.leaveAudio);
await this.modPage.hasElement(e.leaveAudio, 'Should have the microphone connected.');
await this.modPage.waitAndClick(e.leaveAudio);
}
@ -39,13 +39,13 @@ class Audio extends MultiUsers {
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.isTalking, 'Moderator should be talking.');
await this.modPage.waitAndClick(e.muteMicButton);
await this.modPage.wasRemoved(e.isTalking);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.wasRemoved(e.muteMicButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.wasRemoved(e.talkingIndicator, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.isTalking, 'Moderator should stop talking.');
await this.modPage.hasElement(e.wasTalking, 'Should stop talking.');
await this.modPage.wasRemoved(e.muteMicButton, 'Should be muted.');
await this.modPage.hasElement(e.unmuteMicButton, 'Should have the unmute mic button.');
await this.modPage.wasRemoved(e.talkingIndicator, 'Talking indicator should disappear', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.unmuteMicButton);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
@ -58,8 +58,8 @@ class Audio extends MultiUsers {
await this.modPage.waitAndClick(e.audioDropdownMenu);
await isAudioItemSelected(this.modPage, e.defaultInputAudioDevice);
await this.modPage.waitAndClick(e.secondInputAudioDevice);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.muteMicButton);
await this.modPage.hasElement(e.isTalking, 'should be talking.');
await this.modPage.hasElement(e.muteMicButton, 'should have the mute microphone button displayed.');
await this.modPage.waitAndClick(e.audioDropdownMenu);
await isAudioItemSelected(this.modPage, e.secondInputAudioDevice);
await this.modPage.waitAndClick(e.leaveAudio);
@ -72,21 +72,21 @@ class Audio extends MultiUsers {
const isMuted = await this.modPage.checkElement(e.unmuteMicButton);
if (isMuted) {
await this.modPage.waitAndClick(e.unmuteMicButton);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.isTalking, 'should be talking.');
}
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.isTalking, 'should be talking');
await this.modPage.waitAndClick(e.muteMicButton);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.wasRemoved(e.muteMicButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.hasElement(e.wasTalking, 'should stopped talking');
await this.modPage.wasRemoved(e.muteMicButton, 'should be muted');
await this.modPage.hasElement(e.unmuteMicButton, 'should be muted.');
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitAndClick(e.microphoneButton);
await this.modPage.waitAndClick(e.joinEchoTestButton);
await this.modPage.waitForSelector(e.establishingAudioLabel);
await this.modPage.wasRemoved(e.establishingAudioLabel, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.wasRemoved(e.establishingAudioLabel, 'Audio should be established.', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.unmuteMicButton, 'should be muted');
await this.modPage.waitAndClick(e.unmuteMicButton);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
@ -99,20 +99,20 @@ class Audio extends MultiUsers {
const isMuted = await this.modPage.checkElement(e.unmuteMicButton);
if (isMuted) {
await this.modPage.waitAndClick(e.unmuteMicButton);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.isTalking, 'Should be talking');
}
await this.modPage.waitAndClick(e.talkingIndicator);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.wasRemoved(e.muteMicButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.wasRemoved(e.isTalking);
await this.modPage.wasRemoved(e.talkingIndicator, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.wasTalking, 'should stops talking');
await this.modPage.wasRemoved(e.muteMicButton, 'should be unmuted');
await this.modPage.hasElement(e.unmuteMicButton, 'should be muted');
await this.modPage.wasRemoved(e.isTalking, 'should stop talking');
await this.modPage.wasRemoved(e.talkingIndicator, 'talking indicator should disappear', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
}
async muteAnotherUser() {
// tirar o audio do moderator!!!!!
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
await this.userPage.waitAndClick(e.joinAudio);
@ -120,15 +120,15 @@ class Audio extends MultiUsers {
await this.userPage.waitAndClick(e.muteMicButton);
await this.modPage.waitAndClick(e.isTalking);
await this.userPage.hasElement(e.unmuteMicButton);
await this.userPage.hasElement(e.unmuteMicButton, 'attendee should be muted');
const moderatorWasTalkingLocator = await this.modPage.getLocator(e.wasTalking).first();
const userWasTalkingLocator = await this.userPage.getLocator(e.wasTalking).last();
await expect(moderatorWasTalkingLocator).toBeVisible();
await expect(userWasTalkingLocator).toBeVisible();
await this.userPage.wasRemoved(e.talkingIndicator, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.talkingIndicator);
await expect(userWasTalkingLocator, 'should stop displaying isTalking element and display the element with high opacity for the attende').toBeVisible();
await this.userPage.wasRemoved(e.talkingIndicator, 'attende should be muted', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.talkingIndicator, 'moderator should be muted');
}
}

View File

@ -20,9 +20,9 @@ class Create extends MultiUsers {
if (captureWhiteboard) await this.modPage.page.check(e.captureBreakoutWhiteboard);
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.modalConfirmButton);
await this.userPage.hasElement(e.modalConfirmButton, 'should appear the modal confirm button to join breakout');
await this.userPage.waitAndClick(e.modalDismissButton);
await this.modPage.hasElement(e.breakoutRoomsItem);
await this.modPage.hasElement(e.breakoutRoomsItem, 'should have the breakout room item');
}
async createToAllowChooseOwnRoom() {
@ -45,7 +45,7 @@ class Create extends MultiUsers {
await this.modPage.getLocator(e.selectNumberOfRooms).selectOption('7');
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.checkElementCount(e.userNameBreakoutRoom7, 1);
await this.modPage.checkElementCount(e.userNameBreakoutRoom7, 1, 'should have one user on the breakout room number 7');
}
async changeDurationTime() {
@ -59,17 +59,17 @@ class Create extends MultiUsers {
await this.modPage.getLocator(e.durationTime).press('Backspace');
await this.modPage.getLocator(e.durationTime).press('Backspace');
await this.modPage.type(e.durationTime, '5');
await expect(createButtonLocator).toBeEnabled();
await expect(createButtonLocator, 'should have the create button for the breakout rooms enabled.').toBeEnabled();
await this.modPage.page.fill(e.durationTime, '4');
await expect(createButtonLocator).toBeDisabled();
await this.modPage.hasElement(e.minimumDurationWarnBreakout);
await expect(createButtonLocator, 'should have the breakout room create button disabled.').toBeDisabled();
await this.modPage.hasElement(e.minimumDurationWarnBreakout, 'should have at least 5 minutes of breakout room duration time.');
// await this.modPage.getLocator(e.durationTime).press('Backspace');
await this.modPage.page.fill(e.durationTime, '15');
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.hasText(e.breakoutRemainingTime, /14:[0-5][0-9]/, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasText(e.breakoutRemainingTime, /14:[0-5][0-9]/, 'should have the breakout room remaining time between 14:00 and 14:59 minutes', ELEMENT_WAIT_LONGER_TIME);
}
async changeRoomsName() {
@ -80,7 +80,7 @@ class Create extends MultiUsers {
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/);
await this.modPage.hasText(e.roomName1Test, /Test/, 'should display the correct breakout room name');
}
async removeAndResetAssignments() {
@ -89,14 +89,14 @@ class Create extends MultiUsers {
// Reset assignments
await this.modPage.dragDropSelector(e.attendeeNotAssigned, e.breakoutBox1);
await this.modPage.hasText(e.breakoutBox1, /Attendee/);
await this.modPage.hasText(e.breakoutBox1, /Attendee/, 'should have an attende on second breakout room box');
await this.modPage.waitAndClick(e.resetAssignments);
await this.modPage.hasText(e.breakoutBox0, /Attendee/);
await this.modPage.hasText(e.breakoutBox0, /Attendee/, 'should have and attende on first breakout room box');
// Remove specific assignment
await this.modPage.dragDropSelector(e.attendeeNotAssigned, e.breakoutBox1);
await this.modPage.waitAndClick(`${e.breakoutBox1} span[role="button"]`);
await this.modPage.hasText(e.breakoutBox0, /Attendee/);
await this.modPage.hasText(e.breakoutBox0, /Attendee/, 'should have and attende on first breakout room box');
}
async dragDropUserInRoom() {
@ -105,18 +105,18 @@ class Create extends MultiUsers {
//testing no user assigned
const modalConfirmButton = this.modPage.getLocator(e.modalConfirmButton);
await expect(modalConfirmButton, 'Getting error when trying to create a breakout room without designating any user.').toBeDisabled();
await this.modPage.hasElement(e.warningNoUserAssigned);
await expect(modalConfirmButton, 'should designate a user to a specific a breakout room, before creating it').toBeDisabled();
await this.modPage.hasElement(e.warningNoUserAssigned, 'should designate a user to a specific a breakout room, before creating it');
await this.modPage.dragDropSelector(e.attendeeNotAssigned, e.breakoutBox1);
await this.modPage.hasText(e.breakoutBox1, /Attendee/);
await this.modPage.hasText(e.breakoutBox1, /Attendee/, 'should have the attende on the second breakout room');
await expect(modalConfirmButton).toBeEnabled();
await this.modPage.wasRemoved(e.warningNoUserAssigned);
await this.modPage.wasRemoved(e.warningNoUserAssigned, 'should designate a user to a specific a breakout room, before creating it');
await this.modPage.waitAndClick(e.modalConfirmButton, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.waitAndClick(e.modalConfirmButton);
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/, 'should have the attende name on the first breakout room', ELEMENT_WAIT_LONGER_TIME);
}
}

View File

@ -22,17 +22,17 @@ class Join extends Create {
await this.userPage.waitAndClick(e.breakoutRoomsItem);
await this.userPage.waitAndClick(e.joinRoom1);
await this.userPage.waitForSelector(e.alreadyConnected, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.alreadyConnected, 'should display the element alreadyConnected', ELEMENT_WAIT_LONGER_TIME);
const breakoutUserPage = await this.userPage.getLastTargetPage(this.context);
await breakoutUserPage.bringToFront();
if (shouldJoinAudio) {
await this.userPage.waitForSelector(e.joinAudio);
await this.userPage.hasElement(e.joinAudio, 'should display the join audio button');
} else {
await breakoutUserPage.closeAudioModal();
}
await breakoutUserPage.waitForSelector(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should display the presentation title on the breakout room');
return breakoutUserPage;
}
@ -52,20 +52,20 @@ class Join extends Create {
async joinWithAudio() {
const breakoutUserPage = await this.joinRoom(true);
await breakoutUserPage.waitForSelector(e.talkingIndicator);
await breakoutUserPage.hasElement(e.isTalking);
await breakoutUserPage.hasElement(e.talkingIndicator, 'should display the talking indicator element');
await breakoutUserPage.hasElement(e.isTalking, 'should have the element isTalking active');
}
async messageToAllRooms() {
const breakoutUserPage = await this.joinRoom();
await breakoutUserPage.hasElement(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should have the presentation title once the user is on the breakout room.');
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.hasElement(e.breakoutRemainingTime);
await this.modPage.type(e.chatBox, "test");
await this.modPage.waitAndClick(e.sendButton);
await breakoutUserPage.hasElement(e.chatUserMessageText);
await breakoutUserPage.hasElement(e.chatUserMessageText, 'should have a test message on the public chat.');
}
async changeDurationTime() {
@ -78,9 +78,9 @@ class Join extends Create {
await this.modPage.getLocator(e.inputSetTimeSelector).press('Backspace');
await this.modPage.type(e.inputSetTimeSelector, '2');
await this.modPage.waitAndClick(e.sendButtonDurationTime);
await this.modPage.hasText(e.breakoutRemainingTime, /[11-12]:[0-5][0-9]/);
await this.modPage.hasText(e.breakoutRemainingTime, /[11-12]:[0-5][0-9]/, 'should have the breakout room time remaining counting down on the main meeting');
await breakoutUserPage.hasText(e.timeRemaining, /[11-12]:[0-5][0-9]/);
await breakoutUserPage.hasText(e.timeRemaining, /[11-12]:[0-5][0-9]/, 'should have the time remaining counting down on the breakout room');
}
async inviteUserAfterCreatingRooms() {
@ -88,22 +88,22 @@ class Join extends Create {
await this.modPage.waitAndClick(e.breakoutOptionsMenu);
await this.modPage.waitAndClick(e.openUpdateBreakoutUsersModal);
await this.modPage.dragDropSelector(e.attendeeNotAssigned, e.breakoutBox1);
await this.modPage.hasText(e.breakoutBox1, /Attendee/);
await this.modPage.hasText(e.breakoutBox1, /Attendee/, 'should have the attende name on the second breakout room box.');
await this.modPage.waitAndClick(e.modalConfirmButton);
await this.userPage.hasElement(e.modalConfirmButton);
await this.userPage.hasElement(e.modalConfirmButton, 'should display the modal confirm button for the attende to join the meeting');
await this.userPage.waitAndClick(e.modalDismissButton);
}
async usernameShowsBelowRoomsName() {
const breakoutUserPage = await this.joinRoom();
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/, 'should have the attende name on the breakout room below a room on the main breakout panel');
}
async showBreakoutRoomTimeRemaining() {
const breakoutUserPage = await this.joinRoom();
await breakoutUserPage.hasElement(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should display the presentation title on the breakout room');
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.waitAndClick(e.breakoutOptionsMenu);
@ -111,24 +111,24 @@ class Join extends Create {
await this.modPage.getLocator(e.inputSetTimeSelector).press('Backspace');
await this.modPage.type(e.inputSetTimeSelector, '2');
await this.modPage.waitAndClick(e.sendButtonDurationTime);
await this.modPage.hasText(e.breakoutRemainingTime, /[11-12]:[0-5][0-9]/);
await this.modPage.hasText(e.breakoutRemainingTime, /[11-12]:[0-5][0-9]/, 'should have the breakout room time remaining counting down on the breakout main panel.');
await breakoutUserPage.hasText(e.timeRemaining, /[11-12]:[0-5][0-9]/);
await breakoutUserPage.hasText(e.timeRemaining, /[11-12]:[0-5][0-9]/, 'should display the remaining time inside the breakout rooom');
}
async endAllBreakoutRooms() {
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.waitAndClick(e.breakoutOptionsMenu);
await this.modPage.waitAndClick(e.endAllBreakouts);
await this.modPage.wasRemoved(e.breakoutRoomsItem);
await this.modPage.wasRemoved(e.breakoutRoomsItem, 'should not have the breakout rooms item displayed anymore');
}
async moveUserToOtherRoom() {
const breakoutUserPage = await this.joinRoom();
await breakoutUserPage.hasElement(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should display the presentation title inside the breakout room');
await this.modPage.waitAndClick(e.breakoutRoomsItem);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/);
await this.modPage.hasText(e.userNameBreakoutRoom, /Attendee/, 'should display the user name below the first breakout room name');
await this.modPage.waitAndClick(e.breakoutOptionsMenu);
@ -136,24 +136,24 @@ class Join extends Create {
await this.modPage.dragDropSelector(e.moveUser, e.breakoutBox2);
await this.modPage.waitAndClick(e.modalConfirmButton);
await this.userPage.waitForSelector(e.modalConfirmButton);
await this.userPage.hasElement(e.modalConfirmButton, 'should display the modal confirm button for the user to join the breakout room');
await breakoutUserPage.page.isClosed();
await this.userPage.waitAndClick(e.modalConfirmButton);
await this.modPage.hasText(e.userNameBreakoutRoom2, /Attendee/, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasText(e.userNameBreakoutRoom2, /Attendee/, 'should display the user name below the first breakout room name', ELEMENT_WAIT_LONGER_TIME);
}
async exportBreakoutNotes() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the chat button to access the public chat');
return this.modPage.wasRemoved(e.sharedNotes, 'should have removed the shared notes.');
}
const breakoutUserPage = await this.joinRoom();
await breakoutUserPage.hasElement(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should display the presentation title inside the breakout room.');
await breakoutUserPage.waitAndClick(e.sharedNotes);
await breakoutUserPage.waitForSelector(e.hideNotesLabel);
await breakoutUserPage.hasElement(e.hideNotesLabel, 'should display the hide notes element when shared notes is opened');
const notesLocator = getNotesLocator(breakoutUserPage);
await notesLocator.type(e.message);
@ -167,10 +167,10 @@ class Join extends Create {
}
await this.modPage.waitAndClick(e.endAllBreakouts);
await this.modPage.hasElement(e.presentationUploadProgressToast);
await this.modPage.hasElement(e.presentationUploadProgressToast, 'should display the presentation upload progress toast');
await this.modPage.waitAndClick(e.actions);
const shareNotesPDF = await this.modPage.getLocatorByIndex(e.actionsItem, 1);
await expect(shareNotesPDF).toHaveText(/Notes/, { timeout: 30000 });
await expect(shareNotesPDF, 'should have the Notes name on the share notes pdf').toHaveText(/Notes/, { timeout: 30000 });
await expect(this.modPage.getLocatorByIndex(e.actionsItem, 2)).toHaveText("Upload/Manage presentations"); //This checks if no other content was exported.
await this.modPage.checkElementCount(e.actionsItem, 8);
await shareNotesPDF.click();
@ -185,17 +185,17 @@ class Join extends Create {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the chat button to access the public chat');
return this.modPage.wasRemoved(e.sharedNotes, 'should have removed the shared notes');
}
const breakoutUserPage = await this.joinRoom();
await breakoutUserPage.hasElement(e.presentationTitle);
await breakoutUserPage.hasElement(e.presentationTitle, 'should have the presentation title displayed on the breakout room');
await breakoutUserPage.waitAndClick(e.sharedNotes);
await breakoutUserPage.waitForSelector(e.hideNotesLabel);
await breakoutUserPage.hasElement(e.hideNotesLabel, 'should display the hide notes element when shared notes is opened');
// draw a line
await breakoutUserPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await breakoutUserPage.hasElement(e.whiteboard, 'should display the whiteboard on breakout room', ELEMENT_WAIT_LONGER_TIME);
await breakoutUserPage.waitAndClick(e.wbShapesButton);
await breakoutUserPage.waitAndClick(e.wbLineShape);
const wbBreakout = await breakoutUserPage.page.$(e.whiteboard);
@ -214,7 +214,7 @@ class Join extends Create {
}
await this.modPage.waitAndClick(e.endAllBreakouts);
await this.modPage.waitForSelector(e.presentationUploadProgressToast, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.presentationUploadProgressToast, 'should display the presentation upload progress toast', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.actions);
const whiteboardPDF = await this.modPage.getLocatorByIndex(e.actionsItem, 1);
await expect(whiteboardPDF).toHaveText(/Whiteboard/, { timeout: 30000 });
@ -243,7 +243,7 @@ class Join extends Create {
const breakoutUserPage = await this.userPage.getLastTargetPage(this.context);
await breakoutUserPage.bringToFront();
await breakoutUserPage.waitForSelector(e.presentationTitle, ELEMENT_WAIT_LONGER_TIME);
await breakoutUserPage.hasElement(e.presentationTitle, 'should display the presentation title on the breakout room', ELEMENT_WAIT_LONGER_TIME);
}
}

View File

@ -15,34 +15,34 @@ class Chat extends MultiUsers {
async sendPublicMessage() {
await openPublicChat(this.modPage);
await this.modPage.checkElementCount(e.chatUserMessageText, 0);
await this.modPage.checkElementCount(e.chatUserMessageText, 0, 'should have none message on the public chat');
await this.modPage.type(e.chatBox, e.message);
await this.userPage.hasElement(e.typingIndicator);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.checkElementCount(e.chatUserMessageText, 1);
await this.userPage.hasElement(e.typingIndicator, 'should display the typing indicator element');
await this.modPage.page.click(e.sendButton);
await this.modPage.checkElementCount(e.chatUserMessageText, 1, 'should have on message on the public chat');
}
async sendPrivateMessage() {
await openPrivateChat(this.modPage);
await this.modPage.waitForSelector(e.hidePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when opening a private chat');
await sleep(500); // prevent a race condition when running on a deployed server
// modPage send message
await this.modPage.type(e.chatBox, e.message1);
await this.modPage.waitAndClick(e.sendButton);
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.userPage.waitAndClickElement(e.chatButton, 1);
await this.userPage.waitForSelector(e.hidePrivateChat);
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when opening a private chat');
// check sent messages
await this.modPage.hasText(e.chatUserMessageText, e.message1);
await this.userPage.hasText(e.chatUserMessageText, e.message1);
await this.modPage.hasText(e.chatUserMessageText, e.message1, 'should display the message sent by the moderator');
await this.userPage.hasText(e.chatUserMessageText, e.message1, 'should display the message sent by the moderator for the attende');
// userPage send message
await this.userPage.type(e.chatBox, e.message2);
await this.modPage.hasElement(e.typingIndicator);
await this.modPage.hasElement(e.typingIndicator, 'should display the typing indicator for the moderator');
await this.userPage.waitAndClick(e.sendButton);
// check sent messages
await this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, e.message2);
await this.userPage.hasText(`${e.chatUserMessageText}>>nth=1`, e.message2);
await this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, e.message2, 'should display the message "Hello User1" for the moderator');
await this.userPage.hasText(`${e.chatUserMessageText}>>nth=1`, e.message2, 'should display the message "Hello User1" for the moderator');
await this.modPage.waitAndClick(e.chatButton);
await this.userPage.waitAndClick(e.chatButton);
@ -55,15 +55,15 @@ class Chat extends MultiUsers {
await this.modPage.type(e.chatBox, e.message);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display a message sent by the moderator');
// 1 message
await this.modPage.checkElementCount(e.chatUserMessageText, userMessageTextCount + 1);
await this.modPage.checkElementCount(e.chatUserMessageText, userMessageTextCount + 1, 'should display one message');
// clear
await this.modPage.waitAndClick(e.chatOptions);
await this.modPage.waitAndClick(e.chatClear);
await this.modPage.hasText(e.chatUserMessageText, 'The public chat history was cleared by a moderator');
await this.modPage.hasText(e.chatUserMessageText, 'The public chat history was cleared by a moderator', 'should display the message where the chat has been cleared');
}
async copyChat() {
@ -73,8 +73,8 @@ class Chat extends MultiUsers {
if(!publicChatOptionsEnabled) {
await this.modPage.waitAndClick(e.chatOptions);
await this.modPage.hasElement(e.chatClear);
return this.modPage.wasRemoved(e.chatCopy);
await this.modPage.hasElement(e.chatClear, 'should display the option to clear the chat');
return this.modPage.wasRemoved(e.chatCopy, 'should not display the option to copy the chat');
}
// sending a message
await this.modPage.type(e.chatBox, e.message);
@ -82,12 +82,12 @@ class Chat extends MultiUsers {
await this.modPage.waitAndClick(e.chatOptions);
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display the message sent by the moderator');
await this.modPage.waitAndClick(e.chatCopy);
// enable access to browser context clipboard
const copiedText = await this.modPage.getCopiedText(this.modPage.context);
const check = copiedText.includes(`${p.fullName}: ${e.message}`);
await expect(check).toBeTruthy();
await expect(check, 'should display on the copied chat the same message that was sent on the public chat').toBeTruthy();
}
async saveChat(testInfo) {
@ -96,12 +96,12 @@ class Chat extends MultiUsers {
await openPublicChat(this.modPage);
if(!publicChatOptionsEnabled) {
await this.modPage.waitAndClick(e.chatOptions);
return this.modPage.wasRemoved(e.chatSave);
return this.modPage.wasRemoved(e.chatSave, 'chat save option should not be displayed');
}
await this.modPage.type(e.chatBox, e.message);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display the message sent by the moderator on the public chat');
await this.modPage.waitAndClick(e.chatOptions);
const chatSaveLocator = this.modPage.getLocator(e.chatSave);
const { content } = await this.modPage.handleDownload(chatSaveLocator, testInfo);
@ -111,7 +111,7 @@ class Chat extends MultiUsers {
this.modPage.username,
e.message,
];
await checkTextContent(content, dataToCheck);
await checkTextContent(content, dataToCheck, 'should display the same message on the saved chat message and the message sent on the public chat');
}
async characterLimit() {
@ -121,12 +121,12 @@ class Chat extends MultiUsers {
const initialMessagesCount = await this.modPage.getSelectorCount(e.chatUserMessageText);
await this.modPage.page.fill(e.chatBox, e.uniqueCharacterMessage.repeat(maxMessageLength));
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display only one message text sent by the user on the public chat');
await this.modPage.checkElementCount(e.chatUserMessageText, initialMessagesCount + 1);
await this.modPage.page.fill(e.chatBox, e.uniqueCharacterMessage.repeat(maxMessageLength));
await this.modPage.type(e.chatBox, '123'); // it should has no effect
await this.modPage.waitForSelector(e.errorTypingIndicator); // warning below input message saying it has exceeded the maximum of characters
await this.modPage.hasElement(e.errorTypingIndicator, 'Should appear the warning message below the chat box');
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.checkElementCount(e.chatUserMessageText, initialMessagesCount + 2);
}
@ -137,7 +137,7 @@ class Chat extends MultiUsers {
const userMessageTextCount = await this.modPage.getSelectorCount(e.chatUserMessageText);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.checkElementCount(e.chatUserMessageText, userMessageTextCount);
await this.modPage.checkElementCount(e.chatUserMessageText, userMessageTextCount, 'should have none messages on the chat');
}
async copyPastePublicMessage() {
@ -162,19 +162,19 @@ class Chat extends MultiUsers {
await openPublicChat(this.modPage);
if(!emojiPickerEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.wasRemoved(e.emojiPickerButton);
await this.modPage.hasElement(e.chatBox, 'should display the chat box element');
return this.modPage.wasRemoved(e.emojiPickerButton, 'should not display the emoji picker button element');
}
const message = this.modPage.getLocator(e.chatUserMessageText);
await expect(message).toHaveCount(0);
await expect(message, 'should not display any messages on the public chat').toHaveCount(0);
no
await this.modPage.waitAndClick(e.emojiPickerButton);
await this.modPage.waitAndClick(e.emojiSent);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitForSelector(e.chatUserMessageText);
await expect(message).toHaveCount(1);
await expect(message, 'should display only one message that contains an emoji on the public chat').toHaveCount(1);
}
async emojiCopyChat(context) {
@ -182,8 +182,8 @@ class Chat extends MultiUsers {
await openPublicChat(this);
if(!emojiPickerEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.wasRemoved(e.emojiPickerButton);
await this.modPage.hasElement(e.chatBox, 'should display the chat box element on the public chat');
return this.modPage.wasRemoved(e.emojiPickerButton, 'should not display the emoji picker button on the public chat');
}
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
@ -191,34 +191,34 @@ class Chat extends MultiUsers {
await this.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.hasElement(e.chatUserMessageText, 'should have one message that contains an emoji on the public chat');
await this.waitAndClick(e.chatCopy);
const copiedText = await this.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.frequentlyUsedEmoji}`);
await expect(check).toBeTruthy();
await expect(check, 'should the copied text be the same as the message on the chat').toBeTruthy();
}
async closePrivateChat() {
await openPrivateChat(this.modPage);
await this.modPage.waitUntilHaveCountSelector(e.chatButton, 2);
const privateChatLocator = this.modPage.getLocatorByIndex(e.chatButton, -1);
expect(privateChatLocator).toContainText(this.userPage.username);
expect(privateChatLocator, 'should the private chat contain the user name').toContainText(this.userPage.username);
const chatMessageCount = await this.modPage.getSelectorCount(e.chatUserMessageText);
await this.modPage.hasElement(e.hidePrivateChat);
await this.modPage.hasElement(e.closePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'the private chat should display the hide private chat element when opened');
await this.modPage.hasElement(e.closePrivateChat, 'the private chat should display the close private chat element when opened');
await this.modPage.checkElementCount(e.chatUserMessageText, chatMessageCount);
await this.modPage.type(e.chatBox, e.message1);
await this.modPage.waitAndClick(e.sendButton);
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.modPage.waitAndClick(e.closePrivateChat);
await this.modPage.wasRemoved(e.hidePrivateChat);
await this.modPage.wasRemoved(e.hidePrivateChat, 'should the hide private chat element not be displayed');
await this.modPage.waitUntilHaveCountSelector(e.chatButton, 1, ELEMENT_WAIT_LONGER_TIME);
const userChatCount = await this.userPage.getSelectorCount(e.chatButton);
await this.modPage.waitAndClick(e.chatButton);
expect(userChatCount).toBe(2);
expect(userChatCount, '').toBe(2);
}
async emojiSaveChat(testInfo) {
@ -226,13 +226,13 @@ class Chat extends MultiUsers {
await openPublicChat(this.modPage);
if(!emojiPickerEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.wasRemoved(e.emojiPickerButton);
await this.modPage.hasElement(e.chatBox, 'should display the public chat box');
return this.modPage.wasRemoved(e.emojiPickerButton, 'should not display the emoji picker button');
}
await this.modPage.waitAndClick(e.emojiPickerButton);
await this.modPage.waitAndClick(e.emojiSent);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display a message on the public chat with an emoji');
await this.modPage.waitAndClick(e.chatOptions);
const chatSaveLocator = this.modPage.getLocator(e.chatSave);
const { content } = await this.modPage.handleDownload(chatSaveLocator, testInfo);
@ -242,36 +242,36 @@ class Chat extends MultiUsers {
this.modPage.username,
e.frequentlyUsedEmoji,
];
await checkTextContent(content, dataToCheck);
await checkTextContent(content, dataToCheck, 'should the save chat message with an emoji be the same as message sent on the public chat');
}
async emojiSendPrivateChat() {
const { emojiPickerEnabled } = getSettings();
await openPrivateChat(this.modPage);
await this.modPage.waitForSelector(e.hidePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when a private chat is open');
await sleep(500); // prevent a race condition when running on a deployed server
// modPage send message
if(!emojiPickerEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.wasRemoved(e.emojiPickerButton);
await this.modPage.hasElement(e.chatBox, 'should display the public chat box');
return this.modPage.wasRemoved(e.emojiPickerButton, 'should not display the emoji picker button on the public chat');
}
await this.modPage.waitAndClick(e.emojiPickerButton);
await this.modPage.waitAndClick(e.emojiSent);
await this.modPage.waitAndClick(e.sendButton);
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.userPage.waitAndClickElement(e.chatButton, 1);
await this.userPage.waitForSelector(e.hidePrivateChat);
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when the attende opens the private chat');
// check sent messages
await this.modPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji);
await this.userPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji);
await this.modPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji, 'should display the emoji sent by the moderator on the private chat');
await this.userPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji, 'should display for the user the emoji sent by the moderator on the private chat');
// userPage send message
await this.userPage.waitAndClick(e.emojiPickerButton);
await this.userPage.waitAndClick(e.emojiSent);
await this.userPage.waitAndClick(e.sendButton);
// check sent messages
await this.modPage.hasText(e.privateChat, e.frequentlyUsedEmoji);
await this.userPage.hasText(e.privateChat, e.frequentlyUsedEmoji);
await this.modPage.hasText(e.privateChat, e.frequentlyUsedEmoji, 'should display the emoji sent by the attendee on the private chat');
await this.userPage.hasText(e.privateChat, e.frequentlyUsedEmoji, 'should display the emoji on the private chat for the user');
await this.modPage.waitAndClick(e.chatButton);
}
@ -280,45 +280,45 @@ class Chat extends MultiUsers {
const { autoConvertEmojiEnabled } = getSettings();
try {
await this.modPage.hasElement(e.hidePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element for the moderator when private chat is open');
await this.modPage.waitAndClick(e.chatButton);
} catch {
await this.modPage.hasElement(e.hidePublicChat);
await this.modPage.hasElement(e.hidePublicChat, 'should display the hide public chat element for the moderator when public chat is open');
}
await this.modPage.waitAndClick(e.chatOptions);
await this.modPage.waitAndClick(e.chatClear);
await this.modPage.checkElementCount(e.chatUserMessageText, 1);
await this.modPage.checkElementCount(e.chatUserMessageText, 1, 'should display only one message on the public chat');
await this.modPage.type(e.chatBox, e.autoConvertEmojiMessage);
await this.modPage.waitAndClick(e.sendButton);
if(!autoConvertEmojiEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ":)");
await this.modPage.hasElement(e.chatBox, 'should display a chat box on the public chat');
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ":)", 'should not display the emoji converted');
}
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.checkElementCount(e.chatUserMessageText, 2);
await this.modPage.hasElement(e.chatUserMessageText, 'should display the user messages sent on the chat');
await this.modPage.checkElementCount(e.chatUserMessageText, 2, 'should display two messages on the public chat');
}
async autoConvertEmojiCopyChat(context) {
const { autoConvertEmojiEnabled } = getSettings();
await openPublicChat(this);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await openPublicChat(this.modPage);
await this.modPage.type(e.chatBox, e.autoConvertEmojiMessage);
await this.modPage.waitAndClick(e.sendButton);
if(!autoConvertEmojiEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ":)");
await this.modPage.hasElement(e.chatBox, 'should display chat box on the public chat for the moderator');
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ":)", 'should display a message on the public chat with an emoji no converted');
}
await this.waitAndClick(e.chatOptions);
await this.modPage.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatCopy);
await this.modPage.hasElement(e.chatUserMessageText, 'should display a message sent by user on the public chat');
await this.modPage.waitAndClick(e.chatCopy);
const copiedText = await this.getCopiedText(context);
const copiedText = await this.modPage.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.convertedEmojiMessage}`);
await expect(check).toBeTruthy();
}
@ -330,10 +330,10 @@ class Chat extends MultiUsers {
await this.modPage.type(e.chatBox, e.autoConvertEmojiMessage);
await this.modPage.waitAndClick(e.sendButton);
if(!autoConvertEmojiEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ':)');
await this.modPage.hasElement(e.chatBox, 'should display the chat box on the public chat');
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=1`, ':)', 'should display a message containing the emoji not converted');
}
await this.modPage.waitForSelector(e.chatUserMessageText);
await this.modPage.hasElement(e.chatUserMessageText, 'should display a message on the public chat');
await this.modPage.waitAndClick(e.chatOptions);
const chatSaveLocator = this.modPage.getLocator(e.chatSave);
const { content } = await this.modPage.handleDownload(chatSaveLocator, testInfo);
@ -343,47 +343,47 @@ class Chat extends MultiUsers {
this.modPage.username,
e.convertedEmojiMessage,
];
await checkTextContent(content, dataToCheck);
await checkTextContent(content, dataToCheck, 'should the saved emoji from the chat be the same as the emoji sent on the chat');
}
async autoConvertEmojiSendPrivateChat() {
const { autoConvertEmojiEnabled, emojiPickerEnabled } = getSettings();
await openPrivateChat(this.modPage);
await this.modPage.waitForSelector(e.hidePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when the moderator has the private chat opened');
await sleep(500); // prevent a race condition when running on a deployed server
// modPage send message
await this.modPage.type(e.chatBox, e.autoConvertEmojiMessage);
await this.modPage.waitAndClick(e.sendButton);
if(!autoConvertEmojiEnabled && !emojiPickerEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=0`, ":)");
await this.modPage.hasElement(e.chatBox, 'should display the chat box on the private chat');
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=0`, ":)", 'should display the message that the emoji is not converted');
} else if (!autoConvertEmojiEnabled) {
await this.modPage.hasElement(e.chatBox);
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=2`, ":)");
await this.modPage.hasElement(e.chatBox, 'should the chat box be displayed on the private chat');
return this.modPage.hasText(`${e.chatUserMessageText}>>nth=2`, ":)", 'should display the emoji not converted on the private chat');
}
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.userPage.waitAndClickElement(e.chatButton, 1);
await this.userPage.waitForSelector(e.hidePrivateChat);
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element for the attende when the private chat is opened');
// check sent messages
await checkLastMessageSent(this.modPage, e.convertedEmojiMessage)
await checkLastMessageSent(this.modPage, e.convertedEmojiMessage);
await checkLastMessageSent(this.userPage, e.convertedEmojiMessage);
// userPage send message
await this.userPage.type(e.chatBox, e.autoConvertEmojiMessage);
await this.userPage.waitAndClick(e.sendButton);
// check sent messages
const lastMessageLocator = await this.modPage.getLocator(e.chatUserMessageText).last();
await expect(lastMessageLocator).toHaveText(e.convertedEmojiMessage);
const lastMessageLocatorUser = await this.userPage.getLocator(e.chatUserMessageText).last()
await expect(lastMessageLocatorUser).toHaveText(e.convertedEmojiMessage);
await expect(lastMessageLocator, 'should the last message sent on private chat to be the auto converted emoji').toHaveText(e.convertedEmojiMessage);
const lastMessageLocatorUser = await this.userPage.getLocator(e.chatUserMessageText).last();
await expect(lastMessageLocatorUser, 'should the last message sent on private chat to be the auto converted emoji').toHaveText(e.convertedEmojiMessage);
}
async chatDisabledUserLeaves() {
await openPrivateChat(this.modPage);
await this.modPage.waitForSelector(e.sendButton);
await this.modPage.hasElement(e.sendButton, 'should display the send button on the private chat');
await this.userPage.logoutFromMeeting();
await this.modPage.hasElement(e.partnerDisconnectedMessage, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.sendButton);
await this.modPage.hasElement(e.partnerDisconnectedMessage, 'should the attende be disconnected', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.sendButton, 'should the send button be removed because the attende left the meeting');
}
}

View File

@ -6,17 +6,17 @@ async function openPublicChat(testPage) {
const { chatEnabled } = getSettings();
if(!chatEnabled) {
return testPage.wasRemoved(e.chatButton);
return testPage.wasRemoved(e.chatButton, 'public chat should not be desplayed');
}
await testPage.waitForSelector(e.chatBox);
await testPage.waitForSelector(e.chatMessages);
await testPage.hasElement(e.chatBox, 'should display the chat box for messaging');
await testPage.hasElement(e.chatMessages, 'should display the chat messages');
try {
await testPage.waitForSelector(e.chatWelcomeMessageText);
await testPage.hasElement(e.chatWelcomeMessageText, 'should display the chat welcome message');
} catch {
await testPage.waitAndClick(e.chatMessages);
await testPage.down('Home');
await testPage.waitForSelector(e.chatWelcomeMessageText);
await testPage.hasElement(e.chatWelcomeMessageText, 'should display the chat welcome message');
await testPage.down('End');
}
}
@ -26,14 +26,14 @@ async function openPrivateChat(testPage) {
await testPage.waitAndClick(e.userListItem);
if(!chatEnabled) {
return await testPage.wasRemoved(e.startPrivateChat);
return await testPage.wasRemoved(e.startPrivateChat, 'should not display the private chat');
}
await testPage.waitAndClick(e.startPrivateChat);
}
async function checkLastMessageSent(testPage, expectedMessage) {
const lastMessageSent = await testPage.getLocator(e.chatUserMessageText).last();
await expect(lastMessageSent).toHaveText(expectedMessage);
await expect(lastMessageSent, 'should display the last message sent on the chat').toHaveText(expectedMessage);
}
exports.openPublicChat = openPublicChat;

View File

@ -84,7 +84,7 @@ exports.inputSetTimeSelector = 'input[id="inputSetTimeSelector"]';
exports.sendButtonDurationTime = 'button[data-test="sendButtonDurationTime"]';
exports.breakoutRemainingTime = 'span[data-test="breakoutRemainingTime"]';
exports.roomNameInput = 'input[data-test="roomName-1"]';
exports.roomName1Test = 'span[data-test="Room 1Test"]';
exports.roomName1Test = 'span[data-test="TestRoom 1"]';
exports.userNameBreakoutRoom = 'div[data-test="userNameBreakoutRoom-Room 1"]';
exports.userNameBreakoutRoom2 = 'div[data-test="userNameBreakoutRoom-Room 2"]';
exports.userNameBreakoutRoom7 = 'div[data-test="userNameBreakoutRoom-Room 7"]';

View File

@ -42,9 +42,9 @@ class Page {
const response = await this.page.goto(joinUrl);
await expect(response.ok()).toBeTruthy();
const hasErrorLabel = await this.checkElement(e.errorMessageLabel);
await expect(hasErrorLabel, 'Getting error when joining. Check if the BBB_URL and BBB_SECRET are set correctly').toBeFalsy();
await expect(hasErrorLabel, 'should pass the authentication and the layout element should be displayed').toBeFalsy();
if (shouldCheckAllInitialSteps != undefined ? shouldCheckAllInitialSteps : true) {
await this.waitForSelector('div#layout', ELEMENT_WAIT_LONGER_TIME);
await this.waitForSelector('div#layout', 25000);
this.settings = await generateSettingsData(this.page);
const { autoJoinAudioModal } = this.settings;
if (isRecording && !isModerator) await this.closeRecordingModal();
@ -89,7 +89,7 @@ class Page {
async leaveAudio() {
await this.waitAndClick(e.audioDropdownMenu);
await this.waitAndClick(e.leaveAudio);
await this.waitForSelector(e.joinAudio);
await this.hasElement(e.joinAudio, 'should display the join audio button');
}
async logoutFromMeeting() {
@ -110,12 +110,12 @@ class Page {
test.fail(!webcamSharingEnabled, 'Webcam sharing is disabled');
if(!webcamSharingEnabled) {
return this.wasRemoved(e.joinVideo)
return this.wasRemoved(e.joinVideo, 'should not display the join video button')
}
await this.waitAndClick(e.joinVideo);
if (shouldConfirmSharing) {
await this.bringToFront();
await this.waitForSelector(e.videoPreview, videoPreviewTimeout);
await this.hasElement(e.videoPreview, 'should display the video preview when sharing webcam ', videoPreviewTimeout);
await this.waitAndClick(e.startSharingWebcam);
}
await this.waitForSelector(e.webcamContainer, VIDEO_LOADING_WAIT_TIME);
@ -142,7 +142,7 @@ class Page {
}
async closeAudioModal() {
await this.waitForSelector(e.audioModal, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.hasElement(e.audioModal, 'should display the audio modal', ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.waitAndClick(e.closeModal);
}
@ -174,7 +174,7 @@ class Page {
async type(selector, text) {
const handle = this.getLocator(selector);
await handle.focus();
//await handle.focus();
await handle.type(text, { timeout: ELEMENT_WAIT_TIME });
}
@ -199,9 +199,9 @@ class Page {
return this.page.evaluate(checkElement, [selector, index]);
}
async wasRemoved(selector, timeout = ELEMENT_WAIT_TIME) {
async wasRemoved(selector, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(selector);
await expect(locator).toBeHidden({ timeout });
await expect(locator, description).toBeHidden({ timeout });
}
async wasNthElementRemoved(selector, count, timeout = ELEMENT_WAIT_TIME) {
@ -209,29 +209,29 @@ class Page {
await expect(locator).toBeHidden({ timeout });
}
async hasElement(selector, timeout = ELEMENT_WAIT_TIME) {
async hasElement(selector, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(selector);
await expect(locator).toBeVisible({ timeout });
await expect(locator, description).toBeVisible({ timeout });
}
async hasNElements(selector, count, timeout = ELEMENT_WAIT_TIME) {
async hasNElements(selector, count, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(':nth-match(' + selector + ',' + count + ')');
await expect(locator).toBeVisible({ timeout });
await expect(locator, description).toBeVisible({ timeout });
}
async hasElementDisabled(selector, timeout = ELEMENT_WAIT_TIME) {
async hasElementDisabled(selector, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(selector);
await expect(locator).toBeDisabled({ timeout });
await expect(locator, description).toBeDisabled({ timeout });
}
async hasElementEnabled(selector, timeout = ELEMENT_WAIT_TIME) {
async hasElementEnabled(selector, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(`${selector}:not([disabled])`);
await expect(locator).toBeEnabled({ timeout });
await expect(locator, description).toBeEnabled({ timeout });
}
async hasText(selector, text, timeout = ELEMENT_WAIT_TIME) {
async hasText(selector, text, description, timeout = ELEMENT_WAIT_TIME) {
const locator = this.getLocator(selector).first();
await expect(locator).toContainText(text, { timeout });
await expect(locator, description).toContainText(text, { timeout });
}
async haveTitle(title) {
@ -266,9 +266,9 @@ class Page {
await this.page.mouse.up();
}
async checkElementCount(selector, count) {
async checkElementCount(selector, count, description) {
const locator = await this.page.locator(selector);
await expect(locator).toHaveCount(count, { timeout: ELEMENT_WAIT_LONGER_TIME });
await expect(locator, description).toHaveCount(count, { timeout: ELEMENT_WAIT_LONGER_TIME });
}
async hasValue(selector, value) {

View File

@ -25,11 +25,11 @@ function getElementLength(element) {
}
// Text
async function checkTextContent(baseContent, checkData) {
async function checkTextContent(baseContent, checkData, description) {
if (typeof checkData === 'string') checkData = new Array(checkData);
const check = checkData.every(word => baseContent.includes(word));
await expect(check).toBeTruthy();
await expect(check, description).toBeTruthy();
}
function constructClipObj(wbBox) {

View File

@ -11,7 +11,7 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);
await checkScreenshots(this, e.webcamContainer, 'focus-on-presentation');
await checkScreenshots(this, 'should be the layout focus on presentation', e.webcamContainer, 'focus-on-presentation');
}
async gridLayout() {
@ -22,7 +22,7 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);
await checkScreenshots(this, e.webcamContainer, 'grid-layout');
await checkScreenshots(this, 'should be the grid layout', e.webcamContainer, 'grid-layout');
}
async smartLayout() {
@ -33,12 +33,12 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);
await checkScreenshots(this, e.webcamContainer, 'smart-layout', 1);
await checkScreenshots(this, 'should the cameras be above the presentation', e.webcamContainer, 'smart-layout', 1);
await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.wasRemoved(e.chatButton);
await this.modPage.wasRemoved(e.chatButton, '');
await checkScreenshots(this, e.webcamContainer, 'smart-layout', 2);
await checkScreenshots(this, 'should the cameras be on the side of presentation', e.webcamContainer, 'smart-layout', 2);
await reopenChatSidebar(this.modPage);
}
@ -50,7 +50,7 @@ class Layouts extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.modPage.wasRemoved(e.toastContainer);
await checkScreenshots(this, 'video', 'custom-layout', 1);
await checkScreenshots(this, 'should be on custom layout', 'video', 'custom-layout', 1);
// checking the default location being reset when dropping into a non-available location
await this.modPage.getLocator(e.webcamContainer).first().hover({ timeout: 5000 });
@ -66,16 +66,16 @@ class Layouts extends MultiUsers {
await this.modPage.page.mouse.up();
await this.modPage.dragAndDropWebcams(e.dropAreaSidebarBottom);
await checkScreenshots(this, 'video', 'custom-layout', 2);
await checkScreenshots(this, 'should be on custom layout', 'video', 'custom-layout', 2);
await this.modPage.dragAndDropWebcams(e.dropAreaSidebarBottom);
await checkScreenshots(this, 'video', 'custom-layout', 3);
await checkScreenshots(this, 'should be on custom layout', 'video', 'custom-layout', 3);
await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.wasRemoved(e.chatButton);
await this.modPage.wasRemoved(e.sendButton);
await this.modPage.wasRemoved(e.chatButton, 'should not be displayed the chat button');
await this.modPage.wasRemoved(e.sendButton, 'should not be displayed the send button');
await checkScreenshots(this, 'video', 'custom-layout', 4);
await checkScreenshots(this, 'should be on custom layout', 'video', 'custom-layout', 4);
await reopenChatSidebar(this.modPage);
}
@ -89,22 +89,22 @@ class Layouts extends MultiUsers {
// Presenter minimizes presentation
await this.modPage.waitAndClick(e.minimizePresentation);
await this.modPage.wasRemoved(e.presentationContainer);
await this.modPage.hasElement(e.restorePresentation);
await this.userPage.wasRemoved(e.presentationContainer);
await this.userPage.hasElement(e.restorePresentation);
await this.modPage.wasRemoved(e.presentationContainer, 'should the presentation be minimized for the moderator');
await this.modPage.hasElement(e.restorePresentation, 'should have the presentation minimized and the restore presentation button should appear for the moderator');
await this.userPage.wasRemoved(e.presentationContainer, 'should the presentation be minimized for the attendee');
await this.userPage.hasElement(e.restorePresentation, 'should the presentation be minimized and the restore presentation button should appear for the attendee');
// Only the user restores presentation
await this.userPage.waitAndClick(e.restorePresentation);
await this.userPage.hasElement(e.presentationContainer);
await this.userPage.hasElement(e.minimizePresentation);
await this.modPage.wasRemoved(e.presentationContainer);
await this.modPage.hasElement(e.restorePresentation);
await this.userPage.hasElement(e.presentationContainer, 'should display the restored presentation for the attendee');
await this.userPage.hasElement(e.minimizePresentation, 'should appear the minimize presentation button for the attendee');
await this.modPage.wasRemoved(e.presentationContainer, 'should the presentation be minimized for the moderator');
await this.modPage.hasElement(e.restorePresentation, 'should be displayed the restore presentation button for the moderator');
await this.modPage.waitAndClick(e.restorePresentation);
await this.modPage.dragAndDropWebcams(e.dropAreaSidebarBottom);
await checkScreenshots(this, 'video', 'update-everyone');
await checkScreenshots(this, 'layout should be updated for everyone', 'video', 'update-everyone');
}
}

View File

@ -11,14 +11,14 @@ async function reopenChatSidebar(page) {
}
}
async function checkScreenshots(layoutTest, maskedSelectors, screenshotName, screenshotNumber) {
async function checkScreenshots(layoutTest, description, maskedSelectors, screenshotName, screenshotNumber) {
const modPageWebcamsLocator = layoutTest.modPage.getLocator(maskedSelectors);
await expect(layoutTest.modPage.page).toHaveScreenshot(`moderator-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
await expect(layoutTest.modPage.page, description).toHaveScreenshot(`moderator-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [modPageWebcamsLocator],
});
const userWebcamsLocator = layoutTest.userPage.getLocator(maskedSelectors);
await expect(layoutTest.userPage.page).toHaveScreenshot(`user-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
await expect(layoutTest.userPage.page, description).toHaveScreenshot(`user-${screenshotName}${screenshotNumber ? '-' + screenshotNumber : ''}.png`, {
mask: [userWebcamsLocator],
});
}

View File

@ -17,8 +17,8 @@ class ChatNotifications extends MultiUsers {
await sleep(1000);
await util.publicChatMessageToast(this.modPage, this.userPage);
await this.modPage.waitAndClick(e.chatTitle);
await this.modPage.waitForSelector(e.smallToastMsg);
await this.modPage.waitForSelector(e.hasUnreadMessages);
await this.modPage.hasElement(e.smallToastMsg, 'should appear the new toast message notification');
await this.modPage.hasElement(e.hasUnreadMessages, 'should appear the unread messages notification on the public chat button');
await util.checkNotificationText(this.modPage, e.publicChatToast);
}
@ -29,8 +29,8 @@ class ChatNotifications extends MultiUsers {
await util.waitAndClearNotification(this.modPage);
await sleep(2000);
await util.privateChatMessageToast(this.userPage);
await this.modPage.waitForSelector(e.smallToastMsg);
await this.modPage.waitForSelector(e.hasUnreadMessages);
await this.modPage.hasElement(e.smallToastMsg, 'should the small toast message with the new text sent on the private chat');
await this.modPage.hasElement(e.hasUnreadMessages, 'should the notifcation on the public chat button appear with a number of messages sent and not read');
await util.checkNotificationText(this.modPage, e.privateChatToast);
}
}

View File

@ -60,7 +60,7 @@ class Notifications extends MultiUsers {
await sleep(1000);
await this.modPage.waitAndClick(e.reactionsButton);
await this.modPage.waitAndClick(e.lowerHandBtn);
await this.modPage.wasRemoved(e.raiseHandRejection);
await this.modPage.wasRemoved(e.raiseHandRejection, 'should the raise hand be rejected');
await util.checkNotificationText(this.modPage, e.raisingHandToast);
await this.modPage.hasText(`${e.smallToastMsg}>>nth=0`, e.raisingHandToast);
await this.modPage.hasText(`${e.smallToastMsg}>>nth=1`, e.loweringHandToast);

View File

@ -16,7 +16,7 @@ class RecordingNotifications extends Page {
// when you don't join audio at all, there's notification about no active mic
await waitAndClearDefaultPresentationNotification(this);
await this.waitAndClick(e.recordingIndicator, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.waitForSelector(e.smallToastMsg);
await this.hasElement(e.smallToastMsg, 'should appear a toast small message with the new message sent on the chat');
await util.checkNotificationText(this, e.noActiveMicrophoneToast);
}
@ -27,7 +27,7 @@ class RecordingNotifications extends Page {
await this.waitAndClick(e.listenOnlyButton, ELEMENT_WAIT_EXTRA_LONG_TIME);
await waitAndClearNotification(this);
await this.waitAndClick(e.recordingIndicator);
await this.waitForSelector(e.smallToastMsg);
await this.hasElement(e.smallToastMsg, 'should the small toast message be show');
await util.checkNotificationText(this, e.noActiveMicrophoneToast);
}
@ -35,17 +35,17 @@ class RecordingNotifications extends Page {
// when you join audio with mic, there's no notification about no active mic
await waitAndClearDefaultPresentationNotification(this);
await this.waitAndClick(e.joinAudio, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.waitForSelector(e.audioModal, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.hasElement(e.audioModal, 'should the audio modal be displayed', ELEMENT_WAIT_EXTRA_LONG_TIME);
await connectMicrophone(this);
await waitAndClearNotification(this);
await this.waitAndClick(e.recordingIndicator);
await this.wasRemoved(e.smallToastMsg, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.wasRemoved(e.smallToastMsg, 'should the small toast message disappear', ELEMENT_WAIT_EXTRA_LONG_TIME);
}
async modalStartRecording() {
await this.waitAndClick(e.recordingIndicator, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.waitForSelector(e.noButton);
await this.waitForSelector(e.yesButton);
await this.hasElement(e.noButton, 'should the button No appear');
await this.hasElement(e.yesButton, 'should the button Yes appear');
}
}

View File

@ -18,7 +18,7 @@ async function saveSettings(page) {
}
async function checkNotificationText(test, text) {
await test.hasText(e.smallToastMsg, text);
await test.hasText(e.smallToastMsg, text, 'should appear the text on the toast message notification');
}
async function checkNotificationIcon(test, icon) {
@ -50,15 +50,15 @@ async function privateChatMessageToast(page2) {
async function waitAndClearNotification(testPage) {
await testPage.waitAndClick(e.smallToastMsg, ELEMENT_WAIT_LONGER_TIME);
await testPage.wasRemoved(e.smallToastMsg);
await testPage.wasRemoved(e.smallToastMsg, 'should the new small toast message disappear');
}
async function waitAndClearDefaultPresentationNotification(testPage) {
await testPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await testPage.hasElement(e.whiteboard, 'should the whiteboard appear on the meeting', ELEMENT_WAIT_LONGER_TIME);
const hasCurrentPresentationToast = await testPage.checkElement(e.currentPresentationToast);
if (hasCurrentPresentationToast) {
await testPage.waitAndClick(e.currentPresentationToast, ELEMENT_WAIT_LONGER_TIME);
await testPage.wasRemoved(e.currentPresentationToast);
await testPage.wasRemoved(e.currentPresentationToast, 'should disappear the current presentation toast');
}
}

View File

@ -12,16 +12,16 @@ class Options extends MultiUsers {
async openedAboutModal() {
await openAboutModal(this.modPage);
await this.modPage.hasElement(e.closeModal);
await this.modPage.hasElement(e.closeModal, 'should display the close modal button for the about modal');
await this.modPage.waitAndClick(e.closeModal);
}
async openHelp() {
await this.modPage.waitAndClick(e.optionsButton);
const newPage = await this.modPage.handleNewTab(e.helpButton, this.modPage.context);
await expect(newPage).toHaveTitle(/Tutorials/);
await expect(newPage, 'should the help page to display the title Tutorials').toHaveTitle(/Tutorials/);
await newPage.close();
await this.modPage.hasElement(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should the whiteboard be open on the main meeting');
}
async localesTest() {
@ -52,13 +52,13 @@ class Options extends MultiUsers {
await this.modPage.waitAndClick(e.modalConfirmButton);
for (const selector in currentValuesBySelector) {
await this.modPage.hasText(selector, currentValuesBySelector[selector]);
await this.modPage.hasText(selector, currentValuesBySelector[selector], 'should the elements to be translated to the specific language');
}
}
}
async darkMode() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should the whiteboard be display');
await this.modPage.waitAndClick(e.closePopup);
await openSettings(this.modPage);
@ -72,7 +72,7 @@ class Options extends MultiUsers {
};
await this.modPage.closeAllToastNotifications();
await expect(modPageLocator).toHaveScreenshot('moderator-page-dark-mode.png', screenshotOptions);
await expect(modPageLocator, 'should the meeting be in dark mode').toHaveScreenshot('moderator-page-dark-mode.png', screenshotOptions);
await openSettings(this.modPage);
await this.modPage.waitAndClickElement(e.darkModeToggleBtn);
@ -83,7 +83,7 @@ class Options extends MultiUsers {
}
async fontSizeTest() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should the whiteboard be display');
await this.modPage.waitAndClick(e.closePopup);
// Increasing font size
await openSettings(this.modPage);
@ -99,7 +99,7 @@ class Options extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await expect(modPageLocator).toHaveScreenshot('moderator-page-font-size.png', screenshotOptions);
await expect(modPageLocator, 'should the meeting display the font size increased').toHaveScreenshot('moderator-page-font-size.png', screenshotOptions);
}
}

View File

@ -13,63 +13,63 @@ class CreateParameters extends MultiUsers {
}
async recordMeeting() {
await this.modPage.hasElement(e.recordingIndicator);
await this.modPage.hasElement(e.recordingIndicator, 'should the recording indicator to be displayed');
}
async bannerText() {
await this.modPage.waitForSelector(e.actions);
await this.modPage.hasElement(e.notificationBannerBar);
await this.modPage.hasElement(e.actions, 'should the actions button be displayed');
await this.modPage.hasElement(e.notificationBannerBar, 'should display the banner text on the top of the meeting');
}
async bannerColor(colorToRGB) {
await this.modPage.waitForSelector(e.notificationBannerBar);
await this.modPage.hasElement(e.notificationBannerBar, 'should display the banner bar');
const notificationLocator = this.modPage.getLocator(e.notificationBannerBar);
const notificationBarColor = await notificationLocator.evaluate((elem) => {
return getComputedStyle(elem).backgroundColor;
}, e.notificationBannerBar);
await expect(notificationBarColor).toBe(colorToRGB);
await expect(notificationBarColor, 'should display the banner bar with the color changed').toBe(colorToRGB);
}
async maxParticipants(context) {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage2.hasElement(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the first moderator');
await this.modPage2.hasElement(e.whiteboard, 'should display the whiteboard for the second moderator');
await this.initUserPage(false, context);
await this.userPage.hasElement('p[class="error-message"]')
await this.userPage.hasElement('p[class="error-message"]', 'should display the error message for the attendee, the number of max participants should not be passed')
}
async duration(context) {
await this.modPage.hasElement(e.whiteboard);
await this.modPage.hasText(e.timeRemaining, /[1-2]:[0-5][0-9]/);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.modPage.hasText(e.timeRemaining, /[1-2]:[0-5][0-9]/, 'should display the time remaining of the meeting decreasing');
}
async moderatorOnlyMessage(context) {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.checkElementCount(e.chatWelcomeMessageText, 2);
await this.modPage.hasText(`${e.chatWelcomeMessageText}>>nth=1`, 'Test');
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.modPage.checkElementCount(e.chatWelcomeMessageText, 2, 'should display two welcome messages');
await this.modPage.hasText(`${e.chatWelcomeMessageText}>>nth=1`, 'Test', 'should display the second welcome message with the word Test');
await this.initUserPage(true, context);
await this.userPage.checkElementCount(e.chatWelcomeMessageText, 1);
await this.userPage.checkElementCount(e.chatWelcomeMessageText, 1, 'should display one welcome message for the attendee');
}
async webcamsOnlyForModerator(context) {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.userPage2.waitAndClick(e.joinVideo);
await this.userPage2.waitAndClick(e.startSharingWebcam);
await this.userPage2.hasElement(e.webcamContainer);
await this.userPage2.hasElement(e.webcamContainer, 'should display the attende 2 camera');
await this.modPage.checkElementCount(e.webcamContainer, 1);
await this.userPage2.checkElementCount(e.webcamContainer, 1);
await this.modPage.checkElementCount(e.webcamContainer, 1, 'should display one camera from the attende 2 for the moderator');
await this.userPage2.checkElementCount(e.webcamContainer, 1, 'should display one camera from the attendee 2 ');
await this.initUserPage(true, context);
await this.userPage.checkElementCount(e.webcamContainer, 0);
await this.userPage.checkElementCount(e.webcamContainer, 0, 'should not display any camera for the attendee 1');
}
async muteOnStart() {
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitAndClick(e.microphoneButton);
await this.modPage.waitAndClick(e.joinEchoTestButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.hasElement(e.unmuteMicButton, 'should display the unmute microphone button for the moderator');
}
async allowModsToUnmuteUsers(context) {
@ -77,40 +77,40 @@ class CreateParameters extends MultiUsers {
await this.userPage.waitAndClick(e.microphoneButton);
await this.userPage.waitAndClick(e.joinEchoTestButton);
await this.userPage.waitAndClick(e.muteMicButton);
await this.userPage.hasElement(e.unmuteMicButton);
await this.userPage.hasElement(e.unmuteMicButton, 'should display the unmute microphone button for the attendee');
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.unmuteUser);
await this.userPage.hasElement(e.muteMicButton);
await this.userPage.hasElement(e.muteMicButton, 'should display the mute microphone button for the attendee');
}
async lockSettingsDisableCam() {
await this.modPage.waitForSelector(e.whiteboard);
await this.userPage.hasElementDisabled(e.joinVideo);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.userPage.hasElementDisabled(e.joinVideo, 'should display the join video button disabled');
}
async lockSettingsDisableMic() {
await this.modPage.waitForSelector(e.whiteboard);
await this.userPage.hasElement(e.leaveListenOnly, 10000);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.userPage.hasElement(e.leaveListenOnly, 'should display the leave listen only', ELEMENT_WAIT_LONGER_TIME);
}
async lockSettingsDisablePublicChat() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard);
await this.userPage.hasText(e.errorTypingIndicator, /locked/);
}
async lockSettingsHideUserList() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.checkElementCount(e.userListItem, 2);
await this.userPage.checkElementCount(e.userListItem, 1);
await this.userPage2.checkElementCount(e.userListItem, 1);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.modPage.checkElementCount(e.userListItem, 2, 'should display the two attendess for the moderator');
await this.userPage.checkElementCount(e.userListItem, 1, 'should display one user(the moderator) for the first attendee');
await this.userPage2.checkElementCount(e.userListItem, 1, 'should display one user(the moderator) for the second attendee');
}
async allowModsToEjectCameras() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.userPage.waitAndClick(e.joinVideo);
await this.userPage.waitAndClick(e.startSharingWebcam);
await this.userPage.hasElement(e.webcamContainer);
await this.userPage.hasElement(e.webcamContainer, 'should display the webcam container for the attendee');
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.ejectCamera);
}

View File

@ -12,32 +12,32 @@ class CustomParameters extends MultiUsers {
}
async showPublicChatOnLogin() {
await this.modPage.waitForSelector(e.actions);
await this.modPage.wasRemoved(e.hidePublicChat);
await this.modPage.hasElement(e.actions, 'should display the actions button');
await this.modPage.wasRemoved(e.hidePublicChat, 'should display the hide public chat element when the public chat is open');
}
async recordMeeting() {
await this.modPage.hasElement(e.recordingIndicator);
await this.modPage.hasElement(e.recordingIndicator, 'should display the recording indicator');
}
async showParticipantsOnLogin() {
await this.modPage.wasRemoved(e.usersList);
await this.modPage.wasRemoved(e.usersList, 'should not display the users list');
}
async clientTitle() {
const pageTitle = await this.modPage.page.title();
expect(pageTitle).toContain(`${c.docTitle} - `);
expect(pageTitle, 'should display the changed name of the client title').toContain(`${c.docTitle} - `);
}
async askForFeedbackOnLogout() {
await this.modPage.logoutFromMeeting();
await this.modPage.waitForSelector(e.meetingEndedModal);
await this.modPage.hasElement(e.rating);
await this.modPage.hasElement(e.meetingEndedModal, 'should display the meeting ended modal, when the user leaves the meeting');
await this.modPage.hasElement(e.rating, 'should display the question for feedback after the user leaves');
}
async displayBrandingArea() {
await this.modPage.waitForSelector(e.userListContent);
await this.modPage.hasElement(e.brandingAreaLogo);
await this.modPage.hasElement(e.userListContent, 'should display the user list on the meeting');
await this.modPage.hasElement(e.brandingAreaLogo, 'should display the logo on the branding area');
}
async shortcuts() {
@ -49,65 +49,65 @@ class CustomParameters extends MultiUsers {
// Open private chat
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.startPrivateChat);
await this.modPage.waitForSelector(e.hidePrivateChat);
await this.modPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when the user has the private chat open');
// Check the later shortcuts that can be used after joining audio and opening private chat
await util.checkShortcutsArray(this.modPage, c.laterShortcuts);
}
async customStyle() {
await this.modPage.waitForSelector(e.chatButton);
await this.modPage.hasElement(e.chatButton, 'should display the chat button');
const resp = await this.modPage.page.evaluate((elem) => {
return document.querySelectorAll(elem)[0].offsetHeight == 0;
}, e.presentationTitle);
expect(resp).toBeTruthy();
expect(resp, 'should display the different style on the meeting').toBeTruthy();
}
async autoSwapLayout() {
await this.modPage.waitForSelector(e.actions);
await this.modPage.hasElement(e.actions, 'should display the actions button');
await this.modPage.waitAndClick(e.minimizePresentation);
const resp = await this.modPage.page.evaluate((elem) => {
return document.querySelectorAll(elem)[0].offsetHeight !== 0;
}, e.restorePresentation);
expect(resp).toBeTruthy();
expect(resp, 'should display the auto swap layout').toBeTruthy();
}
async autoJoin() {
await this.modPage.waitForSelector(e.chatMessages, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.audioModal);
await this.modPage.hasElement(e.chatMessages, 'should display the chat messages', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.audioModal, 'should not display the audio modal');
}
async listenOnlyMode() {
await this.modPage.waitForSelector(e.audioSettingsModal, ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.modPage.hasElement(e.audioSettingsModal, 'should display the audio settings modal when joining', ELEMENT_WAIT_EXTRA_LONG_TIME);
await this.modPage.waitAndClick(e.joinEchoTestButton);
await this.modPage.waitForSelector(e.establishingAudioLabel);
await this.modPage.waitForSelector(e.isTalking);
await this.modPage.hasElement(e.establishingAudioLabel, 'should display the audio being established');
await this.modPage.hasElement(e.isTalking, 'should display the is talking indicator, after the audio being established');
await this.modPage.leaveAudio();
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitForSelector(e.audioSettingsModal);
await this.modPage.hasElement(e.audioSettingsModal, 'should display the audio settings modal after clicked on the join audio button');
}
async forceListenOnly() {
await this.userPage.wasRemoved(e.audioModal);
await this.userPage.waitForSelector(e.toastContainer, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.wasRemoved(e.audioModal, 'should not display the audio modal, should join without microphone');
await this.userPage.hasElement(e.toastContainer, 'should display the toast container for the attendee', ELEMENT_WAIT_LONGER_TIME);
await util.forceListenOnly(this.userPage);
}
async skipCheck() {
await this.modPage.waitAndClick(e.microphoneButton);
await this.modPage.waitForSelector(e.establishingAudioLabel);
await this.modPage.wasRemoved(e.establishingAudioLabel, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.establishingAudioLabel, 'should establish audio');
await this.modPage.wasRemoved(e.establishingAudioLabel, 'should not display the audio being established label', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.isTalking);
}
async skipCheckOnFirstJoin() {
await this.modPage.waitAndClick(e.microphoneButton, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.establishingAudioLabel);
await this.modPage.hasElement(e.smallToastMsg);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.establishingAudioLabel, 'should establish audio');
await this.modPage.hasElement(e.smallToastMsg, 'should display the small toast message');
await this.modPage.hasElement(e.isTalking, 'should display the is talking element');
await this.modPage.leaveAudio();
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitAndClick(e.microphoneButton);
await this.modPage.hasElement(e.audioSettingsModal);
await this.modPage.hasElement(e.audioSettingsModal, 'should display the audio settings modal');
}
async skipEchoTestIfPreviousDevice() {
@ -121,24 +121,24 @@ class CustomParameters extends MultiUsers {
}
async bannerText() {
await this.modPage.waitForSelector(e.actions);
await this.modPage.hasElement(e.notificationBannerBar);
await this.modPage.hasElemnt(e.actions, 'should display the actions button');
await this.modPage.hasElement(e.notificationBannerBar, 'should display the notification banner bar with a text');
}
async bannerColor(colorToRGB) {
await this.modPage.waitForSelector(e.notificationBannerBar);
await this.modPage.hasElement(e.notificationBannerBar, 'should display the notifications banner bar');
const notificationLocator = this.modPage.getLocator(e.notificationBannerBar);
const notificationBarColor = await notificationLocator.evaluate((elem) => {
return getComputedStyle(elem).backgroundColor;
}, e.notificationBannerBar);
expect(notificationBarColor).toBe(colorToRGB);
expect(notificationBarColor, 'should display the banner bar with the choosen color').toBe(colorToRGB);
}
async hidePresentationOnJoin() {
await this.modPage.waitForSelector(e.actions);
await this.modPage.hasElement(e.restorePresentation);
await this.userPage.hasElement(e.restorePresentation);
await this.userPage.wasRemoved(e.whiteboard);
await this.modPage.hasElement(e.actions, 'should display the actions button');
await this.modPage.hasElement(e.restorePresentation, 'should display the restore presentation button for the moderator');
await this.userPage.hasElement(e.restorePresentation, 'should display the restore presentation button for the attendee');
await this.userPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the attendee');
}
async forceRestorePresentationOnNewEvents(joinParameter) {
@ -146,9 +146,9 @@ class CustomParameters extends MultiUsers {
const { presentationHidden, pollEnabled } = getSettings();
if (!presentationHidden) await this.userPage.waitAndClick(e.minimizePresentation);
const zoomInCase = await util.zoomIn(this.modPage);
expect(zoomInCase).toBeTruthy();
expect(zoomInCase, 'should the presentation be zoomed').toBeTruthy();
const zoomOutCase = await util.zoomOut(this.modPage);
expect(zoomOutCase).toBeTruthy();
expect(zoomOutCase, 'should the presentation be unzoomed').toBeTruthy();
if (pollEnabled) await util.poll(this.modPage, this.userPage);
await util.nextSlide(this.modPage);
await util.previousSlide(this.modPage);
@ -161,12 +161,12 @@ class CustomParameters extends MultiUsers {
const { presentationHidden, pollEnabled } = getSettings();
if (!presentationHidden) await this.userPage.waitAndClick(e.minimizePresentation);
if (pollEnabled) await util.poll(this.modPage, this.userPage);
await this.userPage.waitForSelector(e.smallToastMsg);
await this.userPage.hasElement(e.smallToastMsg, 'should display the small toast message');
await this.userPage.checkElement(e.restorePresentation);
}
async enableVideo() {
await this.modPage.wasRemoved(e.joinVideo);
await this.modPage.wasRemoved(e.joinVideo, 'should not display the join video');
}
async skipVideoPreview() {
@ -176,7 +176,7 @@ class CustomParameters extends MultiUsers {
async skipVideoPreviewOnFirstJoin() {
await this.modPage.shareWebcam(false);
await this.modPage.waitAndClick(e.leaveVideo, VIDEO_LOADING_WAIT_TIME);
await this.modPage.waitForSelector(e.joinVideo);
await this.modPage.hasElement(e.joinVideo, 'should display the join video button');
const { videoPreviewTimeout } = this.modPage.settings;
await this.modPage.shareWebcam(true, videoPreviewTimeout);
}
@ -191,9 +191,9 @@ class CustomParameters extends MultiUsers {
async mirrorOwnWebcam() {
await this.modPage.waitAndClick(e.joinVideo);
await this.modPage.waitForSelector(e.webcamMirroredVideoPreview);
await this.modPage.hasElement(e.webcamMirroredVideoPreview, 'should display the preview of the webcam video being mirroed');
await this.modPage.waitAndClick(e.startSharingWebcam);
await this.modPage.hasElement(e.webcamMirroredVideoContainer);
await this.modPage.hasElement(e.webcamMirroredVideoContainer, 'should display the webcam mirroed video container after the camera is shared');
}
async multiUserPenOnly() {
@ -218,29 +218,29 @@ class CustomParameters extends MultiUsers {
}
async autoShareWebcam() {
await this.modPage.hasElement(e.webcamSettingsModal);
await this.modPage.hasElement(e.webcamSettingsModal, 'should display the webcam settings modal when auto sharing the webcam ');
}
async hideActionsBarTest() {
await this.modPage.wasRemoved(e.actions);
await this.modPage.wasRemoved(e.joinAudio);
await this.modPage.wasRemoved(e.joinVideo);
await this.modPage.wasRemoved(e.startScreenSharing);
await this.modPage.wasRemoved(e.minimizePresentation);
await this.modPage.wasRemoved(e.reactionsButton);
await this.modPage.wasRemoved(e.actions, 'should not display the actions button');
await this.modPage.wasRemoved(e.joinAudio, 'should not display the join audio button');
await this.modPage.wasRemoved(e.joinVideo, 'should not display the join video button');
await this.modPage.wasRemoved(e.startScreenSharing, 'should not display the start screensharing');
await this.modPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button');
await this.modPage.wasRemoved(e.reactionsButton, 'should not display the reactions button');
}
async overrideDefaultLocaleTest() {
await this.modPage.hasText(e.chatButton, 'Bate-papo público');
await this.modPage.hasText(e.chatButton, 'Bate-papo público','should display the new overrided default locale');
}
async hideNavBarTest() {
await this.modPage.wasRemoved(e.navbarBackground);
await this.modPage.wasRemoved(e.navbarBackground, 'should not display the navbar');
}
async preferredCameraProfileTest() {
await this.modPage.waitAndClick(e.joinVideo);
expect(await this.modPage.getLocator(e.selectCameraQualityId).inputValue()).toBe('low');
expect(await this.modPage.getLocator(e.selectCameraQualityId).inputValue(), 'should display the selector to choose the camera quality').toBe('low');
await this.modPage.waitAndClick(e.startSharingWebcam);
}
}

View File

@ -10,56 +10,56 @@ class DisabledFeatures extends MultiUsers {
async breakoutRooms() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.wasRemoved(e.createBreakoutRooms);
await this.modPage.wasRemoved(e.createBreakoutRooms, 'should not display the option to create breakout rooms on the manage users');
}
async speechRecognition() {
const { speechRecognitionEnabled } = getSettings();
await this.modPage.waitForSelector(e.audioModal, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.audioModal, 'should display the audio modal', ELEMENT_WAIT_LONGER_TIME);
if (speechRecognitionEnabled) {
await this.modPage.wasRemoved(e.speechRecognition);
} else {
await this.modPage.wasRemoved(e.speechRecognitionUnsupported);
await this.modPage.wasRemoved(e.speechRecognitionUnsupported, 'should not display the speech recognition message saying that is unsupported');
}
}
async captions() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.wasRemoved(e.writeClosedCaptions);
await this.modPage.wasRemoved(e.writeClosedCaptions, 'should not display the write closed captions');
}
async chat() {
await this.modPage.wasRemoved(e.hidePublicChat);
await this.modPage.wasRemoved(e.hidePublicChat, 'should not display the hide public chat button and the whole chat');
}
async externalVideos() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.wasRemoved(e.shareExternalVideoBtn);
await this.modPage.wasRemoved(e.shareExternalVideoBtn, 'should not display the share external video option when opening the actions button');
}
async layouts() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.wasRemoved(e.manageLayoutBtn);
await this.modPage.wasRemoved(e.manageLayoutBtn, 'should not display manage layout option when the actions is open');
}
async learningDashboard() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.wasRemoved(e.learningDashboard);
await this.modPage.wasRemoved(e.learningDashboard, 'should not display the learning dashboard on the manage users');
}
async polls() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.wasRemoved(e.polling);
await this.modPage.wasRemoved(e.polling, 'should not display the polling on the actions button');
}
async screenshare() {
await this.modPage.wasRemoved(e.startScreenSharing);
await this.modPage.wasRemoved(e.startScreenSharing, 'should not display the screenshare button');
}
async sharedNotes() {
await this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes on the side bar');
}
async virtualBackgrounds() {
@ -71,25 +71,25 @@ class DisabledFeatures extends MultiUsers {
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.managePresentations);
await this.modPage.waitAndClick(e.presentationOptionsDownloadBtn);
await this.modPage.wasRemoved(e.sendPresentationInCurrentStateBtn);
await this.modPage.wasRemoved(e.sendPresentationInCurrentStateBtn, 'should not display the option send presentation with annotations on the manage presentations');
}
async importPresentationWithAnnotationsFromBreakoutRooms() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.createBreakoutRooms);
await this.modPage.wasRemoved(e.captureBreakoutWhiteboard);
await this.modPage.wasRemoved(e.captureBreakoutWhiteboard, 'should not display the option to capture the breakout room whiteboard when the create breakout rooms modal is opened');
}
async importSharedNotesFromBreakoutRooms() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.createBreakoutRooms);
await this.modPage.wasRemoved(e.captureBreakoutSharedNotes);
await this.modPage.wasRemoved(e.captureBreakoutSharedNotes, 'should not display the option to capture the breakout room shared notes when the create breakout room modal is opened');
}
async presentation() {
await this.modPage.wasRemoved(e.whiteboard);
await this.modPage.wasRemoved(e.minimizePresentation);
await this.modPage.wasRemoved(e.restorePresentation);
await this.modPage.wasRemoved(e.whiteboard, 'should not display the whiteboard');
await this.modPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button');
await this.modPage.wasRemoved(e.restorePresentation, 'should not display the restore presentation button');
}
async customVirtualBackground() {
@ -99,23 +99,23 @@ class DisabledFeatures extends MultiUsers {
}
async slideSnapshot() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard');
await this.modPage.waitAndClick(e.whiteboardOptionsButton);
await this.modPage.hasElement(e.presentationFullscreen);
await this.modPage.wasRemoved(e.presentationSnapshot);
await this.modPage.hasElement(e.presentationFullscreen, 'should display the presentation fullscreen on the whiteboard options');
await this.modPage.wasRemoved(e.presentationSnapshot, 'should not display the presentation snapshot on the whiteboard options');
}
async cameraAsContent() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard');
await this.modPage.waitAndClick(e.actions);
await this.modPage.hasElement(e.managePresentations);
await this.modPage.wasRemoved(e.shareCameraAsContent);
await this.modPage.hasElement(e.managePresentations, 'should display the manage presentations option');
await this.modPage.wasRemoved(e.shareCameraAsContent, 'should not display the share camera as content option on the actions');
}
// Disabled Features Exclude
async breakoutRoomsExclude() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.hasElement(e.createBreakoutRooms);
await this.modPage.hasElement(e.createBreakoutRooms, 'should display the create breakout rooms option on the manage users');
}
async speechRecognitionExclude() {
@ -126,45 +126,45 @@ class DisabledFeatures extends MultiUsers {
if (speechRecognitionEnabled) {
await this.modPage.wasRemoved(e.speechRecognition);
} else {
await this.modPage.wasRemoved(e.speechRecognitionUnsupported);
await this.modPage.wasRemoved(e.speechRecognitionUnsupported, 'should not display the speech recognition unsupported message');
}
}
async captionsExclude() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.hasElement(e.writeClosedCaptions);
await this.modPage.hasElement(e.writeClosedCaptions, 'should display the write closed captions');
}
async chatExclude() {
await this.modPage.hasElement(e.hidePublicChat);
await this.modPage.hasElement(e.hidePublicChat, 'should display the hide public chat option when the public chat is open');
}
async externalVideosExclude() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.hasElement(e.shareExternalVideoBtn);
await this.modPage.hasElement(e.shareExternalVideoBtn, 'should display the share external video button');
}
async layoutsExclude() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.hasElement(e.manageLayoutBtn);
await this.modPage.hasElement(e.manageLayoutBtn, 'should display the manage layout button');
}
async learningDashboardExclude() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.hasElement(e.learningDashboard);
await this.modPage.hasElement(e.learningDashboard, 'should display the learning dashboard on the manage users');
}
async pollsExclude() {
await this.modPage.waitAndClick(e.actions);
await this.modPage.hasElement(e.polling);
await this.modPage.hasElement(e.polling, 'should display the polling option on the actions');
}
async screenshareExclude() {
await this.modPage.hasElement(e.startScreenSharing);
await this.modPage.hasElement(e.startScreenSharing, 'should display the start screenshare option');
}
async sharedNotesExclude() {
await this.modPage.hasElement(e.sharedNotes);
await this.modPage.hasElement(e.sharedNotes, 'should display the shared notes');
}
async virtualBackgroundsExclude() {
@ -174,29 +174,29 @@ class DisabledFeatures extends MultiUsers {
}
async downloadPresentationWithAnnotationsExclude() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard');
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.managePresentations);
await this.modPage.waitAndClick(e.presentationOptionsDownloadBtn);
await this.modPage.hasElement(e.sendPresentationInCurrentStateBtn);
await this.modPage.hasElement(e.sendPresentationInCurrentStateBtn, 'should display the option to send the presentation in current state so de user can download the presentation with the annotations');
}
async importPresentationWithAnnotationsFromBreakoutRoomsExclude() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.createBreakoutRooms);
await this.modPage.hasElement(e.captureBreakoutWhiteboard);
await this.modPage.hasElement(e.captureBreakoutWhiteboard, 'should display the option to capture the breakout whiteboard on the create breakout rooms modal');
}
async importSharedNotesFromBreakoutRoomsExclude() {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.createBreakoutRooms);
await this.modPage.hasElement(e.captureBreakoutSharedNotes);
await this.modPage.hasElement(e.captureBreakoutSharedNotes, 'should display the option to capture the shared notes whiteboard on the create breakout rooms modal');
}
async presentationExclude() {
await this.modPage.hasElement(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard');
await this.modPage.waitAndClick(e.minimizePresentation);
await this.modPage.hasElement(e.restorePresentation);
await this.modPage.hasElement(e.restorePresentation, 'should display the restore presentation option');
}
async customVirtualBackgroundExclude() {
@ -206,15 +206,15 @@ class DisabledFeatures extends MultiUsers {
}
async slideSnapshotExclude() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard');
await this.modPage.waitAndClick(e.whiteboardOptionsButton);
await this.modPage.hasElement(e.presentationSnapshot);
await this.modPage.hasElement(e.presentationSnapshot, 'should display the presentation snapshot on the whiteboard options');
}
async cameraAsContentExclude() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.waitAndClick(e.actions);
await this.modPage.hasElement(e.shareCameraAsContent);
await this.modPage.hasElement(e.shareCameraAsContent, 'should display the share camera as content on the action options.');
}
}

View File

@ -66,7 +66,7 @@ async function nextSlide(test) {
async function annotation(test) {
await test.waitAndClick(e.wbPencilShape);
await test.waitAndClick(e.whiteboard);
await test.waitForSelector(e.wbDrawnLine);
await test.hasElement(e.wbDrawnLine, 'should the presentation displays the tool drawn line');
}
function encodeCustomParams(param) {

View File

@ -1,11 +1,10 @@
const { expect, test } = require('@playwright/test');
const { expect } = require('@playwright/test');
const { MultiUsers } = require('../user/multiusers');
const e = require('../core/elements');
const util = require('./util.js');
const { ELEMENT_WAIT_LONGER_TIME, ELEMENT_WAIT_TIME, ELEMENT_WAIT_EXTRA_LONG_TIME } = require('../core/constants');
const { ELEMENT_WAIT_LONGER_TIME, ELEMENT_WAIT_TIME } = require('../core/constants');
const { getSettings } = require('../core/settings');
const { waitAndClearDefaultPresentationNotification } = require('../notifications/util');
const { uploadSinglePresentation, skipSlide } = require('../presentation/util');
const { skipSlide } = require('../presentation/util');
const { sleep } = require('../core/helpers.js');
class Polling extends MultiUsers {
@ -16,23 +15,23 @@ class Polling extends MultiUsers {
async createPoll() {
await util.startPoll(this.modPage);
await this.modPage.hasElement(e.pollMenuButton);
await this.modPage.hasElement(e.publishPollingLabel);
await this.modPage.hasElement(e.cancelPollBtn);
await this.userPage.hasElement(e.pollingContainer);
await this.modPage.hasElement(e.pollMenuButton, 'should display the poll menu button after starting the poll');
await this.modPage.hasElement(e.publishPollingLabel, 'should display the publish poll button');
await this.modPage.hasElement(e.cancelPollBtn, 'should display the cancel poll button after the poll creation');
await this.userPage.hasElement(e.pollingContainer, 'should display the poll container for the attendee');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close poll button after clicking to close the poll');
}
async pollAnonymous() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard', ELEMENT_WAIT_LONGER_TIME);
await util.startPoll(this.modPage, true);
await this.modPage.waitForSelector(e.publishPollingLabel);
await this.modPage.hasElement(e.publishPollingLabel, 'should display the poll publish button after the poll starts');
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.userPage.wasRemoved(e.receivedAnswer);
await this.userPage.wasRemoved(e.receivedAnswer, 'should not display the received answer for the attendee');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close poll button after the poll closes');
}
async quickPoll() {
@ -40,48 +39,48 @@ class Polling extends MultiUsers {
// The slide needs to be uploaded and converted, so wait a bit longer for this step
await this.modPage.waitAndClick(e.quickPoll, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitForSelector(e.pollMenuButton);
await this.modPage.hasElement(e.pollMenuButton, 'should display the poll menu button');
await this.userPage.hasElement(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the attendeee to answer it');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close poll button after the poll closes');
}
async pollUserResponse() {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await util.openPoll(this.modPage);
await this.modPage.type(e.pollQuestionArea, e.pollQuestion);
await this.modPage.waitAndClick(e.userResponseBtn);
await this.modPage.waitAndClick(e.startPoll);
await this.userPage.waitForSelector(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the user to answer it');
await this.userPage.type(e.pollAnswerOptionInput, e.answerMessage);
await this.userPage.waitAndClick(e.pollSubmitAnswer);
await this.modPage.hasText(e.userVoteLiveResult, e.answerMessage);
await this.modPage.hasText(e.userVoteLiveResult, e.answerMessage, 'should display the answer sent by the attendee');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.wasRemoved(e.pollingContainer);
await this.modPage.wasRemoved(e.pollingContainer, 'should close the polling container after publishing the label');
await this.modPage.hasElement(e.wbPollShape, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.wbPollShape);
}
async stopPoll() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator', ELEMENT_WAIT_LONGER_TIME);
await util.startPoll(this.modPage);
await this.userPage.waitForSelector(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the attendeee after the poll is created');
await this.modPage.waitAndClick(e.cancelPollBtn);
await this.userPage.wasRemoved(e.pollingContainer);
await this.userPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the poll is canceled');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close polling button for the moderator after the poll is closed');
}
async manageResponseChoices() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator', ELEMENT_WAIT_LONGER_TIME);
await this.startNewPoll();
const initialRespCount = await this.modPage.getSelectorCount(e.pollOptionItem);
@ -90,7 +89,7 @@ class Polling extends MultiUsers {
await this.typeOnLastChoiceInput();
await this.modPage.waitAndClick(e.startPoll);
await expect(initialRespCount + 1).toEqual(await this.getAnswerOptionCount());
await expect(initialRespCount + 1, 'should display the initial quantity of poll options itens plus 1').toEqual(await this.getAnswerOptionCount());
await this.checkLastOptionText();
// Delete
@ -98,21 +97,21 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.deletePollOption);
await this.modPage.waitAndClick(e.startPoll);
await expect(initialRespCount - 1).toEqual(await this.getAnswerOptionCount());
await expect(initialRespCount - 1, 'should display the initial quantity of poll options itens minus 1').toEqual(await this.getAnswerOptionCount());
// Edit
await this.startNewPoll();
await this.typeOnLastChoiceInput();
await this.modPage.waitAndClick(e.startPoll);
await expect(initialRespCount).toEqual(await this.getAnswerOptionCount());
await expect(initialRespCount, 'should display the initial quantity of poll options itens').toEqual(await this.getAnswerOptionCount());
await this.checkLastOptionText();
await this.modPage.waitAndClick(e.closePollingBtn);
}
async notAbleStartNewPollWithoutPresentation() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator when joining the meeting', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.managePresentations);
@ -125,12 +124,12 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.confirmManagePresentation);
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.polling);
await this.modPage.hasElement(e.noPresentation);
await this.modPage.hasElement(e.noPresentation, 'should display the no presentation for not being able to start a poll whitout presentation');
}
async customInput() {
await util.uploadSPresentationForTestingPolls(this.modPage, e.uploadPresentationFileName);
await this.modPage.waitForSelector(e.whiteboard, 20000);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator when joining the meeting', 20000);
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.polling);
@ -143,14 +142,14 @@ class Polling extends MultiUsers {
await this.modPage.type(e.pollOptionItem2, 'test2');
await this.modPage.waitAndClick(e.startPoll);
await this.userPage.hasElement(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the attendee after starting the poll');
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasText(e.currentPollQuestion, /Test/);
await this.modPage.hasText(e.userVoteLiveResult, '1');
await this.modPage.hasText(e.currentPollQuestion, /Test/, 'should display the answer that the ateendee selected');
await this.modPage.hasText(e.userVoteLiveResult, '1', 'should display the live result');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close polling button after the poll is closed');
}
async allowMultipleChoices() {
@ -163,40 +162,40 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.addPollItem);
await this.modPage.waitAndClick(e.startPoll);
await this.modPage.hasElement(e.errorNoValueInput);
await this.modPage.hasElement(e.errorNoValueInput, 'should display an error after trying to start a poll without any input on the option poll item');
await this.modPage.type(e.pollOptionItem1, 'test1');
await this.modPage.waitAndClick(e.addPollItem);
await this.modPage.type(e.pollOptionItem2, 'test2');
await this.modPage.waitAndClick(e.startPoll);
await this.modPage.hasText(e.currentPollQuestion, /Test/);
await this.modPage.hasText(e.currentPollQuestion, /Test/, 'should display the current poll question after the poll has started');
await this.userPage.waitAndClick(e.firstPollAnswerOptionBtn);
await this.userPage.waitAndClick(e.secondPollAnswerOptionBtn);
await this.userPage.waitAndClickElement(e.submitAnswersMultiple);
await this.modPage.hasText(e.userVoteLiveResult, '1');
await this.modPage.hasText(e.userVoteLiveResult, '2');
await this.modPage.hasText(e.userVoteLiveResult, '1', 'should display the user vote number after the attende has answered the poll');
await this.modPage.hasText(e.userVoteLiveResult, '2', 'should display the user vote number after the attende has answered the poll');
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn, 'should not display the close polling button after the poll is closed');
}
async smartSlidesQuestions() {
await this.modPage.hasElement(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await util.uploadSPresentationForTestingPolls(this.modPage, e.smartSlides1);
await this.userPage.hasElement(e.userListItem);
await this.userPage.hasElement(e.userListItem, 'should display the user list item for the attendee');
// Type Response
await this.modPage.waitAndClick(e.quickPoll, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.responsePollQuestion);
await this.userPage.hasElement(e.responsePollQuestion, 'should display the poll question after quick poll starts');
await this.userPage.type(e.pollAnswerOptionInput, 'test');
await this.userPage.waitAndClick(e.pollSubmitAnswer);
await this.userPage.wasRemoved(e.pollingContainer, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the attendee answer the poll', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasText(e.userVoteLiveResult, 'test');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.wasRemoved(e.pollingContainer);
await this.modPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the poll be published');
// Multiple Choices
await sleep(500); // avoid error when the tooltip is in front of the button due to layout shift
@ -205,21 +204,21 @@ class Polling extends MultiUsers {
await this.userPage.waitAndClick(e.firstPollAnswerDescOption);
await this.userPage.waitAndClick(e.secondPollAnswerDescOption);
await this.userPage.waitAndClick(e.submitAnswersMultiple);
await this.modPage.hasText(e.userVoteLiveResult, 'A) 2222');
await this.modPage.hasText(e.userVoteLiveResult, 'B) 3333');
await this.modPage.hasText(e.userVoteLiveResult, 'A) 2222', 'should display the live vote result for the awswers after the attende answer the multiple choices polling ');
await this.modPage.hasText(e.userVoteLiveResult, 'B) 3333', 'should display the live vote result for the awswers after the attende answer the multiple choices polling ');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.wasRemoved(e.pollingContainer);
await this.modPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the poll is published');
// One option answer
await sleep(500); // avoid error when the tooltip is in front of the button due to layout shift
await skipSlide(this.modPage);
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.waitAndClick(e.pollAnswerOptionE);
await this.modPage.hasText(e.userVoteLiveResult, 'E) 22222');
await this.modPage.hasText(e.userVoteLiveResult, 'E) 22222', 'should display the vote result after the poll is answered');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.wasRemoved(e.pollingContainer);
await this.modPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the poll is published');
// Yes/No/Abstention
await sleep(500); // avoid error when the tooltip is in front of the button due to layout shift
@ -227,7 +226,7 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.yesNoOption);
await this.modPage.waitAndClick(e.yesNoAbstentionOption)
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasText(e.userVoteLiveResult, 'Yes');
await this.modPage.hasText(e.userVoteLiveResult, 'Yes', 'should display the vote result after the attendee submit the answer');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.wasRemoved(e.pollingContainer);
@ -237,47 +236,47 @@ class Polling extends MultiUsers {
await skipSlide(this.modPage);
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasText(e.userVoteLiveResult, 'True');
await this.modPage.hasText(e.userVoteLiveResult, 'True', 'should display the vote result after the attendeee submit the answer');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.hasElementDisabled(e.nextSlide);
await this.modPage.wasRemoved(e.pollingContainer);
await this.modPage.hasElementDisabled(e.nextSlide, 'should display the next slide button disabled since the smart slides has finished with all the questions');
await this.modPage.wasRemoved(e.pollingContainer, 'should not display the pollling container after all the smart slides questions is finished');
}
async pollResultsOnChat() {
const { pollChatMessage } = getSettings();
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator when joining the meeting', ELEMENT_WAIT_LONGER_TIME);
await util.startPoll(this.modPage);
await this.modPage.hasElementDisabled(e.publishPollingLabel);
await this.modPage.hasElementDisabled(e.publishPollingLabel, 'should display the publish polling button disabled without any answer sent from the user');
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasElement(e.publishPollingLabel);
await this.modPage.hasElement(e.publishPollingLabel, 'should display the publish polling button enabled after the attendee answered the poll');
await this.modPage.waitAndClick(e.publishPollingLabel);
const lastChatPollMessageTextModerator = await this.modPage.getLocator(e.chatPollMessageText).last();
if(!pollChatMessage) {
return expect(lastChatPollMessageTextModerator).toBeHidden({ ELEMENT_WAIT_TIME });
return expect(lastChatPollMessageTextModerator, 'should not display the last chat poll message on the chat, so the poll results on the chat').toBeHidden({ ELEMENT_WAIT_TIME });
}
await expect(lastChatPollMessageTextModerator).toBeVisible();
await expect(lastChatPollMessageTextModerator, 'should display the last chaat poll message on the chat, so the poll results on the chat').toBeVisible();
const lastChatPollMessageTextUser = await this.userPage.getLocator(e.chatPollMessageText).last();
await expect(lastChatPollMessageTextUser).toBeVisible();
await expect(lastChatPollMessageTextUser, 'should display the poll results on the chat for the attendee').toBeVisible();
}
async pollResultsOnWhiteboard() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard when the moderator joins the meeting', ELEMENT_WAIT_LONGER_TIME);
await util.startPoll(this.modPage);
const wbDrawnRectangleLocator = await this.modPage.getLocator(e.wbPollShape);
const initialWbDrawnRectangleCount = await wbDrawnRectangleLocator.count();
await this.modPage.hasElementDisabled(e.publishPollingLabel);
await this.modPage.hasElementDisabled(e.publishPollingLabel, 'should display the publish poll button disabled before the poll is answered');
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasElement(e.publishPollingLabel);
await this.modPage.hasElement(e.publishPollingLabel, 'should display the publish poll button enabled after the attendee answered the poll');
await this.modPage.waitAndClick(e.publishPollingLabel);
await expect(wbDrawnRectangleLocator).toHaveCount(initialWbDrawnRectangleCount + 1);
await expect(wbDrawnRectangleLocator,'should display the rectangle with the poll information on the whiteboard').toHaveCount(initialWbDrawnRectangleCount + 1);
const lastWbDrawnRectangleLocator = await wbDrawnRectangleLocator.last();
await expect(lastWbDrawnRectangleLocator).toBeVisible({ timeout: ELEMENT_WAIT_TIME});
await expect(lastWbDrawnRectangleLocator, 'should display the last rectangle with the poll information on the whiteboard').toBeVisible({ timeout: ELEMENT_WAIT_TIME});
const modWbLocator = this.modPage.getLocator(e.whiteboard);
const wbBox = await modWbLocator.boundingBox();
@ -289,7 +288,7 @@ class Polling extends MultiUsers {
await this.modPage.page.mouse.up();
await lastWbDrawnRectangleLocator.dblclick({ timeout: ELEMENT_WAIT_TIME });
await this.modPage.page.keyboard.type('test');
await expect(lastWbDrawnRectangleLocator).toContainText('test');
await expect(lastWbDrawnRectangleLocator, 'should display the text test on the last rectangle poll results on the whiteboard').toContainText('test');
// user turns to presenter to edit the poll results
await this.modPage.waitAndClick(e.userListItem);
@ -301,7 +300,7 @@ class Polling extends MultiUsers {
const wbDrawnRectangleUserLocator = await this.userPage.getLocator(e.wbPollShape).last();
await wbDrawnRectangleUserLocator.dblclick({ timeout: ELEMENT_WAIT_TIME });
await this.userPage.page.keyboard.type('testUser');
await expect(wbDrawnRectangleUserLocator).toContainText('testUser');
await expect(wbDrawnRectangleUserLocator, 'should display the edit that the attendee made to the poll results rectangle on the whiteboard').toContainText('testUser');
await this.modPage.waitAndClick(e.currentUser);
await this.modPage.waitAndClick(e.takePresenter);
@ -322,13 +321,13 @@ class Polling extends MultiUsers {
const hasPollStarted = await this.modPage.checkElement(e.pollMenuButton);
if (hasPollStarted) {
await this.modPage.waitAndClick(e.cancelPollBtn);
await this.userPage.wasRemoved(e.pollingContainer);
await this.userPage.wasRemoved(e.pollingContainer, 'should not display the polling container after the poll is canceled');
}
await util.openPoll(this.modPage);
}
async getAnswerOptionCount() {
await this.userPage.waitForSelector(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the attendee');
return this.userPage.getSelectorCount(e.pollAnswerOptionBtn);
}
@ -338,9 +337,9 @@ class Polling extends MultiUsers {
}
async checkLastOptionText() {
await this.userPage.waitForSelector(e.pollingContainer);
await this.userPage.hasElement(e.pollingContainer, 'should display the polling container for the attendee');
const lastOptionText = this.userPage.getLocatorByIndex(e.pollAnswerOptionBtn, -1);
await expect(lastOptionText).toHaveText(this.newInputText);
await expect(lastOptionText, 'should display the last option text for the attendee').toHaveText(this.newInputText);
}
}

View File

@ -9,9 +9,9 @@ async function openPoll(testPage) {
await testPage.waitAndClick(e.actions);
await testPage.waitAndClick(e.polling);
await testPage.waitForSelector(e.hidePollDesc);
await testPage.hasElement(e.hidePollDesc, 'should display the hide poll description when creating a new poll');
await testPage.waitAndClick(e.pollLetterAlternatives);
await testPage.waitForSelector(e.pollOptionItem);
await testPage.checkElementCount(e.pollOptionItem, 4, 'should display the poll options item for the poll answers');
}
async function startPoll(test, isAnonymous = false) {
@ -23,10 +23,10 @@ async function startPoll(test, isAnonymous = false) {
async function uploadSPresentationForTestingPolls(test, fileName) {
await test.waitAndClick(e.actions);
await test.waitAndClick(e.managePresentations);
await test.waitForSelector(e.presentationFileUpload);
await test.hasElement(e.presentationFileUpload, 'should display the presentation file upload on the manage presentations modal');
await test.page.setInputFiles(e.presentationFileUpload, path.join(__dirname, `../core/media/${fileName}`));
await test.hasText('body', e.statingUploadPresentationToast);
await test.hasText('body', e.statingUploadPresentationToast, 'should display the presentation toast about the upload');
await test.waitAndClick(e.confirmManagePresentation);
}

View File

@ -17,29 +17,29 @@ class Presentation extends MultiUsers {
}
async skipSlide() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard when the moderator joins the meeting', ELEMENT_WAIT_LONGER_TIME);
await checkSvgIndex(this.modPage, '/svg/1');
await this.modPage.waitAndClick(e.nextSlide);
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the next slide on the whiteboard');
await sleep(1000);
await checkSvgIndex(this.modPage, '/svg/2');
await this.modPage.waitAndClick(e.prevSlide);
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the previous slide on the whiteboard');
await sleep(1000);
await checkSvgIndex(this.modPage, '/svg/1');
}
async shareCameraAsContent() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard whent then moderator joins the meeting', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.shareCameraAsContent);
await this.modPage.waitForSelector(e.videoPreview);
await this.modPage.hasElement(e.videoPreview, 'should display the camera preview when sharing camera as content');
await this.modPage.waitAndClick(e.startSharingWebcam);
await this.modPage.hasElement(e.screenshareConnecting);
@ -50,7 +50,7 @@ class Presentation extends MultiUsers {
await closeButton.click();
}
const modWhiteboardLocator = this.modPage.getLocator(e.screenShareVideo);
await expect(modWhiteboardLocator).toHaveScreenshot('moderator-share-camera-as-content.png', {
await expect(modWhiteboardLocator, 'should display the same screenshot as taken before').toHaveScreenshot('moderator-share-camera-as-content.png', {
maxDiffPixels: 1000,
});
@ -69,34 +69,34 @@ class Presentation extends MultiUsers {
async hideAndRestorePresentation() {
const { presentationHidden } = getSettings();
if (!presentationHidden) {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard when the moderator joins the meeting', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.minimizePresentation);
}
await this.modPage.wasRemoved(e.presentationContainer);
await this.modPage.wasRemoved(e.presentationContainer, 'should not display the presentation container since the presentation is minimized');
await this.modPage.waitAndClick(e.restorePresentation);
await this.modPage.hasElement(e.presentationContainer);
await this.modPage.hasElement(e.presentationContainer, 'should display the presentation container since the presentation was restored');
}
async startExternalVideo() {
const { externalVideoPlayer } = getSettings();
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard when the moderator joins the meeting');
await this.modPage.waitAndClick(e.actions);
if(!externalVideoPlayer) {
await this.modPage.hasElement(e.managePresentations);
return this.modPage.wasRemoved(e.shareExternalVideoBtn);
await this.modPage.hasElement(e.managePresentations, 'should display the manage presentation options on the actions button');
return this.modPage.wasRemoved(e.shareExternalVideoBtn, 'should not display the option to share an external video, since is deactivated');
}
await this.modPage.waitAndClick(e.shareExternalVideoBtn);
await this.modPage.waitForSelector(e.closeModal);
await this.modPage.hasElement(e.closeModal, 'should display the close modal button after the moderator opens the modal for sharing external video');
await this.modPage.type(e.videoModalInput, e.youtubeLink);
await this.modPage.waitAndClick(e.startShareVideoBtn);
const modFrame = await this.modPage.getYoutubeFrame();
const userFrame = await this.userPage.getYoutubeFrame();
await modFrame.hasElement('video');
await userFrame.hasElement('video');
await modFrame.hasElement('video', 'should display the element frame for the video that is being shared for the moderator');
await userFrame.hasElement('video', 'should display the element frame for the video that is being shared for the attendee');
}
async uploadSinglePresentationTest() {
@ -116,6 +116,7 @@ class Presentation extends MultiUsers {
await this.modPage.closeAllToastNotifications();
await this.userPage.closeAllToastNotifications();
const modWhiteboardLocator = this.modPage.getLocator(e.whiteboard);
await this.modPage.setHeightWidthViewPortSize();
// Skip check for screenshot on ci, due to the ci and the local machine generating two different image sizes
@ -248,9 +249,9 @@ class Presentation extends MultiUsers {
const modSlides1 = await getSlideOuterHtml(this.modPage);
const userSlides1 = await getSlideOuterHtml(this.userPage);
await expect(modSlides1).toEqual(userSlides1);
await expect(modSlides0).not.toEqual(modSlides1);
await expect(userSlides0).not.toEqual(userSlides1);
await expect(modSlides1, 'moderator slide 1 should be equal to the user slide 1').toEqual(userSlides1);
await expect(modSlides0, 'moderator slide 0 should not be equal to moderator slide 1').not.toEqual(modSlides1);
await expect(userSlides0, 'user slide 0 should not be equal to the user slide 1').not.toEqual(userSlides1);
}
async fitToWidthTest() {
@ -260,17 +261,17 @@ class Presentation extends MultiUsers {
// check if its off
const fitToWidthButtonLocator = this.modPage.getLocator(`${e.fitToWidthButton} > span>>nth=0`);
const fitToWidthBorderColorOff = await fitToWidthButtonLocator.evaluate((elem) => getComputedStyle(elem).borderColor);
await expect(fitToWidthBorderColorOff).toBe('rgba(0, 0, 0, 0)');
await expect(fitToWidthBorderColorOff, 'should match the white color').toBe('rgba(0, 0, 0, 0)');
await this.modPage.waitAndClick(e.fitToWidthButton);
await sleep(500);
//check if its on
const fitToWidthBorderColorOn = await fitToWidthButtonLocator.evaluate((elem) => getComputedStyle(elem).borderColor);
await expect(fitToWidthBorderColorOn).toBe('rgb(6, 23, 42)');
await expect(fitToWidthBorderColorOn, 'should match the color dark blue').toBe('rgb(6, 23, 42)');
const width2 = (await this.modPage.getElementBoundingBox(e.whiteboard)).width;
await expect(Number(width2)).toBeGreaterThan(Number(width1));
await expect(Number(width2), 'should the last width be greater than the first one').toBeGreaterThan(Number(width1));
}
async enableAndDisablePresentationDownload(testInfo) {
@ -281,15 +282,15 @@ class Presentation extends MultiUsers {
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.managePresentations);
if(!originalPresentationDownloadable) {
await this.modPage.hasElement(e.presentationOptionsDownloadBtn);
return this.modPage.wasRemoved(e.enableOriginalPresentationDownloadBtn);
await this.modPage.hasElement(e.presentationOptionsDownloadBtn, 'should display the option download button for the presentation');
return this.modPage.wasRemoved(e.enableOriginalPresentationDownloadBtn, 'should the original presentation download presentation be removed');
}
await this.modPage.waitAndClick(e.presentationOptionsDownloadBtn);
await this.modPage.waitAndClick(e.enableOriginalPresentationDownloadBtn);
await this.userPage.hasElement(e.smallToastMsg);
await this.userPage.hasElement(e.presentationDownloadBtn);
await this.userPage.hasElement(e.smallToastMsg, 'should display the small toast message for the attendee');
await this.userPage.hasElement(e.presentationDownloadBtn, 'should display the presentation download button for the attendee');
await this.userPage.waitForSelector(e.whiteboard);
await this.userPage.hasElement(e.presentationDownloadBtn);
await this.userPage.hasElement(e.presentationDownloadBtn, 'should display the presentation download button for the attendee');
/**
* the following steps throwing "Error: ENOENT: no such file or directory" at the end of execution
* due to somehow it's trying to take the screenshot of the tab that opened for the file download
@ -301,9 +302,9 @@ class Presentation extends MultiUsers {
await this.modPage.waitAndClick(e.managePresentations);
await this.modPage.waitAndClick(e.presentationOptionsDownloadBtn);
await this.modPage.waitAndClick(e.disableOriginalPresentationDownloadBtn);
await this.modPage.hasElement(e.whiteboard);
await this.modPage.wasRemoved(e.presentationDownloadBtn);
await this.userPage.wasRemoved(e.presentationDownloadBtn);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.modPage.wasRemoved(e.presentationDownloadBtn, 'should not display the presentation download button for the moderator');
await this.userPage.wasRemoved(e.presentationDownloadBtn, 'should not display the presentation download button for the attendee');
}
async sendPresentationToDownload(testInfo) {
@ -332,10 +333,10 @@ class Presentation extends MultiUsers {
await this.modPage.waitAndClick(e.removePresentation);
await this.modPage.waitAndClick(e.confirmManagePresentation);
await this.modPage.wasRemoved(e.whiteboard);
await this.modPage.wasRemoved(e.minimizePresentation);
await this.userPage.wasRemoved(e.whiteboard);
await this.userPage.wasRemoved(e.minimizePresentation);
await this.modPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the moderator');
await this.modPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button for the moderator');
await this.userPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the attendee');
await this.userPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button for the attendee');
}
async uploadAndRemoveAllPresentations() {
@ -343,7 +344,7 @@ class Presentation extends MultiUsers {
const modSlides1 = await getSlideOuterHtml(this.modPage);
const userSlides1 = await getSlideOuterHtml(this.userPage);
await expect(modSlides1).toEqual(userSlides1);
await expect(modSlides1, 'should the moderator slide and the attendee slide to be equal').toEqual(userSlides1);
// Remove
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
@ -353,15 +354,15 @@ class Presentation extends MultiUsers {
await this.modPage.waitAndClick(e.removePresentation);
await this.modPage.waitAndClick(e.confirmManagePresentation);
await this.modPage.wasRemoved(e.whiteboard);
await this.modPage.wasRemoved(e.minimizePresentation);
await this.userPage.wasRemoved(e.whiteboard);
await this.userPage.wasRemoved(e.minimizePresentation);
await this.modPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the moderator');
await this.modPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button for the moderator');
await this.userPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the attendee');
await this.userPage.wasRemoved(e.minimizePresentation, 'should not display the minimize presentation button for the attendee');
// Check removed presentations inside the Manage Presentations
await this.modPage.waitAndClick(e.actions);
await this.modPage.waitAndClick(e.managePresentations);
await this.modPage.wasRemoved(e.presentationsList);
await this.modPage.wasRemoved(e.presentationsList, 'should not display the presentation list for the moderator');
await this.modPage.waitAndClick(e.confirmManagePresentation);
// Making viewer a presenter
@ -370,7 +371,7 @@ class Presentation extends MultiUsers {
await this.userPage.waitAndClick(e.actions);
await this.userPage.waitAndClick(e.managePresentations);
await this.userPage.wasRemoved(e.presentationsList);
await this.userPage.wasRemoved(e.presentationsList, 'should not display the presentation list for the attendee');
}
async removePreviousPresentationFromPreviousPresenter() {
@ -378,7 +379,7 @@ class Presentation extends MultiUsers {
const modSlides1 = await getSlideOuterHtml(this.modPage);
const userSlides1 = await getSlideOuterHtml(this.userPage);
await expect(modSlides1).toEqual(userSlides1);
await expect(modSlides1, 'should the moderator slide and the attendee slide to be equal').toEqual(userSlides1);
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.makePresenter);
@ -389,10 +390,10 @@ class Presentation extends MultiUsers {
await this.userPage.waitAndClick(e.removePresentation);
await this.userPage.waitAndClick(e.confirmManagePresentation);
await this.userPage.wasRemoved(e.whiteboard);
await this.userPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the attendee');
await this.userPage.waitAndClick(e.actions);
await this.userPage.waitAndClick(e.managePresentations);
await this.userPage.wasRemoved(e.presentationsList);
await this.userPage.wasRemoved(e.presentationsList, 'should not display the presentation list for the attendee');
}
async presentationFullscreen() {
@ -406,7 +407,7 @@ class Presentation extends MultiUsers {
// Gets fullscreen mode height
const heightFullscreen = parseInt(await getCurrentPresentationHeight(presentationLocator));
await expect(heightFullscreen).toBeGreaterThan(height);
await expect(heightFullscreen, 'should the height of the presentation fullscreen to be greater than the normal presentation height').toBeGreaterThan(height);
}
async presentationSnapshot(testInfo) {
@ -419,10 +420,10 @@ class Presentation extends MultiUsers {
async hidePresentationToolbar() {
await this.modPage.waitAndClick(e.whiteboardOptionsButton);
await this.modPage.waitAndClick(e.toolVisibility);
await this.modPage.wasRemoved(e.wbToolbar);
await this.modPage.wasRemoved(e.wbStyles);
await this.modPage.wasRemoved(e.wbUndo);
await this.modPage.wasRemoved(e.wbRedo);
await this.modPage.wasRemoved(e.wbToolbar, 'should not display the whiteboard toolbar for the moderator');
await this.modPage.wasRemoved(e.wbStyles, 'should not display the whiteboard styles menu');
await this.modPage.wasRemoved(e.wbUndo, 'should not display the whiteboard undo button');
await this.modPage.wasRemoved(e.wbRedo, 'should not display the whiteboard redo button');
}
async zoom() {
@ -431,29 +432,29 @@ class Presentation extends MultiUsers {
const wbBox = await this.modPage.getLocator(e.whiteboard);
const zoomOutButtonLocator = this.modPage.getLocator(e.zoomOutButton);
await expect(zoomOutButtonLocator).toBeDisabled();
await expect(zoomOutButtonLocator, 'should hte zoom out button be disabled').toBeDisabled();
const resetZoomButtonLocator = this.modPage.getLocator(e.resetZoomButton);
await expect(resetZoomButtonLocator).toContainText(defaultZoomLevel);
await expect(resetZoomButtonLocator, 'should the reset zoom button contain the default value text').toContainText(defaultZoomLevel);
//Zoom In 150%
await this.modPage.waitAndClick(e.zoomInButton);
await expect(zoomOutButtonLocator).toBeEnabled();
await expect(resetZoomButtonLocator).toContainText(/125%/);
await expect(zoomOutButtonLocator, 'should the zoom out butto to be enabled').toBeEnabled();
await expect(resetZoomButtonLocator, 'should the reset zoom button to contain the text 125%').toContainText(/125%/);
await this.modPage.waitAndClick(e.zoomInButton);
await expect(resetZoomButtonLocator).toContainText(/150%/);
await expect(resetZoomButtonLocator, 'should the reset zoom button to contain the text 150%').toContainText(/150%/);
await expect(wbBox).toHaveScreenshot('moderator1-zoom150.png');
//Zoom out 125%
await this.modPage.waitAndClick(e.zoomOutButton);
await expect(resetZoomButtonLocator).toContainText(/125%/);
await expect(resetZoomButtonLocator, 'should the reset zoom button to contain the text 125%').toContainText(/125%/);
await expect(wbBox).toHaveScreenshot('moderator1-zoom125.png');
//Reset Zoom 100%
await this.modPage.waitAndClick(e.zoomInButton);
await expect(resetZoomButtonLocator).toContainText(/150%/);
await expect(resetZoomButtonLocator, 'should the reset zoom button to contain the text 150%').toContainText(/150%/);
await this.modPage.waitAndClick(e.resetZoomButton);
await expect(resetZoomButtonLocator).toContainText(/100%/);
await expect(zoomOutButtonLocator).toBeDisabled();
await expect(resetZoomButtonLocator, 'should the reset zoom button to contain the text 100%').toContainText(/100%/);
await expect(zoomOutButtonLocator, 'should the zoom out button to be disabled').toBeDisabled();
await expect(wbBox).toHaveScreenshot('moderator1-zoom100.png');
}

View File

@ -30,13 +30,13 @@ async function uploadSinglePresentation(test, fileName, uploadTimeout = UPLOAD_P
[e.currentSlideImg]);
await test.waitAndClick(e.actions);
await test.waitAndClick(e.managePresentations);
await test.waitForSelector(e.presentationFileUpload);
await test.hasElement(e.presentationFileUpload, 'should display the presentation space for uploading a new file, when the manage presentations is opened');
await test.page.setInputFiles(e.presentationFileUpload, path.join(__dirname, `../core/media/${fileName}`));
await test.hasText('body', e.statingUploadPresentationToast);
await test.hasText('body', e.statingUploadPresentationToast, 'should display the toast message uploading the presentation');
await test.waitAndClick(e.confirmManagePresentation);
await test.hasElement(e.presentationUploadProgressToast, ELEMENT_WAIT_EXTRA_LONG_TIME);
await test.hasElement(e.presentationUploadProgressToast, 'should display the toast presentation upload progress after confiming the presentation to be uploaded', ELEMENT_WAIT_EXTRA_LONG_TIME);
await test.page.waitForFunction(([selector, firstSlideSrc]) => {
const currentSrc = document.querySelector(selector)
?.style?.backgroundImage?.split('"')[1];
@ -49,14 +49,14 @@ async function uploadSinglePresentation(test, fileName, uploadTimeout = UPLOAD_P
async function uploadMultiplePresentations(test, fileNames, uploadTimeout = ELEMENT_WAIT_EXTRA_LONG_TIME) {
await test.waitAndClick(e.actions);
await test.waitAndClick(e.managePresentations);
await test.waitForSelector(e.presentationFileUpload);
await test.hasElement(e.presentationFileUpload, 'should display the modal for uploading a new presentation after opening the manage presentations');
await test.page.setInputFiles(e.presentationFileUpload, fileNames.map((fileName) => path.join(__dirname, `../core/media/${fileName}`)));
await test.hasText('body', e.statingUploadPresentationToast);
await test.hasText('body', e.statingUploadPresentationToast, 'should display the toast of a presentation to be uploaded after selecting the files to upload');
await test.waitAndClick(e.confirmManagePresentation);
await test.hasText(e.presentationStatusInfo, [e.convertingPresentationFileToast], uploadTimeout);
await test.hasText(e.smallToastMsg, e.presentationUploadedToast, uploadTimeout);
await test.hasText(e.presentationStatusInfo, [e.convertingPresentationFileToast], 'should display the presentation status info after confimation to upload the new file', uploadTimeout);
await test.hasText(e.smallToastMsg, e.presentationUploadedToast, 'should display the toast notification saying that the presentation is uploaded', uploadTimeout);
}
async function skipSlide(page) {

View File

@ -14,15 +14,15 @@ class ScreenShare extends Page {
const { screensharingEnabled } = getSettings();
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo);
return this.wasRemoved(e.startScreenSharing);
await this.hasElement(e.joinVideo, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
await startScreenshare(this);
await this.hasElement(e.isSharingScreen);
await this.hasElement(e.isSharingScreen, 'should display the screenshare element');
}
async testMobileDevice() {
await this.wasRemoved(e.startScreenSharing);
await this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
async screenshareStopsExternalVideo() {
@ -31,8 +31,8 @@ class ScreenShare extends Page {
await this.waitForSelector(e.whiteboard);
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo);
return this.wasRemoved(e.startScreenSharing);
await this.hasElement(e.joinVideo, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the screenshare button');
}
await this.waitAndClick(e.actions);
@ -42,14 +42,14 @@ class ScreenShare extends Page {
await this.waitAndClick(e.startShareVideoBtn);
const modFrame = await this.getYoutubeFrame();
await modFrame.hasElement('video');
await modFrame.hasElement('video', 'should display the video frame');
await startScreenshare(this);
await this.hasElement(e.isSharingScreen);
await this.hasElement(e.isSharingScreen, 'should display the screenshare element');
await this.hasElement(e.stopScreenSharing);
await this.hasElement(e.stopScreenSharing, 'should display the stop screenshare button');
await this.waitAndClick(e.stopScreenSharing);
await this.hasElement(e.whiteboard);
await this.hasElement(e.whiteboard, 'should display the whiteboard');
}
}
@ -62,11 +62,11 @@ class MultiUserScreenShare extends MultiUsers {
const { screensharingEnabled } = getSettings();
if(!screensharingEnabled) {
await this.hasElement(e.joinVideo);
return this.wasRemoved(e.startScreenSharing);
await this.hasElement(e.joinVideo, 'should display the join video button');
return this.wasRemoved(e.startScreenSharing, 'should not display the start screenshare button');
}
await startScreenshare(page);
await page.hasElement(e.isSharingScreen);
await page.hasElement(e.isSharingScreen, 'should display the screenshare element');
}
}

View File

@ -18,29 +18,29 @@ class SharedNotes extends MultiUsers {
async openSharedNotes() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const sharedNotesContent = await getNotesLocator(this.modPage);
await expect(sharedNotesContent).toBeEditable({ timeout: ELEMENT_WAIT_TIME });
await expect(sharedNotesContent, 'should the shared notes be editable').toBeEditable({ timeout: ELEMENT_WAIT_TIME });
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes label');
}
async typeInSharedNotes() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type(e.message);
await this.editMessage(notesLocator);
const editedMessage = '!Hello';
await expect(notesLocator).toContainText(editedMessage, { timeout: ELEMENT_WAIT_TIME });
await expect(notesLocator, 'should contain the edited text on shared notes').toContainText(editedMessage, { timeout: ELEMENT_WAIT_TIME });
//! avoiding the following screenshot comparison due to https://github.com/microsoft/playwright/issues/18827
// const wbBox = await this.modPage.getLocator(e.etherpadFrame);
@ -53,47 +53,47 @@ class SharedNotes extends MultiUsers {
await notesLocator.press('Control+Z');
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes label');
}
async formatTextInSharedNotes() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type(e.message);
await notesLocator.press('Control+Z');
await expect(notesLocator).toContainText('');
await expect(notesLocator, 'should not contain any text on the shared notes').toContainText('');
await notesLocator.press('Control+Y');
await expect(notesLocator).toContainText(e.message);
await expect(notesLocator, 'should contain a message on the shared notes').toContainText(e.message);
await this.formatMessage(notesLocator);
const html = await notesLocator.innerHTML();
const uText = '<u>!</u>';
await expect(html.includes(uText)).toBeTruthy();
await expect(html.includes(uText), 'should include the text "!"').toBeTruthy();
const bText = '<b>World</b>';
await expect(html.includes(bText)).toBeTruthy();
await expect(html.includes(bText), 'should include the text "World"').toBeTruthy();
const iText = '<i>Hello</i>'
await expect(html.includes(iText)).toBeTruthy();
await expect(html.includes(iText), 'should include the text "Hello"').toBeTruthy();
await notesLocator.press('Control+Z'); await notesLocator.press('Control+Z'); await notesLocator.press('Control+Z');
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes label');
}
async exportSharedNotes(testInfo) {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
@ -112,30 +112,30 @@ class SharedNotes extends MultiUsers {
//.txt checks
const txt = await this.modPage.handleDownload(exportPlainTextLocator, testInfo);
const txtFileExtension = (txt.download._suggestedFilename).split('.').pop();
await checkTextContent(txtFileExtension, 'txt');
await checkTextContent(txt.content, e.message);
await checkTextContent(txtFileExtension, 'txt', 'should match the .txt file extension');
await checkTextContent(txt.content, e.message, 'should the txt content file have the message "Hello World!"');
//.html checks
const html = await this.modPage.handleDownload(exportHtmlLocator, testInfo);
const htmlFileExtension = (html.download._suggestedFilename).split('.').pop();
await checkTextContent(htmlFileExtension, 'html');
await checkTextContent(html.content, e.message);
await checkTextContent(htmlFileExtension, 'html', 'should match the html file extension');
await checkTextContent(html.content, e.message, 'should the html content file have the message "Hello World!"');
//.etherpad checks
const etherpad = await this.modPage.handleDownload(exportEtherpadLocator, testInfo);
const etherpadFileExtension = (etherpad.download._suggestedFilename).split('.').pop();
await checkTextContent(etherpadFileExtension, 'etherpad');
await checkTextContent(etherpad.content, e.message);
await checkTextContent(etherpadFileExtension, 'etherpad', 'should match the etherpad file extension');
await checkTextContent(etherpad.content, e.message, 'should the etherpad content file have the message "Hello World!"');
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes label');
}
async convertNotesToWhiteboard() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
@ -145,21 +145,21 @@ class SharedNotes extends MultiUsers {
await this.modPage.waitAndClick(e.notesOptions);
await this.modPage.waitAndClick(e.sendNotesToWhiteboard);
await this.modPage.hasText(e.currentSlideText, /test/, 30000);
await this.userPage.hasText(e.currentSlideText, /test/, 20000);
await this.modPage.hasText(e.currentSlideText, /test/, 'should the slide contain the text "test" for the moderator', 30000);
await this.userPage.hasText(e.currentSlideText, /test/, 'should the slide contain the text "test" for the attendee', 20000);
await notesLocator.press('Control+Z');
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes label button');
}
async editSharedNotesWithMoreThanOneUSer() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
@ -170,19 +170,19 @@ class SharedNotes extends MultiUsers {
await notesLocatorUser.press('Delete');
await notesLocatorUser.type('J');
await expect(notesLocator).toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await expect(notesLocatorUser).toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await expect(notesLocator, 'should the shared notes contain the text "Jello" for the moderator').toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await expect(notesLocatorUser, 'should the shared notes contain the text "Jello" for the attendee').toContainText(/Jello/, { timeout: ELEMENT_WAIT_TIME });
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes button for the moderator');
await this.userPage.waitAndClick(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes button for the attendee');
}
async seeNotesWithoutEditPermission() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await startSharedNotes(this.modPage);
@ -197,7 +197,7 @@ class SharedNotes extends MultiUsers {
await this.modPage.waitAndClick(e.applyLockSettings);
const notesLocatorUser = getSharedNotesUserWithoutPermission(this.userPage);
await expect(notesLocatorUser).toContainText(/Hello/, { timeout: 20000 });
await expect(notesLocatorUser, 'should the shared notes contain the text "Hello" for the attendee').toContainText(/Hello/, { timeout: 20000 });
await this.userPage.wasRemoved(e.etherpadFrame);
await this.modPage.waitAndClick(e.manageUsers);
@ -206,47 +206,47 @@ class SharedNotes extends MultiUsers {
await this.modPage.waitAndClick(e.applyLockSettings);
await this.modPage.waitAndClick(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel);
await this.modPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes button for the moderator');
await this.userPage.waitAndClick(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel);
await this.userPage.wasRemoved(e.hideNotesLabel, 'should not display the hide notes button for the attendee');
}
async pinAndUnpinNotesOntoWhiteboard() {
const { sharedNotesEnabled } = getSettings();
if(!sharedNotesEnabled) {
await this.modPage.hasElement(e.chatButton);
return this.modPage.wasRemoved(e.sharedNotes);
await this.modPage.hasElement(e.chatButton, 'should display the public chat button');
return this.modPage.wasRemoved(e.sharedNotes, 'should not display the shared notes button');
}
await this.userPage.waitAndClick(e.minimizePresentation);
await this.userPage.hasElement(e.restorePresentation);
await this.userPage.hasElement(e.restorePresentation, 'should display the restore presentation button for the attendee');
await startSharedNotes(this.modPage);
const notesLocator = getNotesLocator(this.modPage);
await notesLocator.type('Hello');
await this.modPage.waitAndClick(e.notesOptions);
await this.modPage.waitAndClick(e.pinNotes);
await this.modPage.hasElement(e.unpinNotes);
await this.modPage.hasElement(e.unpinNotes, 'should display the unpin notes button');
await this.userPage.hasElement(e.minimizePresentation);
await this.userPage.hasElement(e.minimizePresentation, 'should display the minimize presentation button for the attendee');
const notesLocatorUser = getNotesLocator(this.userPage);
await expect(notesLocator).toContainText(/Hello/, { timeout: 20000 });
await expect(notesLocatorUser).toContainText(/Hello/);
await expect(notesLocator, 'should display the text "Hello" on the shared notes for the moderator').toContainText(/Hello/, { timeout: 20000 });
await expect(notesLocatorUser, 'should display the text "Hello" on the shared notes for the attendee').toContainText(/Hello/);
// unpin notes
await this.modPage.waitAndClick(e.unpinNotes);
await this.modPage.hasElement(e.whiteboard);
await this.userPage.hasElement(e.whiteboard);
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
await this.userPage.hasElement(e.whiteboard, 'should display the whiteboard for the attendee');
await startSharedNotes(this.modPage);
await this.modPage.waitAndClick(e.notesOptions);
await this.modPage.waitAndClick(e.pinNotes);
await this.modPage.hasElement(e.unpinNotes);
await this.modPage.hasElement(e.unpinNotes, 'should display the unpin notes button for the moderator');
// make viewer as presenter and unpin pinned notes
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.makePresenter);
await this.userPage.waitAndClick(e.unpinNotes);
await this.userPage.hasElement(e.whiteboard);
await this.modPage.hasElement(e.whiteboard);
await this.userPage.hasElement(e.whiteboard, 'should display the whiteboard for the attendee');
await this.modPage.hasElement(e.whiteboard, 'should display the whiteboard for the moderator');
}
async editMessage() {

View File

@ -13,26 +13,26 @@ class GuestPolicy extends MultiUsers {
await setGuestPolicyOption(this.modPage, e.askModerator);
await sleep(500);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.modPage.hasElement(e.waitingUsersBtn);
await this.modPage.hasElement(e.waitingUsersBtn, 'should display the waiting users button');
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.type(e.waitingUsersLobbyMessage, 'test');
await this.modPage.waitAndClick(e.sendLobbyMessage);
await this.modPage.hasText(e.lobbyMessage, /test/);
await this.modPage.hasText(e.lobbyMessage, /test/, 'should the lobby message contain the text "test"');
}
async allowEveryone() {
await setGuestPolicyOption(this.modPage, e.askModerator);
await sleep(500);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.userPage.hasText(e.guestMessage, /wait/);
await this.userPage.hasText(e.positionInWaitingQueue, /first/);
await this.userPage.hasText(e.guestMessage, /wait/, 'should the guest message contain the text "wait" for the attendee');
await this.userPage.hasText(e.positionInWaitingQueue, /first/, 'should the position in waiting queue contain the text "first" for the attendee');
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.waitAndClick(e.allowEveryone);
await this.userPage.hasText(e.guestMessage, /approved/, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.viewerAvatar, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.audioModal);
await this.userPage.hasText(e.guestMessage, /approved/, 'should the guest message contain the text "approved" for the attendee', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.viewerAvatar, 'should display the viewer avatar for the moderator', ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.audioModal, 'should display the audio modal for the attendee');
}
@ -43,7 +43,7 @@ class GuestPolicy extends MultiUsers {
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.waitAndClick(e.denyEveryone);
await this.userPage.hasText(e.guestMessage, /denied/, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasText(e.guestMessage, /denied/, 'should the guest message contain the text "denied" for the attendee',ELEMENT_WAIT_LONGER_TIME);
}
async rememberChoice() {
@ -52,11 +52,11 @@ class GuestPolicy extends MultiUsers {
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.waitAndClick(e.rememberCheckboxId);
await this.modPage.hasElementEnabled(e.rememberCheckboxId);
await this.modPage.hasElementEnabled(e.rememberCheckboxId, 'should display the remember checkbox id as enabled');
await this.modPage.waitAndClick(e.denyEveryone);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.userPage.hasElement(e.deniedMessageElement);
await this.userPage.hasElement(e.deniedMessageElement, 'should display the denied message for the attendee');
}
async messageToSpecificUser() {
@ -68,21 +68,21 @@ class GuestPolicy extends MultiUsers {
await this.modPage.waitAndClick(e.privateMessageGuest);
await this.modPage.type(e.inputPrivateLobbyMesssage, 'test');
await this.modPage.waitAndClick(e.sendPrivateLobbyMessage);
await this.userPage.hasText(e.guestMessage, /test/, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasText(e.guestMessage, /test/, 'should the guest message contain the text "test" for the attendee', ELEMENT_WAIT_LONGER_TIME);
}
async acceptSpecificUser() {
await setGuestPolicyOption(this.modPage, e.askModerator);
await sleep(500);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.userPage.hasText(e.guestMessage, /wait/);
await this.userPage.hasText(e.positionInWaitingQueue, /first/);
await this.userPage.hasText(e.guestMessage, /wait/, 'should the guest message contain the text "wait" for the attendee');
await this.userPage.hasText(e.positionInWaitingQueue, /first/, 'should the position in waiting queue contain the text "first"');
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.waitAndClick(e.acceptGuest);
await this.userPage.hasText(e.guestMessage, /approved/, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasText(e.guestMessage, /approved/, 'should the guest message contain the text "approved" for the attendee', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitForSelector(e.viewerAvatar, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.audioModal);
await this.userPage.hasElement(e.audioModal, 'should display the audio modal for the attendee');
}
async denySpecificUser() {
@ -92,7 +92,7 @@ class GuestPolicy extends MultiUsers {
await this.modPage.waitAndClick(e.waitingUsersBtn);
await this.modPage.waitAndClick(e.denyGuest);
await this.userPage.hasText(e.guestMessage, /denied/, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasText(e.guestMessage, /denied/, 'should the guest message contain the text "denied" for the attendee', ELEMENT_WAIT_LONGER_TIME);
}
async alwaysAccept() {
@ -100,14 +100,14 @@ class GuestPolicy extends MultiUsers {
await setGuestPolicyOption(this.modPage, e.alwaysAccept);
await sleep(500);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.userPage.hasElement(e.audioModal);
await this.userPage.hasElement(e.audioModal, 'should display the audio modal for the attendee');
}
async alwaysDeny() {
await setGuestPolicyOption(this.modPage, e.alwaysDeny);
await sleep(1500);
await this.initUserPage(false, this.context, { shouldCheckAllInitialSteps: false });
await this.userPage.hasElement(e.deniedMessageElement);
await this.userPage.hasElement(e.deniedMessageElement, 'should display the denied message for the attendee');
}
}

View File

@ -14,26 +14,26 @@ class LockViewers extends MultiUsers {
async lockShareWebcam() {
await this.modPage.shareWebcam();
await this.modPage.hasElement(e.webcamVideoItem);
await this.userPage.hasElement(e.webcamVideoItem);
await this.modPage.hasElement(e.webcamVideoItem, 'should display the webcam video item for the moderator');
await this.userPage.hasElement(e.webcamVideoItem, 'should display the webcam video item for the attendee');
await this.userPage.shareWebcam();
await this.modPage.hasNElements(e.webcamVideoItem, 2);
await this.userPage.hasNElements(e.webcamVideoItem, 2);
await this.modPage.hasNElements(e.webcamVideoItem, 2, 'should display two webcam video item for the moderator');
await this.userPage.hasNElements(e.webcamVideoItem, 2, 'should display two webcam video item for the attendee');
await openLockViewers(this.modPage);
await this.modPage.waitAndClickElement(e.lockShareWebcam);
await this.modPage.waitAndClick(e.applyLockSettings);
await waitAndClearNotification(this.modPage);
await this.userPage.checkElementCount(e.webcamContainer, 1);
await this.userPage.checkElementCount(e.webcamContainer, 1, 'should display one webcam container for the attendee');
await this.initUserPage2(true);
await this.userPage2.hasElementDisabled(e.joinVideo);
await this.userPage2.hasElementDisabled(e.joinVideo, 'should the join video button to be disabled for the second attendee');
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
await this.userPage2.waitAndClick(e.joinVideo);
await this.userPage2.waitAndClick(e.startSharingWebcam);
await this.modPage.checkElementCount(e.webcamContainer, 2);
await this.userPage.hasElementDisabled(e.joinVideo);
await this.modPage.checkElementCount(e.webcamContainer, 2, 'should display two webcams container for the moderator');
await this.userPage.hasElementDisabled(e.joinVideo, 'should the join video button to be disabled');
}
async lockSeeOtherViewersWebcams() {
@ -48,7 +48,7 @@ class LockViewers extends MultiUsers {
await this.modPage.getSelectorCount(e.webcamVideoItem),
await this.userPage.getSelectorCount(e.webcamVideoItem),
];
await expect(videoContainersCount).toStrictEqual([2, 2]);
await expect(videoContainersCount, 'should the videos containter count to be stricted equal to 2 for the moderator and the attendee').toStrictEqual([2, 2]);
await this.initUserPage2(true);
@ -57,9 +57,9 @@ class LockViewers extends MultiUsers {
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
await this.modPage.checkElementCount(e.webcamContainer, 3);
await this.userPage.checkElementCount(e.webcamContainer, 2);
await this.userPage2.checkElementCount(e.webcamContainer, 3);
await this.modPage.checkElementCount(e.webcamContainer, 3, 'should display three webcams container for the moderator');
await this.userPage.checkElementCount(e.webcamContainer, 2, 'should display two webcams container for the first attendee');
await this.userPage2.checkElementCount(e.webcamContainer, 3, 'should display three webcam container for the second attendee');
}
async lockShareMicrophone() {
@ -68,10 +68,10 @@ class LockViewers extends MultiUsers {
await openLockViewers(this.modPage);
await this.modPage.waitAndClickElement(e.lockShareMicrophone);
await this.modPage.waitAndClick(e.applyLockSettings);
await this.userPage.wasRemoved(e.isTalking);
await this.userPage.wasRemoved(e.isTalking, 'should not display the is talking element for the first attendee');
await this.userPage.waitForSelector(e.unmuteMicButton);
await this.initUserPage2(false);
await this.userPage2.hasElement(e.leaveListenOnly, ELEMENT_WAIT_LONGER_TIME);
await this.userPage2.hasElement(e.leaveListenOnly, 'should display the leave listen only button for the second attendee', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
@ -79,28 +79,28 @@ class LockViewers extends MultiUsers {
await this.userPage2.waitAndClick(e.leaveListenOnly);
await this.userPage2.waitAndClick(e.joinAudio);
await this.userPage2.joinMicrophone();
await this.userPage2.hasElement(e.isTalking);
await this.userPage2.hasElement(e.isTalking, 'should display the is talking element for the second attendee');
}
async lockSendPublicChatMessages() {
await openLockViewers(this.modPage);
await this.modPage.waitAndClickElement(e.lockPublicChat);
await this.modPage.waitAndClick(e.applyLockSettings);
await this.userPage.hasElementDisabled(e.chatBox);
await this.userPage.hasElementDisabled(e.sendButton);
await this.userPage.hasElementDisabled(e.chatBox, 'should have the public chat disabled for the first attendee');
await this.userPage.hasElementDisabled(e.sendButton, 'should have the send button on the public chat disabled for the first attendee');
await this.initUserPage2(true);
await this.userPage2.hasElementDisabled(e.chatBox);
await this.userPage2.hasElementDisabled(e.sendButton);
await this.userPage2.hasElementDisabled(e.chatBox, 'should have the public chat disabled for the second attendee');
await this.userPage2.hasElementDisabled(e.sendButton, 'should have the send button on the public chat disabled for the second attendee');
await this.modPage.type(e.chatBox, e.message);
await this.modPage.waitAndClick(e.sendButton);
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
await this.userPage2.hasElementEnabled(e.chatBox, ELEMENT_WAIT_LONGER_TIME);
await this.userPage2.hasElementEnabled(e.chatBox, 'should have the public chat enabled for the second attendee', ELEMENT_WAIT_LONGER_TIME);
await this.userPage2.type(e.chatBox, e.message);
await this.modPage.hasElement(e.typingIndicator);
await this.modPage.hasElement(e.typingIndicator, 'should display the typing indicator element for the moderator');
await this.userPage2.waitAndClick(e.sendButton);
await this.userPage.waitForSelector(e.chatUserMessageText);
await this.userPage.checkElementCount(e.chatUserMessageText, 2);
await this.userPage.checkElementCount(e.chatUserMessageText, 2, 'should display two user messages on the public chat for the first attendee');
}
async lockSendPrivateChatMessages() {
@ -117,15 +117,15 @@ class LockViewers extends MultiUsers {
await this.userPage.getLocator(e.userListItem).filter({ hasText: this.userPage2.username }).click();
await this.userPage.waitAndClick(`${e.startPrivateChat} >> visible=true`);
await this.userPage.hasElementEnabled(e.chatBox);
await this.userPage.hasElementEnabled(e.sendButton);
await this.userPage.hasElementEnabled(e.chatBox, 'should have the private chat enabled for the first attendee');
await this.userPage.hasElementEnabled(e.sendButton, 'should have the send button on the private chat enabled for the first attendee');
await this.userPage.type(e.chatBox, 'Test');
await this.userPage.waitAndClick(e.sendButton);
await this.userPage2.getLocator(e.chatButton).filter({ hasText: this.userPage.username }).click();
await this.userPage2.waitForSelector(e.closePrivateChat);
await this.userPage2.hasElementDisabled(e.chatBox);
await this.userPage2.hasElementDisabled(e.sendButton);
await this.userPage2.hasElementDisabled(e.chatBox, 'should have the private chat disabled for the second attendee');
await this.userPage2.hasElementDisabled(e.sendButton, 'should have the send button on the private chat disabled for the second attendee');
}
async lockEditSharedNotes() {
@ -133,7 +133,7 @@ class LockViewers extends MultiUsers {
await this.userPage.waitForSelector(e.hideNotesLabel);
const sharedNotesLocator = getNotesLocator(this.userPage);
await sharedNotesLocator.type(e.message, { timeout: ELEMENT_WAIT_LONGER_TIME });
await expect(sharedNotesLocator).toContainText(e.message, { timeout: ELEMENT_WAIT_TIME });
await expect(sharedNotesLocator, 'should the shared notes contain the text "Hello World!" for the first attende').toContainText(e.message, { timeout: ELEMENT_WAIT_TIME });
await openLockViewers(this.modPage);
await this.modPage.waitAndClickElement(e.lockEditSharedNotes);
@ -141,10 +141,10 @@ class LockViewers extends MultiUsers {
await this.initUserPage2(true);
await this.userPage2.waitAndClick(e.sharedNotes);
await this.userPage2.wasRemoved(e.etherpadFrame);
await this.userPage2.wasRemoved(e.etherpadFrame, 'should not display the etherpad frame for the second attendee');
await this.userPage.waitAndClick(e.sharedNotes);
await this.userPage.wasRemoved(e.etherpadFrame);
await this.userPage.wasRemoved(e.etherpadFrame, 'should not display the etherpad frame for the first attendee');
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
@ -155,13 +155,13 @@ class LockViewers extends MultiUsers {
await this.modPage.waitAndClickElement(e.lockUserList);
await this.modPage.waitAndClick(e.applyLockSettings);
await this.initUserPage2(true);
await this.userPage2.checkElementCount(e.userListItem, 1);
await this.userPage2.checkElementCount(e.userListItem, 1, 'should contain one user on the user list for the second attendee');
await sleep(1000);
await expect(await this.userPage.getLocator(e.userListItem).count()).toBe(1);
await expect(await this.userPage.getLocator(e.userListItem).count(), 'should contain one user on the user list for the first attendee').toBe(1);
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
await this.userPage2.checkElementCount(e.userListItem, 2);
await this.userPage2.checkElementCount(e.userListItem, 2, 'should contain two users on the user list for the second attendee');
}
async lockSeeOtherViewersAnnotations() {
@ -200,16 +200,16 @@ class LockViewers extends MultiUsers {
await this.modPage.waitAndClickElement(e.hideViewersCursor);
await this.modPage.waitAndClick(e.applyLockSettings);
await this.modPage.checkElementCount(e.whiteboardCursorIndicator, 1);
await this.modPage.checkElementCount(e.whiteboardCursorIndicator, 1, 'should contain one whiteboard cursor indicator for the moderator');
await this.initUserPage2(true);
await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 0);
await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 0, 'should contain zero whiteboard cursor indicator for the second attendee');
await this.modPage.waitAndClick(`${e.userListItem}>>nth=1`);
await this.modPage.waitAndClick(`${e.unlockUserButton}>>nth=1`);
await drawArrow(this.userPage);
await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 1);
await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 1, 'should contain one whiteboard cursor indicator for the second attendee');
}
}

View File

@ -9,7 +9,7 @@ class MobileDevices extends MultiUsers {
async mobileTagName() {
await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.waitForSelector(e.currentUser);
await this.modPage.hasElement(e.mobileUser);
await this.modPage.hasElement(e.mobileUser, 'should display the mobile user element for the moderator ');
}
async whiteboardNotAppearOnMobile() {
@ -17,20 +17,20 @@ class MobileDevices extends MultiUsers {
await this.modPage.waitAndClick(e.userListButton);
await this.userPage.waitAndClick(e.userListButton);
await this.userPage.waitAndClick(e.chatButtonKey);
await this.modPage.wasRemoved(e.whiteboard);
await this.userPage.wasRemoved(e.whiteboard);
await this.modPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the moderator');
await this.userPage.wasRemoved(e.whiteboard, 'should not display the whiteboard for the attendeee');
}
async userListNotAppearOnMobile() {
await this.modPage.wasRemoved(e.userListItem);
await this.userPage.wasRemoved(e.userListItem);
await this.modPage.wasRemoved(e.userListItem, 'should not display the user list for the moderator');
await this.userPage.wasRemoved(e.userListItem, 'should not display the user list for the attendee');
}
async chatPanelNotAppearOnMobile() {
await this.modPage.wasRemoved(e.chatButtonKey);
await this.modPage.wasRemoved(e.chatButtonKey, 'should not display the chat button key for the moderator');
await this.userPage.waitAndClick(e.userListButton);
await this.userPage.waitAndClick(e.chatButtonKey);
await this.userPage.hasElement(e.chatButtonKey);
await this.userPage.hasElement(e.chatButtonKey, 'should display the chat button key for the attendee');
}
}

View File

@ -82,67 +82,67 @@ class MultiUsers {
}
async userPresence() {
await this.modPage.checkElementCount(e.currentUser, 1);
await this.modPage.checkElementCount(e.userListItem, 1);
await this.userPage.checkElementCount(e.currentUser, 1);
await this.userPage.checkElementCount(e.userListItem, 1);
await this.modPage.checkElementCount(e.currentUser, 1, 'should contain one current user for the moderator');
await this.modPage.checkElementCount(e.userListItem, 1, 'should contain one user on user list for the moderator');
await this.userPage.checkElementCount(e.currentUser, 1, 'should contain one current user for the attendee');
await this.userPage.checkElementCount(e.userListItem, 1, 'should contain one user on user list for the attendee');
}
async makePresenter() {
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.makePresenter);
await this.modPage.wasRemoved(e.wbToolbar);
await this.modPage.wasRemoved(e.wbToolbar, 'should not display the whiteboard toolbar for the moderator');
await this.userPage.hasElement(e.startScreenSharing);
await this.userPage.hasElement(e.presentationToolbarWrapper);
await this.userPage.hasElement(e.wbToolbar);
await this.userPage.hasElement(e.actions);
await this.userPage.hasElement(e.userListItem);
await this.userPage.hasElement(e.startScreenSharing, 'should display the start screenshare button for the attendee');
await this.userPage.hasElement(e.presentationToolbarWrapper, 'should display the presentation toolbar for the attendee');
await this.userPage.hasElement(e.wbToolbar, 'should display the whiteboard toolbar for the attendee');
await this.userPage.hasElement(e.actions, 'should display the actions button for the attendee');
await this.userPage.hasElement(e.userListItem, 'should display the user list item for the attendee');
const isPresenter = await checkIsPresenter(this.userPage);
await expect(isPresenter).toBeTruthy();
await expect(isPresenter, 'should the attende be presenter').toBeTruthy();
}
async takePresenter() {
await this.modPage2.waitAndClick(e.currentUser);
await this.modPage2.waitAndClick(e.takePresenter);
await this.modPage.wasRemoved(e.wbToolbar);
await this.modPage.wasRemoved(e.wbToolbar, 'should not display the whiteboard toolbar for the moderator');
await this.modPage2.hasElement(e.startScreenSharing);
await this.modPage2.hasElement(e.wbToolbar);
await this.modPage2.hasElement(e.presentationToolbarWrapper);
await this.modPage2.hasElement(e.userListItem);
await this.modPage2.hasElement(e.startScreenSharing, 'should display the start screenshare button for the second moderator');
await this.modPage2.hasElement(e.wbToolbar, 'should display the whiteboard toolbar for the second moderator');
await this.modPage2.hasElement(e.presentationToolbarWrapper, 'should presentation toolbar for the second moderator');
await this.modPage2.hasElement(e.userListItem, 'should display the user list item for the second moderator');
const isPresenter = await checkIsPresenter(this.modPage2);
await expect(isPresenter).toBeTruthy();
await expect(isPresenter, 'should the second moderator to be presenter').toBeTruthy();
await this.modPage2.waitAndClick(e.actions);
await this.modPage2.hasElement(e.managePresentations);
await this.modPage2.hasElement(e.polling);
await this.modPage2.hasElement(e.shareExternalVideoBtn);
await this.modPage2.hasElement(e.managePresentations, 'should display the manage presentations for the second moderator');
await this.modPage2.hasElement(e.polling, 'should display the polling option for the second moderator');
await this.modPage2.hasElement(e.shareExternalVideoBtn, 'should display the share external video button for the second moderator');
}
async promoteToModerator() {
await checkAvatarIcon(this.userPage, false);
await this.userPage.wasRemoved(e.manageUsers);
await this.userPage.wasRemoved(e.manageUsers, 'should not display the manage users for the attendee');
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.promoteToModerator);
await checkAvatarIcon(this.userPage);
await this.userPage.hasElement(e.manageUsers);
await this.userPage.hasElement(e.manageUsers, 'should display the manage users for the attendee');
}
async demoteToViewer() {
await checkAvatarIcon(this.modPage2);
await this.modPage2.hasElement(e.manageUsers);
await this.modPage2.hasElement(e.manageUsers, 'should display the manage users for the second moderator');
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.demoteToViewer);
await checkAvatarIcon(this.modPage2, false);
await this.modPage2.wasRemoved(e.manageUsers);
await this.modPage2.wasRemoved(e.manageUsers, 'should not display the manage users for the second moderator');
}
async raiseAndLowerHand() {
const { reactionsButton } = getSettings();
if (!reactionsButton) {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.joinAudio);
await this.modPage.wasRemoved(e.reactionsButton);
await this.modPage.hasElement(e.joinAudio, 'should display the join audio button for the moderator');
await this.modPage.wasRemoved(e.reactionsButton, 'should not display the reactions button for the moderator');
return;
}
@ -155,15 +155,15 @@ class MultiUsers {
await sleep(1000);
await this.userPage.waitAndClick(e.lowerHandBtn);
await this.userPage.waitAndClick(e.reactionsButton);
await this.userPage.hasElement(e.raiseHandBtn);
await this.userPage.hasElement(e.raiseHandBtn, 'should display the raise hand button for the attendee');
}
async raiseHandRejected() {
const { reactionsButton } = getSettings();
if (!reactionsButton) {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.hasElement(e.joinAudio);
await this.modPage.wasRemoved(e.reactionsButton);
await this.modPage.hasElement(e.joinAudio, 'should display the join audio button for the moderator');
await this.modPage.wasRemoved(e.reactionsButton, 'should not display the reactions button for the moderator');
return
}
@ -172,26 +172,26 @@ class MultiUsers {
await this.userPage.waitAndClick(e.reactionsButton);
await this.userPage.waitAndClick(e.raiseHandBtn);
await this.userPage.waitAndClick(e.reactionsButton);
await this.userPage.hasElement(e.lowerHandBtn);
await this.userPage.hasElement(e.lowerHandBtn, 'should display the lower hand button for the attendee');
await this.userPage.press('Escape');
await this.modPage.comparingSelectorsBackgroundColor(e.avatarsWrapperAvatar, `${e.userListItem} div:first-child`);
await this.modPage.waitAndClick(e.raiseHandRejection);
await this.userPage.waitAndClick(e.reactionsButton);
await this.userPage.hasElement(e.raiseHandBtn);
await this.userPage.hasElement(e.raiseHandBtn, 'should display the raise hand button for the attendee');
}
async toggleUserList() {
await this.modPage.hasElement(e.chatWelcomeMessageText);
await this.modPage.hasElement(e.chatBox);
await this.modPage.hasElement(e.chatButton);
await this.modPage.hasElement(e.chatWelcomeMessageText, 'should display the public chat welcome message for the moderator ');
await this.modPage.hasElement(e.chatBox, 'should display the public chat box for the moderator');
await this.modPage.hasElement(e.chatButton, 'should display the public chat button for the moderator');
await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.wasRemoved(e.chatWelcomeMessageText);
await this.modPage.wasRemoved(e.chatBox);
await this.modPage.wasRemoved(e.chatButton);
await this.modPage.wasRemoved(e.chatWelcomeMessageText, 'should not display the chat welcome message for the moderator');
await this.modPage.wasRemoved(e.chatBox, 'should not display the public chat box for the moderator');
await this.modPage.wasRemoved(e.chatButton, 'should not display the public chat button for the moderator');
await this.modPage.waitAndClick(e.userListToggleBtn);
await this.modPage.wasRemoved(e.chatWelcomeMessageText);
await this.modPage.wasRemoved(e.chatBox);
await this.modPage.hasElement(e.chatButton);
await this.modPage.wasRemoved(e.chatWelcomeMessageText, 'should not display the chat welcome message for the moderator');
await this.modPage.wasRemoved(e.chatBox, 'should not display the public chat box for the moderator');
await this.modPage.hasElement(e.chatButton, 'should display the public chat button for the moderator');
}
async saveUserNames(testInfo) {
@ -204,7 +204,7 @@ class MultiUsers {
this.userPage.username,
this.modPage.meetingId,
];
await checkTextContent(content, dataToCheck);
await checkTextContent(content, dataToCheck, 'should the downloaded content match the user names');
}
async pinningWebcams() {
@ -219,18 +219,18 @@ class MultiUsers {
// Pin first webcam (Mod2)
await this.modPage.waitAndClick(`:nth-match(${e.dropdownWebcamButton}, 3)`);
await this.modPage.waitAndClick(`:nth-match(${e.pinWebcamBtn}, 2)`);
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username);
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username);
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username);
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username, 'should the first webcam display the second moderator username for the first moderator');
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username, 'should the first webcam display the second moderator username for the second moderator');
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username, 'should the first webcam display the second moderator username for the attendee');
// Pin second webcam (user)
await this.modPage.waitAndClick(`:nth-match(${e.dropdownWebcamButton}, 3)`);
await this.modPage.waitAndClick(`:nth-match(${e.pinWebcamBtn}, 3)`);
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.userPage.username);
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.modPage2.username);
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username);
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.userPage.username);
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.userPage.username);
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.modPage2.username);
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.userPage.username, 'should the first webcam display the attendee username for the first moderator');
await this.modPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.modPage2.username, 'should the second webcam display the second moderator username for the first moderator');
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.modPage2.username, 'should the first webcam display the second moderator username for the first attendee');
await this.userPage.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.userPage.username, 'should the second webcam display the attendee username for the attendee');
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 1)`, this.userPage.username, 'should the first webcam display the attendee username for the second moderator');
await this.modPage2.hasText(`:nth-match(${e.dropdownWebcamButton}, 2)`, this.modPage2.username, 'should the second webcam display the second moderator username for the second moderator');
}
async giveAndRemoveWhiteboardAccess() {
@ -262,7 +262,7 @@ class MultiUsers {
await this.modPage.waitAndClick(e.manageUsers);
await this.modPage.waitAndClick(e.muteAllExceptPresenter);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.isTalking, 'should display the is talking element for the moderator');
await checkMutedUsers(this.modPage2);
await checkMutedUsers(this.userPage);
}
@ -271,14 +271,14 @@ class MultiUsers {
await this.modPage.waitAndClick(e.userListItem);
await this.modPage.waitAndClick(e.removeUser);
await this.modPage.waitAndClick(e.removeUserConfirmationBtn);
await this.modPage.wasRemoved(e.userListItem);
await this.modPage.wasRemoved(e.userListItem, 'should not display a user on the user list for the moderator');
//Will be modified when the issue is fixed and accept just one of both screens
//https://github.com/bigbluebutton/bigbluebutton/issues/16463
try {
await this.modPage2.hasElement(e.errorScreenMessage);
await this.modPage2.hasElement(e.errorScreenMessage, 'should display the error screen message for the second moderator');
} catch (err) {
await this.modPage2.hasElement(e.meetingEndedModalTitle);
await this.modPage2.hasElement(e.meetingEndedModalTitle, 'should display the meeting ended modal for the second moderator');
}
}
@ -287,23 +287,23 @@ class MultiUsers {
await this.modPage.waitAndClick(e.removeUser);
await this.modPage.waitAndClick(e.confirmationCheckbox);
await this.modPage.waitAndClick(e.removeUserConfirmationBtn);
await this.modPage.wasRemoved(e.userListItem);
await this.modPage.wasRemoved(e.userListItem, 'should not display the user on the user list for the moderator');
// Will be modified when the issue is fixed and accept just one of both screens
// https://github.com/bigbluebutton/bigbluebutton/issues/16463
try {
await this.modPage2.hasElement(e.errorScreenMessage);
await this.modPage2.hasElement(e.errorScreenMessage, 'should display the error screen message for the second moderator');
} catch {
await this.modPage2.hasElement(e.meetingEndedModalTitle);
await this.modPage2.hasElement(e.meetingEndedModalTitle, 'should display the meeting ended modal for the second moderator');
}
await this.initModPage2(false, context, { meetingId: this.modPage.meetingId, joinParameter: 'userID=Moderator2', shouldCheckAllInitialSteps: false });
// Due to same reason above, sometimes it displays different messages
try {
await this.modPage2.hasText(e.userBannedMessage2, /banned/);
await this.modPage2.hasText(e.userBannedMessage2, /banned/, 'should display the banned message for the second moderator');
} catch {
await this.modPage2.hasText(e.userBannedMessage1, /removed/);
await this.modPage2.hasText(e.userBannedMessage1, /removed/, 'should display the removed message for the second moderator');
}
}
}

View File

@ -19,44 +19,44 @@ class Timer extends MultiUsers {
const initialValueStopWatch = await timeInSeconds(timerCurrentLocator);
const initialValueStopWatchIndicator = await timeInSeconds(timerIndicatorLocator);
await this.modPage.hasText(e.timerCurrent, /00:00/);
await this.modPage.hasText(e.timerCurrent, /00:00/, 'should the timer current contain the text "00:00"');
await this.modPage.waitAndClick(e.startStopTimer);
await sleep(5000);
const currentValueStopwatch = await timeInSeconds(timerCurrentLocator);
const currentValueStopwatchIndicator = await timeInSeconds(timerIndicatorLocator);
await expect(currentValueStopwatch).toBeGreaterThan(initialValueStopWatch);
await expect(currentValueStopwatchIndicator).toBeGreaterThan(initialValueStopWatchIndicator);
await expect(currentValueStopwatch, 'should the current value of the stopwatch to be greater than the initial value').toBeGreaterThan(initialValueStopWatch);
await expect(currentValueStopwatchIndicator, 'should the current value of the stopwatch indicator to be greater than the initial value on the stopwatch indicator').toBeGreaterThan(initialValueStopWatchIndicator);
await this.modPage.waitAndClick(e.startStopTimer);
await this.modPage.waitAndClick(e.resetTimerStopwatch);
await this.modPage.hasText(e.timerCurrent, /00:00/);
await this.modPage.hasText(e.timerIndicator, /00:00/);
await this.modPage.hasText(e.timerCurrent, /00:00/, 'should the timer current to contain the value "00:00"');
await this.modPage.hasText(e.timerIndicator, /00:00/, 'should the timer indicator to contain the value "00:00"');
await this.modPage.waitAndClick(e.timerButton);
await this.modPage.hasElement(e.timerContainer);
await this.modPage.hasElement(e.timerContainer, 'should display the timer container');
await this.modPage.getLocator(e.secondsInput).press('Backspace');
await this.modPage.type(e.secondsInput, '4');
await this.modPage.waitAndClick(e.startStopTimer);
await this.modPage.hasText(e.timerCurrent, /00:02/);
await this.modPage.hasText(e.timerIndicator, /00:02/);
await this.modPage.hasText(e.timerCurrent, /00:02/, 'should the timer current to contain the value "00:02"');
await this.modPage.hasText(e.timerIndicator, /00:02/, 'should the timer indicator to contain the value "00:02"');
// await this.modPage.getLocator(e.secondsInput).press('Backspace');
await this.modPage.type(e.secondsInput, '6');
await this.modPage.type(e.minutesInput, '2');
await this.modPage.hasText(e.timerCurrent, /02:44/);
await this.modPage.hasText(e.timerIndicator, /02:44/);
await this.modPage.hasText(e.timerCurrent, /02:44/, 'should the timer current to contain the value "02:44"');
await this.modPage.hasText(e.timerIndicator, /02:44/, 'should the timer indicator to contain the value "02:44"');
const timerInitialValue = await timeInSeconds(timerCurrentLocator);
await this.modPage.waitAndClick(e.startStopTimer);
await sleep(5000);
const timerCurrentValue = await timeInSeconds(timerCurrentLocator);
await expect(timerInitialValue).toBeGreaterThan(timerCurrentValue);
await expect(timerInitialValue, 'should the timer initial value to be greater than the timer current value').toBeGreaterThan(timerCurrentValue);
await this.modPage.waitAndClick(e.startStopTimer);
await this.modPage.waitAndClick(e.resetTimerStopwatch);
await this.modPage.hasText(e.timerCurrent, /00:06/);
await this.modPage.hasText(e.timerIndicator, /00:06/);
await this.modPage.hasText(e.timerCurrent, /00:06/, 'should the timer current to contain the value "00:06"');
await this.modPage.hasText(e.timerIndicator, /00:06/, 'should the timer indicator to contain the value "00:06"');
//Testing Timer Indicator
const initialValueIndicator = await timeInSeconds(timerIndicatorLocator);
@ -64,7 +64,7 @@ class Timer extends MultiUsers {
await sleep(5000);
const currentValueIndicator = await timeInSeconds(timerIndicatorLocator);
await expect(initialValueIndicator).toBeGreaterThan(currentValueIndicator);
await expect(initialValueIndicator, 'should the timer indicator initial value to be greater than the timer indicator current value').toBeGreaterThan(currentValueIndicator);
}
}

View File

@ -13,20 +13,20 @@ class Webcam extends Page {
async share() {
const { videoPreviewTimeout, skipVideoPreview, skipVideoPreviewOnFirstJoin } = this.settings;
await this.shareWebcam(!(skipVideoPreview || skipVideoPreviewOnFirstJoin), videoPreviewTimeout);
await this.hasElement('video');
await this.hasElement(e.videoDropdownMenu);
await this.hasElement('video', 'should display the element video');
await this.hasElement(e.videoDropdownMenu, 'should display the video dropdown menu');
await this.waitAndClick(e.leaveVideo);
await this.hasElement(e.joinVideo);
await this.wasRemoved('video');
await this.hasElement(e.joinVideo, 'should display the join video button');
await this.wasRemoved('video', 'should not display the video element');
}
async checksContent() {
const { videoPreviewTimeout, skipVideoPreview, skipVideoPreviewOnFirstJoin } = this.settings;
await this.shareWebcam(!(skipVideoPreview || skipVideoPreviewOnFirstJoin), videoPreviewTimeout);
await this.waitForSelector(e.webcamVideoItem);
await this.wasRemoved(e.webcamConnecting, ELEMENT_WAIT_LONGER_TIME);
await this.wasRemoved(e.webcamConnecting, 'should not display the webcam connecting element', ELEMENT_WAIT_LONGER_TIME);
const respUser = await webcamContentCheck(this);
await expect(respUser).toBeTruthy();
await expect(respUser, 'should display the user webcam').toBeTruthy();
}
async talkingIndicator() {
@ -34,7 +34,7 @@ class Webcam extends Page {
await this.waitForSelector(e.webcamContainer, VIDEO_LOADING_WAIT_TIME);
await this.waitForSelector(e.leaveVideo, VIDEO_LOADING_WAIT_TIME);
await this.waitForSelector(e.isTalking);
await this.hasElement(e.webcamItemTalkingUser);
await this.hasElement(e.webcamItemTalkingUser, 'should display the webcam item talking user');
}
async changeVideoQuality() {
@ -86,8 +86,8 @@ class Webcam extends Page {
await this.waitAndClick(e.webcamsFullscreenButton);
// get fullscreen webcam size
const { width, height } = await this.getLocator('video').boundingBox();
await expect(width + 1).toBe(windowWidth); // not sure why there is a difference of 1 pixel
await expect(height).toBe(windowHeight);
await expect(width + 1, 'should the width to be the same as window width').toBe(windowWidth); // not sure why there is a difference of 1 pixel
await expect(height, 'should the height to be the same as window height').toBe(windowHeight);
}
async disableSelfView() {
@ -129,7 +129,7 @@ class Webcam extends Page {
await this.waitAndClick(e.advancedVideoSettingsBtn);
await this.waitAndClick(e.backgroundSettingsTitle);
await this.waitAndClick(e.removeCustomBackground);
await this.wasRemoved(e.selectCustomBackground);
await this.wasRemoved(e.selectCustomBackground, 'should not display the select custom background');
}
async keepBackgroundWhenRejoin(context) {
@ -144,7 +144,7 @@ class Webcam extends Page {
await openedPage.init(true, true, { meetingId: this.meetingId });
await openedPage.waitAndClick(e.joinVideo);
await openedPage.waitAndClick(e.backgroundSettingsTitle);
await openedPage.hasElement(e.selectCustomBackground);
await openedPage.hasElement(e.selectCustomBackground, 'should display the select custom background');
}
async webcamLayoutStart() {