Skip to content

Commit 6422dfa

Browse files
authored
vp test: test if videos on raw url page are playing (#786)
1 parent 359facd commit 6422dfa

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

test/e2e/specs/rawUrlPage.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.RawURL);
8+
9+
vpTest(`Test if 2 videos on raw URL page are playing as expected`, async ({ page, pomPages }) => {
10+
await test.step('Navigate to raw URL 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 raw url video is playing', async () => {
15+
await pomPages.rawUrlPage.rawUrlVideoComponent.validateVideoIsPlaying(true);
16+
});
17+
await test.step('Validating that raw url adaptive video is playing', async () => {
18+
await pomPages.rawUrlPage.rawUrlAdaptiveVideoComponent.validateVideoIsPlaying(true);
19+
});
20+
});

test/e2e/src/pom/PageManager.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { PlaylistPage } from './playlistPage';
2020
import { PlaylistByTagPage } from './playlistByTagPage';
2121
import { PosterOptionsPage } from './posterOptionsPage';
2222
import { ProfilesPage } from './profilesPage';
23+
import { RawUrlPage } from './rawUrlPage';
2324

2425
/**
2526
* Page manager,
@@ -151,5 +152,9 @@ export class PageManager {
151152
public get profilesPage(): ProfilesPage {
152153
return this.getPage(ProfilesPage);
153154
}
155+
156+
public get rawUrlPage(): RawUrlPage {
157+
return this.getPage(RawUrlPage);
158+
}
154159
}
155160
export default PageManager;

test/e2e/src/pom/rawUrlPage.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Page } from '@playwright/test';
2+
import { VideoComponent } from '../../components/videoComponent';
3+
import { BasePage } from './BasePage';
4+
const RAW_URL_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]';
5+
const RAW_URL_PAGE_ADAPTIVE_VIDEO_SELECTOR = '//*[@id="adpPlayer_html5_api"]';
6+
7+
/**
8+
* Video player examples raw URL page object
9+
*/
10+
export class RawUrlPage extends BasePage {
11+
public rawUrlVideoComponent: VideoComponent;
12+
public rawUrlAdaptiveVideoComponent: VideoComponent;
13+
14+
constructor(page: Page) {
15+
super(page);
16+
this.rawUrlVideoComponent = new VideoComponent(page, RAW_URL_PAGE_VIDEO_SELECTOR);
17+
this.rawUrlAdaptiveVideoComponent = new VideoComponent(page, RAW_URL_PAGE_ADAPTIVE_VIDEO_SELECTOR);
18+
}
19+
}

0 commit comments

Comments
 (0)