Skip to content

Commit ec0746e

Browse files
committed
vp test: adding toPass to validateVideoIsPlaying
1 parent b4d787a commit ec0746e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/e2e/components/videoComponent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class VideoComponent extends BaseComponent {
3737
* Pass `true` if the video is expected to be playing, or `false` if it is expected to be paused.
3838
*/
3939
public async validateVideoIsPlaying(expectedPlaying: boolean): Promise<void> {
40-
expect(await this.isPaused()).not.toEqual(expectedPlaying);
40+
await expect(async () => {
41+
expect(await this.isPaused()).not.toEqual(expectedPlaying);
42+
}).toPass({ intervals: [500], timeout: 3000 });
4143
}
4244
}

test/e2e/specs/cldAnalyticsPage.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ vpTest(`Test if 4 videos on Cloudinary analytics page are playing as expected`,
1212
await waitForPageToLoadWithTimeout(page, 5000);
1313
});
1414
await test.step('Validating that Cloudinary analytics video is playing', async () => {
15-
await expect(async () => {
16-
await pomPages.cldAnalyticsPage.cldAnalyticsVideoComponent.validateVideoIsPlaying(true);
17-
}).toPass({ intervals: [500], timeout: 3000 });
15+
await pomPages.cldAnalyticsPage.cldAnalyticsVideoComponent.validateVideoIsPlaying(true);
1816
});
1917
await test.step('Validating that Cloudinary analytics ADP video is playing', async () => {
2018
await pomPages.cldAnalyticsPage.cldAnalyticsAdpVideoComponent.validateVideoIsPlaying(true);

0 commit comments

Comments
 (0)