Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/analyticsPageVideoIsPlaying.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { vpTest } from '../fixtures/vpTest';
Copy link
Contributor

@refael-m refael-m Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the file name to analyticsPage.spec.ts, Write here all the tests for the analytics page here

Copy link
Contributor Author

@ShayLevi ShayLevi Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

import { expect, test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';

// Link to Analytics page
const link = getLinkByName(ExampleLinkName.Analytics);
/**
* Testing if video on analytics page is playing by checking that is pause return false.
*/
vpTest(`Test if video on analytics page is playing as expected`, async ({ page, pomPages }) => {
await test.step('Navigate to analytics page by clicking on link', async () => {
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
});
await test.step('Validating that the video is playing (in case isPause is false)', async () => {
expect(await pomPages.analyticsPage.videoAnalyticsPage.isPaused()).toEqual(false);
});
});
8 changes: 8 additions & 0 deletions test/e2e/src/pom/PageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Page } from '@playwright/test';
import { HighlightsGraphPage } from './highlightsGraphPage';
import { BasePage } from './BasePage';
import { MainPage } from './mainPage';
import { AnalyticsPage } from './analyticsPage';

/**
* Page manager,
Expand Down Expand Up @@ -40,5 +41,12 @@ export class PageManager {
public get highlightGraphPage(): HighlightsGraphPage {
return this.getPage(HighlightsGraphPage);
}

/**
* Returns Analytics page object
*/
public get analyticsPage(): AnalyticsPage {
return this.getPage(AnalyticsPage);
}
}
export default PageManager;
16 changes: 16 additions & 0 deletions test/e2e/src/pom/analyticsPage.ts
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 ANALYTICS_PAGE_VIDEO_SELECTOR = '//*[@id="player_html5_api"]';

/**
* Video player examples analytics page object
*/
export class AnalyticsPage extends BasePage {
public videoAnalyticsPage: VideoComponent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a page change the name, analyticsVideoComponent maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.


constructor(page: Page) {
super(page);
this.videoAnalyticsPage = new VideoComponent(page, ANALYTICS_PAGE_VIDEO_SELECTOR);
}
}
Loading