Experiment: Add first e2e tests for Taxonomies#77828
Experiment: Add first e2e tests for Taxonomies#77828ntsekouras wants to merge 2 commits intotrunkfrom
Conversation
|
Size Change: 0 B Total Size: 7.82 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 6aa7bc7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25156523057
|
tyxla
left a comment
There was a problem hiding this comment.
LGTM 👍
Just added a couple of non-blocking suggestions to make the tests more reliable.
| // The slug field runs an async uniqueness check; the form's | ||
| // `isValid` stays false while it's in flight, so wait for the | ||
| // REST call to settle before submitting. | ||
| await Promise.all( [ | ||
| page.waitForResponse( | ||
| ( resp ) => | ||
| resp.url().includes( `/${ TAXONOMIES_REST_BASE }?` ) && | ||
| resp.url().includes( 'slug=genre' ) | ||
| ), | ||
| page | ||
| .getByRole( 'textbox', { name: 'Taxonomy key' } ) | ||
| .fill( 'genre' ), | ||
| ] ); |
There was a problem hiding this comment.
This feels a bit fragile; should we do something like this instead:
| // The slug field runs an async uniqueness check; the form's | |
| // `isValid` stays false while it's in flight, so wait for the | |
| // REST call to settle before submitting. | |
| await Promise.all( [ | |
| page.waitForResponse( | |
| ( resp ) => | |
| resp.url().includes( `/${ TAXONOMIES_REST_BASE }?` ) && | |
| resp.url().includes( 'slug=genre' ) | |
| ), | |
| page | |
| .getByRole( 'textbox', { name: 'Taxonomy key' } ) | |
| .fill( 'genre' ), | |
| ] ); | |
| await page.getByRole( 'textbox', { name: 'Taxonomy key' } ).fill( 'genre' ); | |
| await expect( page.getByRole( 'button', { name: 'Create' } ) ).toBeEnabled(); |
There was a problem hiding this comment.
We can't do that because the button doesn't get disabled/busy based on the form's validity. I've added a todo though to explore that. I didn't do it for now because I had tried that recently in quick edit action for posts and there were some nuances (especially with the slug field). I'll explore though in this form separately, because we might not have similar nuances.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
First e2e tests for the Taxonomies experiment.