Skip to content

Commit 630e75d

Browse files
authored
Merge branch 'master' into ME-19132-private-asset-poster-fix
2 parents 75fae9f + 53a4362 commit 630e75d

File tree

3 files changed

+37
-18
lines changed

3 files changed

+37
-18
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { vpTest } from '../../fixtures/vpTest';
2+
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
3+
import { getEsmLinkByName } from '../../testData/esmPageLinksData';
4+
import { ESM_URL } from '../../testData/esmUrl';
5+
import { testCodecsAndFormatsPageVideoIsPlaying } from '../commonSpecs/codecsAndFormatsVideoPlaying';
6+
7+
const link = getEsmLinkByName(ExampleLinkName.CodecsAndFormats);
8+
9+
vpTest(`Test if 3 videos on ESM codecs and formats page are playing as expected`, async ({ page, pomPages }) => {
10+
await page.goto(ESM_URL);
11+
await testCodecsAndFormatsPageVideoIsPlaying(page, pomPages, link);
12+
});
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
import { vpTest } from '../../fixtures/vpTest';
2-
import { test } from '@playwright/test';
3-
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
42
import { getLinkByName } from '../../testData/pageLinksData';
53
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
4+
import { testCodecsAndFormatsPageVideoIsPlaying } from '../commonSpecs/codecsAndFormatsVideoPlaying';
65

76
const link = getLinkByName(ExampleLinkName.CodecsAndFormats);
87

98
vpTest(`Test if 3 videos on codecs and formats page are playing as expected`, async ({ page, pomPages }) => {
10-
await test.step('Navigate to codecs and formats page by clicking on link', async () => {
11-
await pomPages.mainPage.clickLinkByName(link.name);
12-
await waitForPageToLoadWithTimeout(page, 5000);
13-
});
14-
await test.step('Validating that f_auto video is playing', async () => {
15-
await pomPages.codecsAndFormatsPage.codecsAndFormatsFAutoVideoComponent.validateVideoIsPlaying(true);
16-
});
17-
await test.step('Validating that AV1 video is playing', async () => {
18-
await pomPages.codecsAndFormatsPage.codecsAndFormatsAv1VideoComponent.validateVideoIsPlaying(true);
19-
});
20-
await test.step('Scroll until VP9 video element is visible', async () => {
21-
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.locator.scrollIntoViewIfNeeded();
22-
});
23-
await test.step('Validating that VP9 video is playing', async () => {
24-
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.validateVideoIsPlaying(true);
25-
});
9+
await testCodecsAndFormatsPageVideoIsPlaying(page, pomPages, link);
2610
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Page, test } from '@playwright/test';
2+
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
3+
import PageManager from '../../src/pom/PageManager';
4+
import { ExampleLinkType } from '../../types/exampleLinkType';
5+
6+
export async function testCodecsAndFormatsPageVideoIsPlaying(page: Page, pomPages: PageManager, link: ExampleLinkType) {
7+
await test.step('Navigate to codecs and formats page by clicking on link', async () => {
8+
await pomPages.mainPage.clickLinkByName(link.name);
9+
await waitForPageToLoadWithTimeout(page, 5000);
10+
});
11+
await test.step('Validating that f_auto video is playing', async () => {
12+
await pomPages.codecsAndFormatsPage.codecsAndFormatsFAutoVideoComponent.validateVideoIsPlaying(true);
13+
});
14+
await test.step('Validating that AV1 video is playing', async () => {
15+
await pomPages.codecsAndFormatsPage.codecsAndFormatsAv1VideoComponent.validateVideoIsPlaying(true);
16+
});
17+
await test.step('Scroll until VP9 video element is visible', async () => {
18+
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.locator.scrollIntoViewIfNeeded();
19+
});
20+
await test.step('Validating that VP9 video is playing', async () => {
21+
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.validateVideoIsPlaying(true);
22+
});
23+
}

0 commit comments

Comments
 (0)