-
Notifications
You must be signed in to change notification settings - Fork 96
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
test: add test for 'about' youtube modal #990
base: main
Are you sure you want to change the base?
Conversation
It worked when I ran in --debug mode, but failed without it. |
The har file recording does not include youtube - it's limited on line # 9 to The safe approach for these cases would be to wait until the play action is completed -
|
it seems to wait forever for the hover method, though locally for me it does run successfully.
|
Seems like YouTube are blocking bots - and they are right 😅 - our automation is a bot indeed. So maybe we should avoid testing youtube for now 🙃 . If youtube will have a bug, it's not our to fix. |
const Visible = await iframeElement.isVisible() | ||
expect(Visible).toBe(true) |
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.
the toBeVisible
assertion can be a better fit for this use case - if the element is not visible (for example because it's loading or has entrance animation) it will wait for it to appear
https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-visible
expect(videoSrc).toBe( | ||
'https://www.youtube.com/embed/videoseries?si=oTULlxq8Is188hPu&list=PL6Rh06rT7uiX1AQE-lm55hy-seL3idx3T', | ||
) |
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.
toHaveAttribute could also be a better choice here - up to you :)
I tried to fix it and made a mess pushing :) |
Description
I added a test that makes sure the YouTube modal can play,
but I had a problem with the HAR file.
It will probably not pass, but I need a place to discuss it in the PR comments section :)