|
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 { testCodecsAndFormatsPageVideoIsPlaying } from '../commonSpecs/codecsAndFormatsVideoPlaying'; |
6 | 5 |
|
7 | 6 | const link = getLinkByName(ExampleLinkName.CodecsAndFormats); |
8 | 7 |
|
9 | 8 | vpTest(`Test if 3 videos on codecs and formats page are playing as expected`, async ({ page, pomPages }) => { |
10 | | - await test.step('Navigate to codecs and formats 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 f_auto video is playing', async () => { |
15 | | - await pomPages.codecsAndFormatsPage.codecsAndFormatsFAutoVideoComponent.validateVideoIsPlaying(true); |
16 | | - }); |
17 | | - await test.step('Validating that AV1 video is playing', async () => { |
18 | | - await pomPages.codecsAndFormatsPage.codecsAndFormatsAv1VideoComponent.validateVideoIsPlaying(true); |
19 | | - }); |
20 | | - await test.step('Scroll until VP9 video element is visible', async () => { |
21 | | - await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.locator.scrollIntoViewIfNeeded(); |
22 | | - }); |
23 | | - await test.step('Validating that VP9 video is playing', async () => { |
24 | | - await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.validateVideoIsPlaying(true); |
25 | | - }); |
| 9 | + await testCodecsAndFormatsPageVideoIsPlaying(page, pomPages, link); |
26 | 10 | }); |
0 commit comments