Skip to content

Commit d0fbf76

Browse files
authored
vp test: test if video is playing on ESM fluid layouts page (#842)
1 parent e881737 commit d0fbf76

3 files changed

Lines changed: 28 additions & 9 deletions

File tree

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 { getLinkByName } from '../../testData/pageLinksData';
3+
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
4+
import { testFluidLayoutsPageVideoIsPlaying } from '../commonSpecs/fluidLayoutsPageVideoPlaying';
5+
import { ESM_URL } from '../../testData/esmUrl';
6+
7+
const link = getLinkByName(ExampleLinkName.FluidLayouts);
8+
9+
vpTest(`Test if video on ESM fluid layouts page is playing as expected`, async ({ page, pomPages }) => {
10+
await page.goto(ESM_URL);
11+
await testFluidLayoutsPageVideoIsPlaying(page, pomPages, link);
12+
});
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +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 { testFluidLayoutsPageVideoIsPlaying } from '../commonSpecs/fluidLayoutsPageVideoPlaying';
65

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

98
vpTest(`Test if video on fluid layouts page is playing as expected`, async ({ page, pomPages }) => {
10-
await test.step('Navigate to fluid layouts 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 fluid layouts video is playing', async () => {
15-
await pomPages.fluidLayoutsPage.fluidLayoutsVideoComponent.validateVideoIsPlaying(true);
16-
});
9+
await testFluidLayoutsPageVideoIsPlaying(page, pomPages, link);
1710
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 testFluidLayoutsPageVideoIsPlaying(page: Page, pomPages: PageManager, link: ExampleLinkType) {
7+
await test.step('Navigate to fluid layouts 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 fluid layouts video is playing', async () => {
12+
await pomPages.fluidLayoutsPage.fluidLayoutsVideoComponent.validateVideoIsPlaying(true);
13+
});
14+
}

0 commit comments

Comments
 (0)