-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Try stabilizing customize widgets e2e tests #32023
Try stabilizing customize widgets e2e tests #32023
Conversation
Size Change: 0 B Total Size: 1.62 MB ℹ️ View Unchanged
|
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.
Let's give it a try!
// | ||
// eslint-disable-next-line no-restricted-syntax | ||
await page.waitForTimeout( 300 ); | ||
|
||
const blockOption = await find( { | ||
role: 'option', | ||
name: blockName, |
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.
Can't we use normal selectors here? And then we can just wait for the selector?
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.
Ah, I guess that wouldn't work with the animation anyway.
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.
find
does wait for the element, but yeah, the problem wasn't about that.
Description
Attempts to solve the intermittent failure in the customize widgets tests observed here - https://github.com/WordPress/gutenberg/runs/2620274056.
The test attempts to insert a paragraph and a heading, and then use the trailing appender to add a Search block.
But the test failure snapshots show that the test is sometimes inserting two paragraphs instead.
My guess is that the Paragraph is incorrectly inserted due to the animation the block library panel has in the customizer. The test is attempting to click the Heading block while the animation is happening, but clicks the Paragraph block that's next to it.
There isn't a trailing appender in this situation, because the appender doesn't appear after paragraphs, so the test fails.
This PR adds a timeout to wait for the animation to finish. The animation is 0.18 seconds, so waiting 300ms should be plenty.
(edit: animations could be disabled entirely in e2e tests when this issue is solved - #32024)