|
1 | 1 | import { vpTest } from '../../fixtures/vpTest'; |
2 | | -import { test } from '@playwright/test'; |
3 | | -import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout'; |
4 | 2 | import { getLinkByName } from '../../testData/pageLinksData'; |
5 | 3 | import { ExampleLinkName } from '../../testData/ExampleLinkNames'; |
| 4 | +import { testVideoTransformationsPageVideoIsPlaying } from '../commonSpecs/videoTransformationsPage'; |
6 | 5 |
|
7 | 6 | const link = getLinkByName(ExampleLinkName.VideoTransformations); |
8 | 7 |
|
9 | 8 | vpTest(`Test if 3 videos on video transformations page are playing as expected`, async ({ page, pomPages }) => { |
10 | | - await test.step('Navigate to video transformations 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 via source transformation video is playing', async () => { |
15 | | - await pomPages.videoTransformationsPage.viaSourceVideoComponent.validateVideoIsPlaying(true); |
16 | | - }); |
17 | | - await test.step('Validating that via player transformation video is playing', async () => { |
18 | | - await pomPages.videoTransformationsPage.viaPlayerVideoComponent.validateVideoIsPlaying(true); |
19 | | - }); |
20 | | - await test.step('Scroll until data cld transformation video element is visible', async () => { |
21 | | - await pomPages.videoTransformationsPage.viaDataCldTransformationsVideoComponent.locator.scrollIntoViewIfNeeded(); |
22 | | - }); |
23 | | - await test.step('Validating that via data cld transformation video is playing', async () => { |
24 | | - await pomPages.videoTransformationsPage.viaDataCldTransformationsVideoComponent.validateVideoIsPlaying(true); |
25 | | - }); |
| 9 | + await testVideoTransformationsPageVideoIsPlaying(page, pomPages, link); |
26 | 10 | }); |
0 commit comments