Skip to content

Commit

Permalink
vp test: test if videos on raw url page are playing (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayLevi authored Jan 7, 2025
1 parent 359facd commit 6422dfa
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/e2e/specs/rawUrlPage.spec.ts
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.RawURL);

vpTest(`Test if 2 videos on raw URL page are playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to raw URL page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that raw url video is playing', async () => {
await pomPages.rawUrlPage.rawUrlVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Validating that raw url adaptive video is playing', async () => {
await pomPages.rawUrlPage.rawUrlAdaptiveVideoComponent.validateVideoIsPlaying(true);
});
});
5 changes: 5 additions & 0 deletions test/e2e/src/pom/PageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { PlaylistPage } from './playlistPage';
import { PlaylistByTagPage } from './playlistByTagPage';
import { PosterOptionsPage } from './posterOptionsPage';
import { ProfilesPage } from './profilesPage';
import { RawUrlPage } from './rawUrlPage';

/**
* Page manager,
Expand Down Expand Up @@ -151,5 +152,9 @@ export class PageManager {
public get profilesPage(): ProfilesPage {
return this.getPage(ProfilesPage);
}

public get rawUrlPage(): RawUrlPage {
return this.getPage(RawUrlPage);
}
}
export default PageManager;
19 changes: 19 additions & 0 deletions test/e2e/src/pom/rawUrlPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Page } from '@playwright/test';
import { VideoComponent } from '../../components/videoComponent';
import { BasePage } from './BasePage';
const RAW_URL_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]';
const RAW_URL_PAGE_ADAPTIVE_VIDEO_SELECTOR = '//*[@id="adpPlayer_html5_api"]';

/**
* Video player examples raw URL page object
*/
export class RawUrlPage extends BasePage {
public rawUrlVideoComponent: VideoComponent;
public rawUrlAdaptiveVideoComponent: VideoComponent;

constructor(page: Page) {
super(page);
this.rawUrlVideoComponent = new VideoComponent(page, RAW_URL_PAGE_VIDEO_SELECTOR);
this.rawUrlAdaptiveVideoComponent = new VideoComponent(page, RAW_URL_PAGE_ADAPTIVE_VIDEO_SELECTOR);
}
}

0 comments on commit 6422dfa

Please sign in to comment.