-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vp test: test if videos on profiles page are playing (#785)
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { vpTest } from '../fixtures/vpTest'; | ||
import { test } from '@playwright/test'; | ||
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout'; | ||
import { getLinkByName } from '../testData/pageLinksData'; | ||
import { ExampleLinkName } from '../testData/ExampleLinkNames'; | ||
|
||
const link = getLinkByName(ExampleLinkName.Profiles); | ||
|
||
vpTest(`Test if 3 videos on profiles page are playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to profiles page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Validating that default profile video is playing', async () => { | ||
await pomPages.profilesPage.profilesDefaultProfileVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
await test.step('Scroll until custom profile video element is visible', async () => { | ||
await pomPages.profilesPage.profilesCustomProfileVideoComponent.locator.scrollIntoViewIfNeeded(); | ||
}); | ||
await test.step('Validating that custom profile video is playing', async () => { | ||
await pomPages.profilesPage.profilesCustomProfileVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
await test.step('Scroll until custom profile overrides video element is visible', async () => { | ||
await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.locator.scrollIntoViewIfNeeded(); | ||
}); | ||
await test.step('Validating that custom profile overrides video is playing', async () => { | ||
await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Page } from '@playwright/test'; | ||
import { VideoComponent } from '../../components/videoComponent'; | ||
import { BasePage } from './BasePage'; | ||
const PROFILES_PAGE_DEFAULT_PROFILE_VIDEO_SELECTOR = '//*[@id="player-default-profile_html5_api"]'; | ||
const PROFILES_PAGE_CUSTOM_PROFILE_VIDEO_SELECTOR = '//*[@id="player-custom-profile_html5_api"]'; | ||
const PROFILES_PAGE_CUSTOM_PROFILE_OVERRIDES_VIDEO_SELECTOR = '//*[@id="player-custom-profile-overrides_html5_api"]'; | ||
|
||
/** | ||
* Video player examples profiles page object | ||
*/ | ||
export class ProfilesPage extends BasePage { | ||
public profilesDefaultProfileVideoComponent: VideoComponent; | ||
public profilesCustomProfileVideoComponent: VideoComponent; | ||
public profilesCustomProfileOverridesVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.profilesDefaultProfileVideoComponent = new VideoComponent(page, PROFILES_PAGE_DEFAULT_PROFILE_VIDEO_SELECTOR); | ||
this.profilesCustomProfileVideoComponent = new VideoComponent(page, PROFILES_PAGE_CUSTOM_PROFILE_VIDEO_SELECTOR); | ||
this.profilesCustomProfileOverridesVideoComponent = new VideoComponent(page, PROFILES_PAGE_CUSTOM_PROFILE_OVERRIDES_VIDEO_SELECTOR); | ||
} | ||
} |