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 Analytics page
8+ const link = getLinkByName ( ExampleLinkName . Analytics ) ;
9+ /**
10+ * Testing if video on analytics page is playing by checking that is pause return false.
11+ */
12+ vpTest ( `Test if video on analytics page is playing as expected` , async ( { page, pomPages } ) => {
13+ await test . step ( 'Navigate to analytics 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 . analyticsPage . analyticsVideoComponent . isPaused ( ) ) . toEqual ( false ) ;
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Page } from '@playwright/test';
22import { HighlightsGraphPage } from './highlightsGraphPage' ;
33import { BasePage } from './BasePage' ;
44import { MainPage } from './mainPage' ;
5+ import { AnalyticsPage } from './analyticsPage' ;
56
67/**
78 * Page manager,
@@ -40,5 +41,12 @@ export class PageManager {
4041 public get highlightGraphPage ( ) : HighlightsGraphPage {
4142 return this . getPage ( HighlightsGraphPage ) ;
4243 }
44+
45+ /**
46+ * Returns Analytics page object
47+ */
48+ public get analyticsPage ( ) : AnalyticsPage {
49+ return this . getPage ( AnalyticsPage ) ;
50+ }
4351}
4452export 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 ANALYTICS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]' ;
5+
6+ /**
7+ * Video player examples analytics page object
8+ */
9+ export class AnalyticsPage extends BasePage {
10+ public analyticsVideoComponent : VideoComponent ;
11+
12+ constructor ( page : Page ) {
13+ super ( page ) ;
14+ this . analyticsVideoComponent = new VideoComponent ( page , ANALYTICS_PAGE_VIDEO_SELECTOR ) ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments