-
Notifications
You must be signed in to change notification settings - Fork 23
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 video on api and events page is playing (#755)
- Loading branch information
Showing
3 changed files
with
44 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,20 @@ | ||
import { vpTest } from '../fixtures/vpTest'; | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout'; | ||
import { getLinkByName } from '../testData/pageLinksData'; | ||
import { ExampleLinkName } from '../testData/ExampleLinkNames'; | ||
|
||
// Link to API and Events page | ||
const link = getLinkByName(ExampleLinkName.APIAndEvents); | ||
/** | ||
* Testing if video on API and Events page is playing by checking that is pause return false. | ||
*/ | ||
vpTest(`Test if video on API and Events page is playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to api and events page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Validating that the video is playing (in case isPause is false)', async () => { | ||
expect(await pomPages.apiAndEventsPage.apiAndEventsVideoComponent.isPaused()).toEqual(false); | ||
}); | ||
}); |
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,16 @@ | ||
import { Page } from '@playwright/test'; | ||
import { VideoComponent } from '../../components/videoComponent'; | ||
import { BasePage } from './BasePage'; | ||
const API_AND_EVENTS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]'; | ||
|
||
/** | ||
* Video player examples api and events page object | ||
*/ | ||
export class ApiAndEventsPage extends BasePage { | ||
public apiAndEventsVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.apiAndEventsVideoComponent = new VideoComponent(page, API_AND_EVENTS_PAGE_VIDEO_SELECTOR); | ||
} | ||
} |