Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

me-17971: test if videos on profiles page are playing #785

Merged
merged 1 commit into from
Jan 7, 2025
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
29 changes: 29 additions & 0 deletions test/e2e/specs/profilesPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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.Profiles);

vpTest(`Test if 3 videos on profiles page are playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to profiles page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that default profile video is playing', async () => {
await pomPages.profilesPage.profilesDefaultProfileVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Scroll until custom profile video element is visible', async () => {
await pomPages.profilesPage.profilesCustomProfileVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that custom profile video is playing', async () => {
await pomPages.profilesPage.profilesCustomProfileVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Scroll until custom profile overrides video element is visible', async () => {
await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that custom profile overrides video is playing', async () => {
await pomPages.profilesPage.profilesCustomProfileOverridesVideoComponent.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 @@ -19,6 +19,7 @@ import { MultiplePlayersPage } from './multiplePlayersPage';
import { PlaylistPage } from './playlistPage';
import { PlaylistByTagPage } from './playlistByTagPage';
import { PosterOptionsPage } from './posterOptionsPage';
import { ProfilesPage } from './profilesPage';

/**
* Page manager,
Expand Down Expand Up @@ -146,5 +147,9 @@ export class PageManager {
public get posterOptionsPage(): PosterOptionsPage {
return this.getPage(PosterOptionsPage);
}

public get profilesPage(): ProfilesPage {
return this.getPage(ProfilesPage);
}
}
export default PageManager;
22 changes: 22 additions & 0 deletions test/e2e/src/pom/profilesPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Page } from '@playwright/test';
import { VideoComponent } from '../../components/videoComponent';
import { BasePage } from './BasePage';
const PROFILES_PAGE_DEFAULT_PROFILE_VIDEO_SELECTOR = '//*[@id="player-default-profile_html5_api"]';
const PROFILES_PAGE_CUSTOM_PROFILE_VIDEO_SELECTOR = '//*[@id="player-custom-profile_html5_api"]';
const PROFILES_PAGE_CUSTOM_PROFILE_OVERRIDES_VIDEO_SELECTOR = '//*[@id="player-custom-profile-overrides_html5_api"]';

/**
* Video player examples profiles page object
*/
export class ProfilesPage extends BasePage {
public profilesDefaultProfileVideoComponent: VideoComponent;
public profilesCustomProfileVideoComponent: VideoComponent;
public profilesCustomProfileOverridesVideoComponent: VideoComponent;

constructor(page: Page) {
super(page);
this.profilesDefaultProfileVideoComponent = new VideoComponent(page, PROFILES_PAGE_DEFAULT_PROFILE_VIDEO_SELECTOR);
this.profilesCustomProfileVideoComponent = new VideoComponent(page, PROFILES_PAGE_CUSTOM_PROFILE_VIDEO_SELECTOR);
this.profilesCustomProfileOverridesVideoComponent = new VideoComponent(page, PROFILES_PAGE_CUSTOM_PROFILE_OVERRIDES_VIDEO_SELECTOR);
}
}
Loading