-
Notifications
You must be signed in to change notification settings - Fork 25
me-17957: test if video on autoplay on scroll page is playing #763
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
Conversation
✅ Deploy Preview for cld-video-player ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for cld-vp-esm-pages ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| async scrollToVideoElement() { | ||
| await this.page.locator(AUTOPLAY_ON_SCROLL_PAGE_VIDEO_SELECTOR).scrollIntoViewIfNeeded(); | ||
| // Wait briefly to give time for the autoplay to apply | ||
| await this.page.waitForTimeout(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use waitForTimeout, use expect.toPass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the waitForTimeout and used expect.toPass in test step of validating that the video is auto playing after scrolling
refael-m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
| * This action ensures the autoplay behavior is triggered when the video comes into view. | ||
| */ | ||
| async scrollToVideoElement() { | ||
| await this.page.locator(AUTOPLAY_ON_SCROLL_PAGE_VIDEO_SELECTOR).scrollIntoViewIfNeeded(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need it, you can use something like autoplayOnScrollVideoComponent. scrollIntoViewIfNeeded() in the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added BaseComponent and modified the videoComponent to extend it. Removed the scrollToVideoElement function and used scrollIntoViewIfNeeded() in the test.
| await test.step('Validating that the video is auto playing after scrolling (in case isPause is false)', async () => { | ||
| await expect(async () => { | ||
| expect(await pomPages.autoplayOnScrollPage.autoplayOnScrollVideoComponent.isPaused()).toEqual(false); | ||
| }).toPass({ intervals: [2], timeout: 1000 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you add 2 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to intervals: [500], timeout: 3000
refael-m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
Relevant task - https://cloudinary.atlassian.net/browse/ME-17957
This test is navigating to autoplay on scroll page (autoplay-on-scroll.html) and make sure that video is playing automatically on scroll.
First testing that the video is not playing (before scrolling), then scrolling until video element is visible and test that it is playing (checking that the video is not paused).