-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Link control: migrate tests to Playwright. Can be created by selecting text and using keyboard shortcuts #50996
Conversation
Size Change: +1.32 kB (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Flaky tests detected in 13000dc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5092495551
|
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 so much for tackling this 👏 Left initial observations.
0ff31a9
to
9d3e062
Compare
expect( await editor.getEditedPostContent() ).toMatchSnapshot(); | ||
|
||
// Tab back to the Submit and apply the link. | ||
await page.getByRole( 'button', { name: 'Save' } ).click(); |
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 failing. We should probably limit the scope under some parent locator. I found out that the link setting popover doesn't have an accessible name. When I'm testing it, I also noticed that the focus is trapped inside the popover, so maybe what it should really be is a modal/dialog instead? This can all be a follow-up though 😅.
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.
Good point, I could only target the parent using a class. Let's follow up by improving the popover and updating the test as necessary
This just needs a ✅ I believe |
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.
Thanks!
|
||
// Tab back to the Submit and apply the link. | ||
await page | ||
.locator( '.block-editor-link-control' ) |
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.
Nit: Let's add a temporary comment explaining why a CSS selector is needed here. Same for #51001. ❤️
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, I appreciate your reviews as always!
…g text and using keyboard shortcuts (WordPress#50996) * initial setup * fixed utils * update snapshots, commented waitForURLFieldAutoFocus * removed old test * removed unneeded code * removed old snapshots * use locator instead of component class * remove appender function * use locators instead of tabbing around * rename button * avoid snapshots and fix locator for Save button * removed snapshots * added comment
What?
Part of #50995
This PR migrates the test "Can be created by selecting text and using keyboard shortcuts" for the link control component to playwright
Why?
In an effort to migrate our e2e tests to use playwright, we've decided to pick up some of the tests for this component as we work on it to improve it, instead of trying to maintain the puppeteer tests.
How?
Following the guidelines for e2e tests migrations
Testing Instructions
run
npm run test:e2e:playwright -- -g "Can be created by selecting text and using keyboard shortcuts"
and the test should pass