E2E Utils: Wait for canvas instead of window.wp#58318
E2E Utils: Wait for canvas instead of window.wp#58318WunderBart wants to merge 1 commit intotrunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
This one's breaking because the I've refreshed my research, and it still doesn't seem to be supported natively by Playwright, as the canvas() {
return this.page.locator('.canvas').or(
this.page.frameLocator('canvas-iframe').locator('.canvas')
);
}The only way that would work would be making the |
What?
In testing against a slower env (wp.com in my case) it turned out that the
window.wp.*is ready before the canvas is, so calling utils likeinsertBlockimmediately after creating a post has no effect. Waiting for the canvas instead gives stable results and makes the affected utils work as expected.Why?
For stability.
Testing Instructions
Nothing particular. All the tests should pass.