-
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 poster options page are playing (#784)
- Loading branch information
Showing
3 changed files
with
68 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,38 @@ | ||
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.PosterOptions); | ||
|
||
vpTest(`Test if 4 videos on poster options page are playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to poster options page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Click on play button of custom image poster player to play video', async () => { | ||
return pomPages.posterOptionsPage.posterOptionsCustomImageVideoComponent.clickPlay(); | ||
}); | ||
await test.step('Validating that the custom image poster video is playing', async () => { | ||
await pomPages.posterOptionsPage.posterOptionsCustomImageVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
await test.step('Click on play button of specific frame poster player to play video', async () => { | ||
return pomPages.posterOptionsPage.posterOptionsSpecificFrameVideoComponent.clickPlay(); | ||
}); | ||
await test.step('Validating that specific frame poster video is playing', async () => { | ||
await pomPages.posterOptionsPage.posterOptionsSpecificFrameVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
await test.step('Click on play button of transformations array poster player to play video', async () => { | ||
return pomPages.posterOptionsPage.posterOptionsTransformationsArrayVideoComponent.clickPlay(); | ||
}); | ||
await test.step('Validating that transformations array poster video is playing', async () => { | ||
await pomPages.posterOptionsPage.posterOptionsTransformationsArrayVideoComponent.validateVideoIsPlaying(true); | ||
}); | ||
await test.step('Click on play button of raw url no poster player to play video', async () => { | ||
return pomPages.posterOptionsPage.posterOptionsRawUrlNoPosterVideoComponent.clickPlay(); | ||
}); | ||
await test.step('Validating that raw url no poster video is playing', async () => { | ||
await pomPages.posterOptionsPage.posterOptionsRawUrlNoPosterVideoComponent.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,25 @@ | ||
import { Page } from '@playwright/test'; | ||
import { VideoComponent } from '../../components/videoComponent'; | ||
import { BasePage } from './BasePage'; | ||
const POSTER_OPTIONS_PAGE_CUSTOM_IMAGE_VIDEO_SELECTOR = '//*[@id="player-image-poster_html5_api"]'; | ||
const POSTER_OPTIONS_PAGE_SPECIFIC_FRAME_VIDEO_SELECTOR = '//*[@id="player-frame-0_html5_api"]'; | ||
const POSTER_OPTIONS_PAGE_TRANSFORMATIONS_ARRAY_VIDEO_SELECTOR = '//*[@id="player-poster-options_html5_api"]'; | ||
const POSTER_OPTIONS_PAGE_RAW_URL_NO_POSTER_VIDEO_SELECTOR = '//*[@id="player-raw_html5_api"]'; | ||
|
||
/** | ||
* Video player examples poster options page object | ||
*/ | ||
export class PosterOptionsPage extends BasePage { | ||
public posterOptionsCustomImageVideoComponent: VideoComponent; | ||
public posterOptionsSpecificFrameVideoComponent: VideoComponent; | ||
public posterOptionsTransformationsArrayVideoComponent: VideoComponent; | ||
public posterOptionsRawUrlNoPosterVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.posterOptionsCustomImageVideoComponent = new VideoComponent(page, POSTER_OPTIONS_PAGE_CUSTOM_IMAGE_VIDEO_SELECTOR); | ||
this.posterOptionsSpecificFrameVideoComponent = new VideoComponent(page, POSTER_OPTIONS_PAGE_SPECIFIC_FRAME_VIDEO_SELECTOR); | ||
this.posterOptionsTransformationsArrayVideoComponent = new VideoComponent(page, POSTER_OPTIONS_PAGE_TRANSFORMATIONS_ARRAY_VIDEO_SELECTOR); | ||
this.posterOptionsRawUrlNoPosterVideoComponent = new VideoComponent(page, POSTER_OPTIONS_PAGE_RAW_URL_NO_POSTER_VIDEO_SELECTOR); | ||
} | ||
} |