-
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
Migrate 'CPT locking' e2e tests to Playwright #55929
Conversation
Size Change: -2 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in dd80a96. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6785073352
|
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.
Thank you! Another good one! I left a small suggestion.
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.
Thank you! LGTM 👍
@@ -273,9 +273,15 @@ test.describe( 'Post-type locking', () => { | |||
.fill( 'p1' ); | |||
|
|||
await editor.clickBlockOptionsMenuItem( 'Delete' ); | |||
await expect.poll( editor.getBlocks ).not.toMatchObject( [ | |||
await expect.poll( editor.getBlocks ).toMatchObject( [ |
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.
Oh, okay I just now understand what you mean in the original code 😅. Probably what the intent is to check that the blocks doesn't contain the paragraph block? This works but we could also do the below if we want to emphasize the intent.
await expect.poll( editor.getBlocks ).not.toContainEqual(
expect.objectContaining( { name: 'core/paragraph' } )
);
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 current code probably isn't that different from what snapshots were testing, so from a migration PoV it should be good.
But I think we can use this pattern in the future.
* Migrate 'CPT locking' e2e tests to Playwright * Remove old test file and snapshot * Feedback
What?
Part of #38851.
Closes #44341.
Closes #48276.
PR migrates
cpt-locking.test.js
e2e tests to Playwright.Why?
See #38851.
Testing Instructions