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
1 change: 1 addition & 0 deletions docs/es-modules/force-hls-subtitles.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ <h3 class="mb-4">Force HLS Subtitles</h3>
crossorigin="anonymous"
controls
muted
autoplay
playsinline
></video>

Expand Down
12 changes: 12 additions & 0 deletions test/e2e/specs/ESM/esmForceHlsSubtitlesPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { vpTest } from '../../fixtures/vpTest';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
import { testForceHlsSubtitlesPageVideoIsPlaying } from '../commonSpecs/forceHlsSubtitlesPageVideoPlaying';
import { getEsmLinkByName } from '../../testData/esmPageLinksData';
import { ESM_URL } from '../../testData/esmUrl';

const link = getEsmLinkByName(ExampleLinkName.ForceHLSSubtitles);

vpTest(`Test if video on ESM force HLS subtitles page is playing as expected`, async ({ page, pomPages }) => {
await page.goto(ESM_URL);
await testForceHlsSubtitlesPageVideoIsPlaying(page, pomPages, link);
});
11 changes: 2 additions & 9 deletions test/e2e/specs/NonESM/forceHlsSubtitlesPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
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';
import { testForceHlsSubtitlesPageVideoIsPlaying } from '../commonSpecs/forceHlsSubtitlesPageVideoPlaying';

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);
});
await testForceHlsSubtitlesPageVideoIsPlaying(page, pomPages, link);
});
14 changes: 14 additions & 0 deletions test/e2e/specs/commonSpecs/forceHlsSubtitlesPageVideoPlaying.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Page, test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import PageManager from '../../src/pom/PageManager';
import { ExampleLinkType } from '../../types/exampleLinkType';

export async function testForceHlsSubtitlesPageVideoIsPlaying(page: Page, pomPages: PageManager, link: ExampleLinkType) {
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);
});
}