'use strict' ; import { by , element , protractor , ElementFinder , ProtractorBrowser , WebElement , ElementArrayFinder } from 'protractor' ; export class OpenViduCall { constructor ( ) { } getRoomInput ( browser ) { return this . getElementById ( browser , 'roomInput' ) ; } getRoomJoinButton ( browser ) { return this . getElementById ( browser , 'joinButton' ) ; } getShortRoomNameError ( browser ) { return this . getElementById ( browser , 'shortNameError' ) ; } getRequiredRoomNameError ( browser ) { return this . getElementById ( browser , 'requiredNameError' ) ; } getConfigCard ( browser ) { return this . getElementById ( browser , 'roomConfig' ) ; } getConfigCardScreenShareButton ( browser ) { return this . getElementById ( browser , 'configCardScreenButton' ) ; } getConfigCardCameraButton ( browser ) { return this . getElementById ( browser , 'configCardCameraButton' ) ; } getConfigCardMicrophoneButton ( browser ) { return this . getElementById ( browser , 'configCardMicrophoneButton' ) ; } getRoomContainer ( browser ) { return this . getElementById ( browser , 'room-container' ) ; } getCloseButtonConfigCard ( browser ) { return browser . element ( by . id ( 'closeButton' ) ) ; } getAllVideos ( browser ) { return browser . element . all ( by . tagName ( 'video' ) ) ; } getLeaveButton ( browser ) { return this . getElementById ( browser , 'navLeaveButton' ) ; } getRoomCameraButton ( browser ) { return this . getElementById ( browser , 'navCameraButton' ) ; } getCameraStatusDisabled ( browser ) { return this . getElementById ( browser , 'statusCam' ) ; } getFullscreenButton ( browser ) { return this . getElementById ( browser , 'fullscreenButton' ) ; } getRoomMicrophoneButton ( browser ) { return this . getElementById ( browser , 'navMicrophoneButton' ) ; } getMicrophoneStatusDisabled ( browser ) { return this . getElementById ( browser , 'statusMic' ) ; } getRoomScreenButton ( browser ) { return this . getElementById ( browser , 'navScreenButton' ) ; } openNewBrowserInTheSameRoom ( browser ) { return browser . forkNewDriverInstance ( true ) ; } getLocalNickname ( browser ) { return browser . element ( by . css ( '#localUser #nickname' ) ) ; } getRemoteNickname ( browser ) { return browser . element ( by . css ( '#remoteUsers #nickname' ) ) ; } getDialogNickname ( browser ) { return browser . element ( by . css ( '#dialogNickname' ) ) ; } getChatButton ( browser ) { return browser . element ( by . css ( '#navChatButton' ) ) ; } getVideo ( browser ) { return this . getChatContent ( browser ) . element ( by . css ( 'video' ) ) ; } getRemoteVideoList ( browser ) { return browser . element . all ( by . css ( '#remoteUsers video' ) ) ; } getChatContent ( browser ) { return browser . element ( by . css ( '#chatComponent' ) ) ; } getChatInput ( browser ) { return browser . element ( by . id ( 'chatInput' ) ) ; } getNewMessagePoint ( browser ) { return browser . element ( by . css ( '#mat-badge-content-0' ) ) ; } pressEnter ( browser ) { browser . actions ( ) . sendKeys ( protractor . Key . ENTER ) . perform ( ) ; } getMessageList ( browser ) { return browser . element . all ( by . css ( '#chatComponent .message-wrap .message .msg-detail' ) ) ; } closeSession ( browser ) { const leaveButton = this . getLeaveButton ( browser ) ; leaveButton . click ( ) ; browser . quit ( ) ; } typeWithDelay ( input , keys ) { keys . split ( '' ) . forEach ( ( c ) => input . sendKeys ( c ) ) ; } private getElementById ( browser , id ) { return browser . element ( by . id ( id ) ) ; } }