import { browser } from 'protractor' ; import { imageCompare } from '../common/image-compare' ; import { MediaPlayerPage } from './media-player.po.spec' ; describe ( 'Media Player Tests' , ( ) => { let page ; beforeEach ( async ( ) => { page = new MediaPlayerPage ( ) ; await page . getPage ( ) ; } ) ; it ( 'should have the correct initial state' , async ( ) => { expect ( await imageCompare ( 'media-player-initial' ) ) . toEqual ( 0 ) ; } ) ; it ( 'should show and hide subtitles popover on mouse click' , async ( ) => { await page . actionBtn . click ( ) ; expect ( await page . popover . isPresent ( ) ) . toBe ( true ) ; expect ( await imageCompare ( 'media-player-subtitles-open' ) ) . toEqual ( 0 ) ; await page . actionBtn . click ( ) ; expect ( await page . popover . isPresent ( ) ) . toBe ( false ) ; } ) ; } ) ;