From ce0842353410fe29fc7577170a6201f3e7954f15 Mon Sep 17 00:00:00 2001 From: shaylevi Date: Thu, 2 Jan 2025 11:55:35 +0200 Subject: [PATCH] vp test: test if video on force HLS subtitles page is playing --- test/e2e/specs/forceHlsSubtitlesPage.spec.ts | 17 +++++++++++++++++ test/e2e/src/pom/PageManager.ts | 5 +++++ test/e2e/src/pom/forceHlsSubtitlesPage.ts | 16 ++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 test/e2e/specs/forceHlsSubtitlesPage.spec.ts create mode 100644 test/e2e/src/pom/forceHlsSubtitlesPage.ts diff --git a/test/e2e/specs/forceHlsSubtitlesPage.spec.ts b/test/e2e/specs/forceHlsSubtitlesPage.spec.ts new file mode 100644 index 00000000..9c88b6a3 --- /dev/null +++ b/test/e2e/specs/forceHlsSubtitlesPage.spec.ts @@ -0,0 +1,17 @@ +import { vpTest } from '../fixtures/vpTest'; +import { test } from '@playwright/test'; +import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout'; +import { getLinkByName } from '../testData/pageLinksData'; +import { ExampleLinkName } from '../testData/ExampleLinkNames'; + +const link = getLinkByName(ExampleLinkName.ForceHLSSubtitles); + +vpTest(`Test if video on force HLS subtitles page is playing as expected`, async ({ page, pomPages }) => { + await test.step('Navigate to force HLS subtitles page by clicking on link', async () => { + await pomPages.mainPage.clickLinkByName(link.name); + await waitForPageToLoadWithTimeout(page, 5000); + }); + await test.step('Validating that force HLS subtitles video is playing', async () => { + await pomPages.forceHlsSubtitlesPage.forceHlsSubtitlesVideoComponent.validateVideoIsPlaying(true); + }); +}); diff --git a/test/e2e/src/pom/PageManager.ts b/test/e2e/src/pom/PageManager.ts index 99b92b65..146adbe9 100644 --- a/test/e2e/src/pom/PageManager.ts +++ b/test/e2e/src/pom/PageManager.ts @@ -14,6 +14,7 @@ import { ComponentsPage } from './componentsPage'; import { DisplayConfigurationsPage } from './displayConfigurationsPage'; import { FloatingPlayerPage } from './floatingPlayerPgae'; import { FluidLayoutsPage } from './fluidLayoutsPage'; +import { ForceHlsSubtitlesPage } from './forceHlsSubtitlesPage'; /** * Page manager, @@ -121,5 +122,9 @@ export class PageManager { public get fluidLayoutsPage(): FluidLayoutsPage { return this.getPage(FluidLayoutsPage); } + + public get forceHlsSubtitlesPage(): ForceHlsSubtitlesPage { + return this.getPage(ForceHlsSubtitlesPage); + } } export default PageManager; diff --git a/test/e2e/src/pom/forceHlsSubtitlesPage.ts b/test/e2e/src/pom/forceHlsSubtitlesPage.ts new file mode 100644 index 00000000..3f0a3d43 --- /dev/null +++ b/test/e2e/src/pom/forceHlsSubtitlesPage.ts @@ -0,0 +1,16 @@ +import { Page } from '@playwright/test'; +import { VideoComponent } from '../../components/videoComponent'; +import { BasePage } from './BasePage'; +const FORCE_HLS_SUBTITLES_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]'; + +/** + * Video player examples force HLS subtitles page object + */ +export class ForceHlsSubtitlesPage extends BasePage { + public forceHlsSubtitlesVideoComponent: VideoComponent; + + constructor(page: Page) { + super(page); + this.forceHlsSubtitlesVideoComponent = new VideoComponent(page, FORCE_HLS_SUBTITLES_PAGE_VIDEO_SELECTOR); + } +}