|
| 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.Profiles); |
| 8 | + |
| 9 | +vpTest(`Test if 3 videos on profiles page are playing as expected`, async ({ page, pomPages }) => { |
| 10 | + await test.step('Navigate to profiles 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 default profile video is playing', async () => { |
| 15 | + await pomPages.profilesPage.profilesDefaultProfileVideoComponent.validateVideoIsPlaying(true); |
| 16 | + }); |
| 17 | + await test.step('Scroll until custom profile video element is visible', async () => { |
| 18 | + await pomPages.profilesPage.profilesCustomProfileVideoComponent.locator.scrollIntoViewIfNeeded(); |
| 19 | + }); |
| 20 | + await test.step('Validating that custom profile video is playing', async () => { |
| 21 | + await pomPages.profilesPage.profilesCustomProfileVideoComponent.validateVideoIsPlaying(true); |
| 22 | + }); |
| 23 | + await test.step('Scroll until custom profile overrides video element is visible', async () => { |
| 24 | + await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.locator.scrollIntoViewIfNeeded(); |
| 25 | + }); |
| 26 | + await test.step('Validating that custom profile overrides video is playing', async () => { |
| 27 | + await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.validateVideoIsPlaying(true); |
| 28 | + }); |
| 29 | +}); |
0 commit comments