2023-04-27 02:53:52 +08:00
const { MultiUsers } = require ( "../user/multiusers" ) ;
2023-04-27 03:17:43 +08:00
const e = require ( '../core/elements' ) ;
const { reopenChatSidebar , checkScreenshots } = require ( './util' ) ;
2023-04-27 02:53:52 +08:00
class Layouts extends MultiUsers {
async focusOnPresentation ( ) {
await this . modPage . waitAndClick ( e . actions ) ;
2023-07-31 22:24:25 +08:00
await this . modPage . waitAndClick ( e . manageLayoutBtn ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . focusOnPresentation ) ;
2023-07-11 03:28:00 +08:00
await this . modPage . waitAndClick ( e . updateLayoutBtn ) ;
2024-05-13 21:35:24 +08:00
await this . modPage . closeAllToastNotifications ( ) ;
2023-04-28 01:21:33 +08:00
await this . modPage . wasRemoved ( e . toastContainer ) ;
2023-04-27 02:53:52 +08:00
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be the layout focus on presentation' , e . webcamContainer , 'focus-on-presentation' ) ;
2023-04-27 02:53:52 +08:00
}
2023-10-17 20:32:36 +08:00
async gridLayout ( ) {
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . actions ) ;
2023-07-31 22:24:25 +08:00
await this . modPage . waitAndClick ( e . manageLayoutBtn ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . focusOnVideo ) ;
2023-07-11 03:28:00 +08:00
await this . modPage . waitAndClick ( e . updateLayoutBtn ) ;
2024-05-13 21:35:24 +08:00
await this . modPage . closeAllToastNotifications ( ) ;
2023-04-28 01:21:33 +08:00
await this . modPage . wasRemoved ( e . toastContainer ) ;
2023-04-27 02:53:52 +08:00
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be the grid layout' , e . webcamContainer , 'grid-layout' ) ;
2023-04-27 02:53:52 +08:00
}
async smartLayout ( ) {
await this . modPage . waitAndClick ( e . actions ) ;
2023-07-31 22:24:25 +08:00
await this . modPage . waitAndClick ( e . manageLayoutBtn ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . smartLayout ) ;
2023-07-11 03:28:00 +08:00
await this . modPage . waitAndClick ( e . updateLayoutBtn ) ;
2024-05-13 21:35:24 +08:00
await this . modPage . closeAllToastNotifications ( ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . wasRemoved ( e . toastContainer ) ;
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should the cameras be above the presentation' , e . webcamContainer , 'smart-layout' , 1 ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . userListToggleBtn ) ;
2024-07-31 06:49:02 +08:00
await this . modPage . wasRemoved ( e . chatButton , '' ) ;
2023-04-27 02:53:52 +08:00
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should the cameras be on the side of presentation' , e . webcamContainer , 'smart-layout' , 2 ) ;
2023-04-27 02:53:52 +08:00
await reopenChatSidebar ( this . modPage ) ;
}
async customLayout ( ) {
await this . modPage . waitAndClick ( e . actions ) ;
2023-07-31 22:24:25 +08:00
await this . modPage . waitAndClick ( e . manageLayoutBtn ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . customLayout ) ;
2023-07-11 03:28:00 +08:00
await this . modPage . waitAndClick ( e . updateLayoutBtn ) ;
2024-05-13 21:35:24 +08:00
await this . modPage . closeAllToastNotifications ( ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . wasRemoved ( e . toastContainer ) ;
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be on custom layout' , 'video' , 'custom-layout' , 1 ) ;
2023-04-27 02:53:52 +08:00
// checking the default location being reset when dropping into a non-available location
await this . modPage . getLocator ( e . webcamContainer ) . first ( ) . hover ( { timeout : 5000 } ) ;
await this . modPage . page . mouse . down ( ) ;
await this . modPage . getLocator ( e . whiteboard ) . hover ( { timeout : 5000 } ) ;
// checking all dropAreas being displayed
await this . modPage . hasElement ( e . dropAreaBottom ) ;
await this . modPage . hasElement ( e . dropAreaLeft ) ;
await this . modPage . hasElement ( e . dropAreaRight ) ;
await this . modPage . hasElement ( e . dropAreaTop ) ;
await this . modPage . hasElement ( e . dropAreaSidebarBottom ) ;
await this . modPage . page . mouse . up ( ) ;
await this . modPage . dragAndDropWebcams ( e . dropAreaSidebarBottom ) ;
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be on custom layout' , 'video' , 'custom-layout' , 2 ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . dragAndDropWebcams ( e . dropAreaSidebarBottom ) ;
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be on custom layout' , 'video' , 'custom-layout' , 3 ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . userListToggleBtn ) ;
2024-07-31 06:49:02 +08:00
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' ) ;
2023-04-27 02:53:52 +08:00
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'should be on custom layout' , 'video' , 'custom-layout' , 4 ) ;
2023-04-27 02:53:52 +08:00
await reopenChatSidebar ( this . modPage ) ;
}
2023-07-11 03:28:00 +08:00
async updateEveryone ( ) {
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . actions ) ;
2023-07-31 22:24:25 +08:00
await this . modPage . waitAndClick ( e . manageLayoutBtn ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . customLayout ) ;
2023-07-11 03:28:00 +08:00
await this . modPage . waitAndClick ( e . updateEveryoneLayoutBtn ) ;
2024-05-13 21:35:24 +08:00
await this . modPage . closeAllToastNotifications ( ) ;
2023-04-28 01:21:33 +08:00
await this . modPage . wasRemoved ( e . toastContainer ) ;
2023-04-27 02:53:52 +08:00
// Presenter minimizes presentation
await this . modPage . waitAndClick ( e . minimizePresentation ) ;
2024-07-31 06:49:02 +08:00
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' ) ;
2023-04-27 02:53:52 +08:00
// Only the user restores presentation
await this . userPage . waitAndClick ( e . restorePresentation ) ;
2024-07-31 06:49:02 +08:00
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' ) ;
2023-04-27 02:53:52 +08:00
await this . modPage . waitAndClick ( e . restorePresentation ) ;
await this . modPage . dragAndDropWebcams ( e . dropAreaSidebarBottom ) ;
2024-07-31 06:49:02 +08:00
await checkScreenshots ( this , 'layout should be updated for everyone' , 'video' , 'update-everyone' ) ;
2023-04-27 02:53:52 +08:00
}
}
exports . Layouts = Layouts ;