|
| 1 | +import { vpTest } from '../fixtures/vpTest'; |
| 2 | +import { test } from '@playwright/test'; |
| 3 | +import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout'; |
| 4 | +import { getLinkByName } from '../testData/pageLinksData'; |
| 5 | +import { ExampleLinkName } from '../testData/ExampleLinkNames'; |
| 6 | + |
| 7 | +const link = getLinkByName(ExampleLinkName.PosterOptions); |
| 8 | + |
| 9 | +vpTest(`Test if 4 videos on poster options page are playing as expected`, async ({ page, pomPages }) => { |
| 10 | + await test.step('Navigate to poster options page by clicking on link', async () => { |
| 11 | + await pomPages.mainPage.clickLinkByName(link.name); |
| 12 | + await waitForPageToLoadWithTimeout(page, 5000); |
| 13 | + }); |
| 14 | + await test.step('Click on play button of custom image poster player to play video', async () => { |
| 15 | + return pomPages.posterOptionsPage.posterOptionsCustomImageVideoComponent.clickPlay(); |
| 16 | + }); |
| 17 | + await test.step('Validating that the custom image poster video is playing', async () => { |
| 18 | + await pomPages.posterOptionsPage.posterOptionsCustomImageVideoComponent.validateVideoIsPlaying(true); |
| 19 | + }); |
| 20 | + await test.step('Click on play button of specific frame poster player to play video', async () => { |
| 21 | + return pomPages.posterOptionsPage.posterOptionsSpecificFrameVideoComponent.clickPlay(); |
| 22 | + }); |
| 23 | + await test.step('Validating that specific frame poster video is playing', async () => { |
| 24 | + await pomPages.posterOptionsPage.posterOptionsSpecificFrameVideoComponent.validateVideoIsPlaying(true); |
| 25 | + }); |
| 26 | + await test.step('Click on play button of transformations array poster player to play video', async () => { |
| 27 | + return pomPages.posterOptionsPage.posterOptionsTransformationsArrayVideoComponent.clickPlay(); |
| 28 | + }); |
| 29 | + await test.step('Validating that transformations array poster video is playing', async () => { |
| 30 | + await pomPages.posterOptionsPage.posterOptionsTransformationsArrayVideoComponent.validateVideoIsPlaying(true); |
| 31 | + }); |
| 32 | + await test.step('Click on play button of raw url no poster player to play video', async () => { |
| 33 | + return pomPages.posterOptionsPage.posterOptionsRawUrlNoPosterVideoComponent.clickPlay(); |
| 34 | + }); |
| 35 | + await test.step('Validating that raw url no poster video is playing', async () => { |
| 36 | + await pomPages.posterOptionsPage.posterOptionsRawUrlNoPosterVideoComponent.validateVideoIsPlaying(true); |
| 37 | + }); |
| 38 | +}); |
0 commit comments