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
12 changes: 12 additions & 0 deletions test/e2e/specs/ESM/esmFluidLayoutsPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { vpTest } from '../../fixtures/vpTest';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
import { testFluidLayoutsPageVideoIsPlaying } from '../commonSpecs/fluidLayoutsPageVideoPlaying';
import { ESM_URL } from '../../testData/esmUrl';

const link = getLinkByName(ExampleLinkName.FluidLayouts);

vpTest(`Test if video on ESM fluid layouts page is playing as expected`, async ({ page, pomPages }) => {
await page.goto(ESM_URL);
await testFluidLayoutsPageVideoIsPlaying(page, pomPages, link);
});
11 changes: 2 additions & 9 deletions test/e2e/specs/NonESM/fluidLayoutsPage.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 { testFluidLayoutsPageVideoIsPlaying } from '../commonSpecs/fluidLayoutsPageVideoPlaying';

const link = getLinkByName(ExampleLinkName.FluidLayouts);

vpTest(`Test if video on fluid layouts page is playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to fluid layouts page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that fluid layouts video is playing', async () => {
await pomPages.fluidLayoutsPage.fluidLayoutsVideoComponent.validateVideoIsPlaying(true);
});
await testFluidLayoutsPageVideoIsPlaying(page, pomPages, link);
});
14 changes: 14 additions & 0 deletions test/e2e/specs/commonSpecs/fluidLayoutsPageVideoPlaying.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 testFluidLayoutsPageVideoIsPlaying(page: Page, pomPages: PageManager, link: ExampleLinkType) {
await test.step('Navigate to fluid layouts page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that fluid layouts video is playing', async () => {
await pomPages.fluidLayoutsPage.fluidLayoutsVideoComponent.validateVideoIsPlaying(true);
});
}