e2e-test: Fix dirty state e2e test#22448
Conversation
A change to the inserter was causing the edit meant for the document root to be applied to the template part instead. Obviousy, this meant that the test considered the wrong entity to be dirty, which resulted in a failure. This updates the test to always insert the block in the document, and not in a template part.
|
Size Change: +989 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
Co-authored-by: Enrique Piqueras <epiqueras@users.noreply.github.com>
|
Thank you for the fast fix 👍 |
|
Noting that I've observed at least one intermittent failure from this test (after these changes), in #22379 (a documentation-only pull request): |
|
I also saw that intermittently yesterday. Not sure what it could be caused by 🤔 is there a way we can store video recordings of failed tests as artifacts with puppeteer? |
|
Yes, but not for free. |
|
@noahtallen There's a few debugging tips in the end-to-end testing overview, specifically for network and CPU throttling which can help better emulate a Travis-like environment if you're having trouble to reproduce locally: |
|
I'm not too familiar with what exactly this is testing or if there's something we can use here, but at least for this specific interaction of "Add a block", there's an |
|
@aduth Yeah, I was originally solving the problem of "insert the block at the end of the wp_template" (so that the parent entity would be dirtied). Since the current selection in the e2e test was in a nested template part block, the block was being inserted there, and not in the template. But we may be able to use |
|
#22532 tries this approach |
Description
Fixes test skipped in #22447.
In #22140, a change was made to the inserter to insert the block at the current selection. Since the e2e test had selected test inside a nested template part, the block was being inserted there, though it was supposed to be inserted at the end of the document. Before that PR, the behavior was to insert it at the end of the document, and not at the current selection.
The fix is to select the document in the block breadcrumb before adding the block. This clears any selection so that adding the block block dirties the root entity and not a nested entity.
How has this been tested?
e2e tests should pass.
Types of changes
Bug fix
Checklist: