@@ -5,7 +5,7 @@ import { ELEMENT_WAIT_LONGER_TIME, ELEMENT_WAIT_TIME } from '../core/constants';
55import { elements as e } from '../core/elements' ;
66import { getNotesLocator } from '../sharednotes/util' ;
77import { MultiUsers } from './multiusers' ;
8- import { drawArrow , openLockViewers } from './util' ;
8+ import { drawArrow , openLockViewers , setPresentationPermission } from './util' ;
99
1010export class LockViewers extends MultiUsers {
1111 async lockShareWebcam ( ) {
@@ -423,4 +423,71 @@ export class LockViewers extends MultiUsers {
423423 'should be displayed the other viewer whiteboard cursor indicator when unlocking user is unlocked' ,
424424 ) ;
425425 }
426+
427+ async presenterPolicyModeratorOnly ( ) {
428+ // Lock the viewer (disableCam) so the moderatorOnly restriction applies, and set moderatorOnly policy
429+ await openLockViewers ( this . modPage ) ;
430+ await this . modPage . waitAndClick ( e . participantPermissionsTab ) ;
431+ await this . modPage . waitAndClickElement ( e . lockShareWebcam ) ;
432+ await this . modPage . waitAndClick ( e . presentationPermissionsTab ) ;
433+ await this . modPage . waitAndClick ( e . presentationPolicySelector ) ;
434+ await this . modPage . waitAndClick ( e . presModeratorOnly ) ;
435+ await this . modPage . waitAndClick ( e . applyLockSettings ) ;
436+ // Locked viewer should see no action button in the media area
437+ await this . userPage . waitAndClick ( e . mediaAreaButton ) ;
438+ await this . userPage . wasRemoved (
439+ e . takePresenterButton ,
440+ 'should not display a take presenter button for a locked viewer under moderatorOnly policy' ,
441+ ) ;
442+ await this . userPage . wasRemoved (
443+ e . requestPresenterButton ,
444+ 'should not display a request presenter button for a locked viewer under moderatorOnly policy' ,
445+ ) ;
446+ }
447+
448+ async presenterPolicyRequireApproval ( ) {
449+ await setPresentationPermission ( this . modPage , e . presRequireApproval ) ;
450+ // Viewer opens media area and sees the request presenter button
451+ await this . userPage . waitAndClick ( e . mediaAreaButton ) ;
452+ await this . userPage . hasElement (
453+ e . requestPresenterButton ,
454+ 'should display the request presenter button for the viewer under requireApproval policy' ,
455+ ) ;
456+ // Viewer requests presenter role
457+ await this . userPage . waitAndClick ( e . requestPresenterButton ) ;
458+ await this . userPage . hasElement (
459+ e . waitingPresenterButton ,
460+ 'should display the waiting presenter button while the request is pending' ,
461+ ) ;
462+ // Moderator approves the request
463+ await this . modPage . hasElement (
464+ e . approvePresenter ,
465+ 'should display the approve presenter button for the moderator' ,
466+ ELEMENT_WAIT_LONGER_TIME ,
467+ ) ;
468+ await this . modPage . waitAndClick ( e . approvePresenter ) ;
469+ // Viewer becomes presenter
470+ await this . userPage . hasElement (
471+ e . wbToolbar ,
472+ 'should display the whiteboard toolbar after viewer becomes presenter' ,
473+ ELEMENT_WAIT_LONGER_TIME ,
474+ ) ;
475+ }
476+
477+ async presenterPolicyFreeForAll ( ) {
478+ await setPresentationPermission ( this . modPage , e . presFreeForAll ) ;
479+ // Viewer opens media area and sees the take presenter button directly
480+ await this . userPage . waitAndClick ( e . mediaAreaButton ) ;
481+ await this . userPage . hasElement (
482+ e . takePresenterButton ,
483+ 'should display the take presenter button for the viewer under freeForAll policy' ,
484+ ) ;
485+ // Viewer takes presenter without moderator approval
486+ await this . userPage . waitAndClick ( e . takePresenterButton ) ;
487+ await this . userPage . hasElement (
488+ e . wbToolbar ,
489+ 'should display the whiteboard toolbar after viewer takes presenter under freeForAll policy' ,
490+ ELEMENT_WAIT_LONGER_TIME ,
491+ ) ;
492+ }
426493}
0 commit comments