-
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: tests if video is playing on recommendations, seek thumbnail…
…s and shoppable videos pages (#790)
- Loading branch information
Showing
7 changed files
with
117 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,17 @@ | ||
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.Recommendations); | ||
|
||
vpTest(`Test if video on recommendations page is playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to recommendations page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Validating that recommendations video is playing', async () => { | ||
await pomPages.recommendationsPage.recommendationsVideoComponent.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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.SeekThumbnails); | ||
|
||
vpTest(`Test if video on seek thumbnails page is playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to seek thumbnails page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Validating that seek thumbnails video is playing', async () => { | ||
await pomPages.seekThumbnailsPage.seekThumbnailsVideoComponent.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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.ShoppableVideos); | ||
|
||
vpTest(`Test if video on shoppable videos page is playing as expected`, async ({ page, pomPages }) => { | ||
await test.step('Navigate to shoppable video page by clicking on link', async () => { | ||
await pomPages.mainPage.clickLinkByName(link.name); | ||
await waitForPageToLoadWithTimeout(page, 5000); | ||
}); | ||
await test.step('Click on play button of shoppable videos to play video', async () => { | ||
return pomPages.shoppableVideosPage.shoppableVideosVideoComponent.clickPlay(); | ||
}); | ||
await test.step('Validating that seek thumbnails video is playing', async () => { | ||
await pomPages.shoppableVideosPage.shoppableVideosVideoComponent.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,16 @@ | ||
import { Page } from '@playwright/test'; | ||
import { VideoComponent } from '../../components/videoComponent'; | ||
import { BasePage } from './BasePage'; | ||
const RECOMMENDATIONS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]'; | ||
|
||
/** | ||
* Video player examples recommendations page object | ||
*/ | ||
export class RecommendationsPage extends BasePage { | ||
public recommendationsVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.recommendationsVideoComponent = new VideoComponent(page, RECOMMENDATIONS_PAGE_VIDEO_SELECTOR); | ||
} | ||
} |
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 SEEK_THUMBNAILS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]'; | ||
|
||
/** | ||
* Video player examples seek thumbnails page object | ||
*/ | ||
export class SeekThumbnailsPage extends BasePage { | ||
public seekThumbnailsVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.seekThumbnailsVideoComponent = new VideoComponent(page, SEEK_THUMBNAILS_PAGE_VIDEO_SELECTOR); | ||
} | ||
} |
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 SHOPPABLE_VIDEOS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]'; | ||
|
||
/** | ||
* Video player examples shoppable vidoes page object | ||
*/ | ||
export class ShoppableVideosPage extends BasePage { | ||
public shoppableVideosVideoComponent: VideoComponent; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.shoppableVideosVideoComponent = new VideoComponent(page, SHOPPABLE_VIDEOS_PAGE_VIDEO_SELECTOR); | ||
} | ||
} |