Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/e2e/specs/analyticsPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';

// Link to Analytics page
const link = getLinkByName(ExampleLinkName.Analytics);
/**
* Testing if video on analytics page is playing by checking that is pause return false.
*/
vpTest(`Test if video on analytics page is playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to analytics page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that the video is playing (in case isPause is false)', async () => {
expect(await pomPages.analyticsPage.analyticsVideoComponent.isPaused()).toEqual(false);
});
});
8 changes: 8 additions & 0 deletions test/e2e/src/pom/PageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Page } from '@playwright/test';
import { HighlightsGraphPage } from './highlightsGraphPage';
import { BasePage } from './BasePage';
import { MainPage } from './mainPage';
import { AnalyticsPage } from './analyticsPage';

/**
* Page manager,
Expand Down Expand Up @@ -40,5 +41,12 @@ export class PageManager {
public get highlightGraphPage(): HighlightsGraphPage {
return this.getPage(HighlightsGraphPage);
}

/**
* Returns Analytics page object
*/
public get analyticsPage(): AnalyticsPage {
return this.getPage(AnalyticsPage);
}
}
export default PageManager;
16 changes: 16 additions & 0 deletions test/e2e/src/pom/analyticsPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Page } from '@playwright/test';
import { VideoComponent } from '../../components/videoComponent';
import { BasePage } from './BasePage';
const ANALYTICS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]';

/**
* Video player examples analytics page object
*/
export class AnalyticsPage extends BasePage {
public analyticsVideoComponent: VideoComponent;

constructor(page: Page) {
super(page);
this.analyticsVideoComponent = new VideoComponent(page, ANALYTICS_PAGE_VIDEO_SELECTOR);
}
}
Loading