-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Closed
Copy link
Labels
[Package] E2E Tests/packages/e2e-tests/packages/e2e-tests
Description
Description
When running the e2e tests locally, I often have to set a breakpoint or await page.pause()
immediately after the createNewPost()
. Otherwise, the test will fail since it's trying to do things to the page (typing, inserting blocks, etc) before the editor is ready for it to be doing those steps. I had thought it was only happening to me, but @scruffian and I paired and I can see the same issue happening on his setup.
So, I think we need to add some kind of "page ready" for createNewPost
. A lot of the tests seem to start with the expectation that the title is focused, so one potential would be adding an await for the post title to be focused.
Step-by-step reproduction instructions
- Pick an e2e test that relies on
createNewPost()
and run it locally, such asnpm run test:e2e:playwright -- -g "can be created by selecting text and using keyboard shortcuts"
. - The test will fail at the first assertion or element being missing, as it will do all the things in the test like typing and inserting blocks until it has to do something it can't locate. For example, if you create a post and start typing, it'll allow typing, but what you're typing won't appear on the page. What you're typing will only appear on the page once the editor is fully loaded. We need to wait until the page is fully loaded and the editor is ready before continuing with the test.
- Add
await page.pause()
after thecreateNewPost()
. - Run the same test again
- When you see the debugger popover, press Play to continue the test past the breakpoint.
- The test will pass since you allowed time for the editor to be fully loaded.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Metadata
Metadata
Assignees
Labels
[Package] E2E Tests/packages/e2e-tests/packages/e2e-tests