Skip to content

Commit

Permalink
vp test: remove toPass wrap from existing specs (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayLevi authored Jan 6, 2025
1 parent 60c543c commit bc08526
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 27 deletions.
6 changes: 2 additions & 4 deletions test/e2e/specs/autoplayOnScrollPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -23,8 +23,6 @@ vpTest(`Test if video on autoplay on scroll page is playing as expected`, async
await pomPages.autoplayOnScrollPage.autoplayOnScrollVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that the video is auto playing after scrolling', async () => {
await expect(async () => {
await pomPages.autoplayOnScrollPage.autoplayOnScrollVideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.autoplayOnScrollPage.autoplayOnScrollVideoComponent.validateVideoIsPlaying(true);
});
});
6 changes: 2 additions & 4 deletions test/e2e/specs/chaptersPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -21,8 +21,6 @@ vpTest(`Test if 3 videos on chapters page are playing as expected`, async ({ pag
await pomPages.chaptersPage.chapterAutoVttFileVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that chapters auto vtt file video is playing', async () => {
await expect(async () => {
await pomPages.chaptersPage.chapterAutoVttFileVideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.chaptersPage.chapterAutoVttFileVideoComponent.validateVideoIsPlaying(true);
});
});
10 changes: 3 additions & 7 deletions test/e2e/specs/cldAnalyticsPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -21,16 +21,12 @@ vpTest(`Test if 4 videos on Cloudinary analytics page are playing as expected`,
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataObjectVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that Cloudinary analytics custom data object video is playing', async () => {
await expect(async () => {
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataObjectVideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataObjectVideoComponent.validateVideoIsPlaying(true);
});
await test.step('Scroll until Cloudinary analytics custom data function video element is visible', async () => {
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataFunctionVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that Cloudinary analytics custom data function video is playing', async () => {
await expect(async () => {
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataFunctionVideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.cldAnalyticsPage.cldAnalyticsCustomDataFunctionVideoComponent.validateVideoIsPlaying(true);
});
});
6 changes: 2 additions & 4 deletions test/e2e/specs/codecsAndFormats.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -21,8 +21,6 @@ vpTest(`Test if 3 videos on codecs and formats page are playing as expected`, as
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that VP9 video is playing', async () => {
await expect(async () => {
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.codecsAndFormatsPage.codecsAndFormatsVp9VideoComponent.validateVideoIsPlaying(true);
});
});
6 changes: 2 additions & 4 deletions test/e2e/specs/colorsApiPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -21,8 +21,6 @@ vpTest(`Test if 3 videos on colors API page are playing as expected`, async ({ p
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that light skin video is playing', async () => {
await expect(async () => {
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.validateVideoIsPlaying(true);
});
});
6 changes: 2 additions & 4 deletions test/e2e/specs/multiplePlayersPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vpTest } from '../fixtures/vpTest';
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
Expand All @@ -21,8 +21,6 @@ vpTest(`Test if 3 videos on multiple players page are playing as expected`, asyn
await pomPages.colorsApiPage.colorsApiLightSkinVideoComponent.locator.scrollIntoViewIfNeeded();
});
await test.step('Validating that player 3 video is playing', async () => {
await expect(async () => {
await pomPages.multiplePlayersPage.multiplePlayersPlayer3VideoComponent.validateVideoIsPlaying(true);
}).toPass({ intervals: [500], timeout: 3000 });
await pomPages.multiplePlayersPage.multiplePlayersPlayer3VideoComponent.validateVideoIsPlaying(true);
});
});

0 comments on commit bc08526

Please sign in to comment.