|
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 { testCldAnalyticsPageVideoIsPlaying } from '../commonSpecs/cldAnalyticsPageVideoPlaying'; |
6 | 5 |
|
7 | 6 | const link = getLinkByName(ExampleLinkName.CloudinaryAnalytics); |
8 | 7 |
|
9 | 8 | vpTest(`Test if 4 videos on Cloudinary analytics page are playing as expected`, async ({ page, pomPages }) => { |
10 | | - await test.step('Navigate to Cloudinary analytics 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 Cloudinary analytics video is playing', async () => { |
15 | | - await pomPages.cldAnalyticsPage.cldAnalyticsVideoComponent.validateVideoIsPlaying(true); |
16 | | - }); |
17 | | - await test.step('Validating that Cloudinary analytics ADP video is playing', async () => { |
18 | | - await pomPages.cldAnalyticsPage.cldAnalyticsAdpVideoComponent.validateVideoIsPlaying(true); |
19 | | - }); |
20 | | - await test.step('Scroll until Cloudinary analytics custom data object video element is visible', async () => { |
21 | | - await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataObjectVideoComponent.locator.scrollIntoViewIfNeeded(); |
22 | | - }); |
23 | | - await test.step('Validating that Cloudinary analytics custom data object video is playing', async () => { |
24 | | - await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataObjectVideoComponent.validateVideoIsPlaying(true); |
25 | | - }); |
26 | | - await test.step('Scroll until Cloudinary analytics custom data function video element is visible', async () => { |
27 | | - await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataFunctionVideoComponent.locator.scrollIntoViewIfNeeded(); |
28 | | - }); |
29 | | - await test.step('Validating that Cloudinary analytics custom data function video is playing', async () => { |
30 | | - await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataFunctionVideoComponent.validateVideoIsPlaying(true); |
31 | | - }); |
| 9 | + await testCldAnalyticsPageVideoIsPlaying(page, pomPages, link); |
32 | 10 | }); |
0 commit comments