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
3 changes: 3 additions & 0 deletions docs/es-modules/colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ <h3 class="text-primary">Player 1</h3>
data-cld-source='{ "publicId": "dog", "info": { "title": "Sea turtle", "subtitle": "Short movie about a sea turtle" } }'
data-cld-colors='{ "base": "#0b602b", "accent": "#cddc39", "text": "#fff" }'
class="cld-video-player cld-fluid"
id="player-1"
></video>
</div>
<h3 class="text-primary">Player 2</h3>
Expand All @@ -38,6 +39,7 @@ <h3 class="text-primary">Player 2</h3>
data-cld-source='{ "publicId": "sea_turtle", "info": { "title": "Sea turtle", "subtitle": "Short movie about a sea turtle" } }'
data-cld-colors='{ "base": "#111", "accent": "#03a9f4", "text": "#ffeb3b" }'
class="cld-video-player cld-fluid cld-video-player-skin-dark"
id="player-2"
></video>
</div>

Expand All @@ -49,6 +51,7 @@ <h3 class="text-primary">Player 3</h3>
data-cld-source='{ "publicId": "elephants", "info": { "title": "Elephants", "subtitle": "Short movie about elephants" } }'
data-cld-colors='{ "base": "#ffffff", "accent": "#676a46", "text": "#007d29" }'
class="cld-video-player cld-fluid cld-video-player-skin-light"
id="player-3"
></video>
</div>

Expand Down
12 changes: 12 additions & 0 deletions test/e2e/specs/ESM/esmColorsApiPage.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 { getEsmLinkByName } from '../../testData/esmPageLinksData';
import { ESM_URL } from '../../testData/esmUrl';
import { testColorsApiPageVideoIsPlaying } from '../commonSpecs/colorsApiPageVideoPlaying';

const link = getEsmLinkByName(ExampleLinkName.ColorsAPI);

vpTest(`Test if 3 videos on ESM colors API page are playing as expected`, async ({ page, pomPages }) => {
await page.goto(ESM_URL);
await testColorsApiPageVideoIsPlaying(page, pomPages, link);
});
20 changes: 2 additions & 18 deletions test/e2e/specs/NonESM/colorsApiPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,26 +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 { testColorsApiPageVideoIsPlaying } from '../commonSpecs/colorsApiPageVideoPlaying';

const link = getLinkByName(ExampleLinkName.ColorsAPI);

vpTest(`Test if 3 videos on colors API page are playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to colors API page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that modified color video is playing', async () => {
await pomPages.colorsApiPage.colorsApiColorSkinVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Validating that dark skin video video is playing', async () => {
await pomPages.colorsApiPage.colorsApiDarkSkinVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Scroll until light skin video element is visible', async () => {
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that light skin video is playing', async () => {
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.validateVideoIsPlaying(true);
});
await testColorsApiPageVideoIsPlaying(page, pomPages, link);
});
23 changes: 23 additions & 0 deletions test/e2e/specs/commonSpecs/colorsApiPageVideoPlaying.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 testColorsApiPageVideoIsPlaying(page: Page, pomPages: PageManager, link: ExampleLinkType) {
await test.step('Navigate to colors API page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that modified color video is playing', async () => {
await pomPages.colorsApiPage.colorsApiColorSkinVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Validating that dark skin video video is playing', async () => {
await pomPages.colorsApiPage.colorsApiDarkSkinVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Scroll until light skin video element is visible', async () => {
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that light skin video is playing', async () => {
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.validateVideoIsPlaying(true);
});
}