-
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 writing flow tests to Playwright #43637
Conversation
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
I wonder if we can speed up similar tests, where we just add a bunch of blocks and only need a clean slate for the next test. Maybe we can introduce a new test.beforeAll( async ( { admin } ) => {
await admin.createNewPost();
} );
test.beforeEach( async ( { editor } ) => {
// Reset post content before each test.
await editor.clearPostContent();
} ); It takes almost a minute to run this spec locally. |
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.
This is really well done! Thanks for the hard work!
How do you imagine that to work? We intentionally don't want to re-use the same let postId;
test.beforeAll( async ( { admin, writingFlowUtils, editor } ) => {
await admin.createNewPost();
await writingFlowUtils.addDemoContent();
postId = await editor.publishPost();
} );
test.beforeEach( async ( { page } ) => {
await page.goto( `/wp-admin/post.php?post=${postId}&action=edit` );
} ); As long as we don't save the post in the progress, we should get the same state across all tests. Will this solve the problem you mentioned? |
Thanks for refreshing my memory. Trying something like this is only worth it if we cut down the test run time. Probably too early to think about it. |
a4798fd
to
a977eea
Compare
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.
LGTM 👍. Just some nitpicks left and #43637 (comment) we can try.
Co-authored-by: Kai Hao <[email protected]>
Co-authored-by: Kai Hao <[email protected]>
250f310
to
4b45e2f
Compare
What?
Part of #38851.
Should solve #41396. 🤞
PR migrates the writing flow tests to Playwright.
Notes
should navigate empty paragraph(s),
so I removed it.Testing Instructions