File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import { vpTest } from '../fixtures/vpTest' ;
2+ import { expect , test } from '@playwright/test' ;
3+ import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout' ;
4+ import { getLinkByName } from '../testData/pageLinksData' ;
5+ import { ExampleLinkName } from '../testData/ExampleLinkNames' ;
6+
7+ // Link to API and Events page
8+ const link = getLinkByName ( ExampleLinkName . APIAndEvents ) ;
9+ /**
10+ * Testing if video on API and Events page is playing by checking that is pause return false.
11+ */
12+ vpTest ( `Test if video on API and Events page is playing as expected` , async ( { page, pomPages } ) => {
13+ await test . step ( 'Navigate to api and events page by clicking on link' , async ( ) => {
14+ await pomPages . mainPage . clickLinkByName ( link . name ) ;
15+ await waitForPageToLoadWithTimeout ( page , 5000 ) ;
16+ } ) ;
17+ await test . step ( 'Validating that the video is playing (in case isPause is false)' , async ( ) => {
18+ expect ( await pomPages . apiAndEventsPage . apiAndEventsVideoComponent . isPaused ( ) ) . toEqual ( false ) ;
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { HighlightsGraphPage } from './highlightsGraphPage';
33import { BasePage } from './BasePage' ;
44import { MainPage } from './mainPage' ;
55import { AnalyticsPage } from './analyticsPage' ;
6+ import { ApiAndEventsPage } from './apiAndEventsPage' ;
67
78/**
89 * Page manager,
@@ -48,5 +49,12 @@ export class PageManager {
4849 public get analyticsPage ( ) : AnalyticsPage {
4950 return this . getPage ( AnalyticsPage ) ;
5051 }
52+
53+ /**
54+ * Returns API and Events page object
55+ */
56+ public get apiAndEventsPage ( ) : ApiAndEventsPage {
57+ return this . getPage ( ApiAndEventsPage ) ;
58+ }
5159}
5260export default PageManager ;
Original file line number Diff line number Diff line change 1+ import { Page } from '@playwright/test' ;
2+ import { VideoComponent } from '../../components/videoComponent' ;
3+ import { BasePage } from './BasePage' ;
4+ const API_AND_EVENTS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]' ;
5+
6+ /**
7+ * Video player examples api and events page object
8+ */
9+ export class ApiAndEventsPage extends BasePage {
10+ public apiAndEventsVideoComponent : VideoComponent ;
11+
12+ constructor ( page : Page ) {
13+ super ( page ) ;
14+ this . apiAndEventsVideoComponent = new VideoComponent ( page , API_AND_EVENTS_PAGE_VIDEO_SELECTOR ) ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments