diff --git a/docs/profiles.html b/docs/profiles.html index 6cc4b7c6..68c743ba 100644 --- a/docs/profiles.html +++ b/docs/profiles.html @@ -23,6 +23,10 @@ @@ -77,6 +101,34 @@
Player with default profile

Example Code:

+
+    
+
+      <video
+        id="player-default-profile"
+        controls
+        autoplay
+        muted
+        class="cld-video-player"
+        width="500">
+      </video>
+
+      
+      
+        window.addEventListener('load', async function() {
+          const playerWithDefaultProfile = await cloudinary.player('player-default-profile', {
+            cloudName: 'demo',
+            profile: 'cld-default',
+          });
+
+          playerWithDefaultProfile.source('sea_turtle');
+        }, false);
+      
+    
+ +
Player with custom profile
+

Example Code:

+
     
 
@@ -155,6 +207,7 @@ 

Example Code:

     
+
       <video
         id="player-custom-profile-overrides"
         controls
@@ -163,6 +216,7 @@ 

Example Code:

class="cld-video-player" width="500"> </video> +
window.addEventListener('load', async function() { diff --git a/test/e2e/specs/analyticsPage.spec.ts b/test/e2e/specs/analyticsPage.spec.ts new file mode 100644 index 00000000..13e3945c --- /dev/null +++ b/test/e2e/specs/analyticsPage.spec.ts @@ -0,0 +1,20 @@ +import { vpTest } from '../fixtures/vpTest'; +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.analyticsVideoComponent.isPaused()).toEqual(false); + }); +}); diff --git a/test/e2e/src/pom/PageManager.ts b/test/e2e/src/pom/PageManager.ts index 63cebaab..19359c2d 100644 --- a/test/e2e/src/pom/PageManager.ts +++ b/test/e2e/src/pom/PageManager.ts @@ -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, @@ -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; diff --git a/test/e2e/src/pom/analyticsPage.ts b/test/e2e/src/pom/analyticsPage.ts new file mode 100644 index 00000000..0c104a91 --- /dev/null +++ b/test/e2e/src/pom/analyticsPage.ts @@ -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 analyticsVideoComponent: VideoComponent; + + constructor(page: Page) { + super(page); + this.analyticsVideoComponent = new VideoComponent(page, ANALYTICS_PAGE_VIDEO_SELECTOR); + } +}