-
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
Migrate Toolbar roving tabindex tests to Playwright #46634
Conversation
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
let ariaLabel = await this.page.evaluate( () => | ||
document.activeElement.getAttribute( 'aria-label' ) | ||
); | ||
// If the labels don't match, try pressing Up Arrow to focus the block wrapper in non-content editable block. | ||
if ( ariaLabel !== label ) { | ||
await this.page.keyboard.press( 'ArrowUp' ); | ||
ariaLabel = await this.page.evaluate( () => | ||
document.activeElement.getAttribute( 'aria-label' ) | ||
); | ||
} |
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.
I couldn't update this section to an accessible implementation. This implementation also exists in the testing of image block.
Four playwright tests were run, all of which passed. |
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, @t-hamano! The migration looks good to me.
What?
Part of #38851.
Migrate
toolbar-roving-tabindex.test.js
to its Playwright version.Why?
Part of #38851.
How?
See MIGRATION.md for migration steps.
All test cases were migrated as is, except for the rewrite to the role selector and the utility class.
Testing Instructions
Run
npm run test:e2e:playwright test/e2e/specs/editor/various/toolbar-roving-tabindex.test.js
About flaky test
In #45588, the following tests are reported as flaky:
can reach toolbar items with arrow keys after pressing alt+F10
In this test, the focus is expected to be on the button with the "Bold" label.
3d6979e2428f7caf5f21b8aa17a610ff.mp4
However, somehow the focus is on the button with the "Align" label, and the test fails.
I have done nothing special but would like to close #45588 if it is confirmed that the instability has been resolved by migration.