Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/e2e/specs/playlistPage.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.Playlist);

vpTest(`Test if 2 videos on playlist page are playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to playlist page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that horizontal playlist video is playing', async () => {
await pomPages.playlistPage.playlistHorizontalVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Validating that vertical playlist video is playing', async () => {
await pomPages.playlistPage.playlistVerticalVideoComponent.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 @@ -16,6 +16,7 @@ import { FloatingPlayerPage } from './floatingPlayerPgae';
import { FluidLayoutsPage } from './fluidLayoutsPage';
import { ForceHlsSubtitlesPage } from './forceHlsSubtitlesPage';
import { MultiplePlayersPage } from './multiplePlayersPage';
import { PlaylistPage } from './playlistPage';

/**
* Page manager,
Expand Down Expand Up @@ -131,5 +132,9 @@ export class PageManager {
public get multiplePlayersPage(): MultiplePlayersPage {
return this.getPage(MultiplePlayersPage);
}

public get playlistPage(): PlaylistPage {
return this.getPage(PlaylistPage);
}
}
export default PageManager;
19 changes: 19 additions & 0 deletions test/e2e/src/pom/playlistPage.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 PLAYLIST_PAGE_HORIZONTAL_VIDEO_SELECTOR = '//*[@id="player-horizontal_html5_api"]';
const PLAYLIST_PAGE_VERTICAL_VIDEO_SELECTOR = '//*[@id="player-vertical_html5_api"]';

/**
* Video player examples playlist page object
*/
export class PlaylistPage extends BasePage {
public playlistHorizontalVideoComponent: VideoComponent;
public playlistVerticalVideoComponent: VideoComponent;

constructor(page: Page) {
super(page);
this.playlistHorizontalVideoComponent = new VideoComponent(page, PLAYLIST_PAGE_HORIZONTAL_VIDEO_SELECTOR);
this.playlistVerticalVideoComponent = new VideoComponent(page, PLAYLIST_PAGE_VERTICAL_VIDEO_SELECTOR);
}
}
Loading