-
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
Testing: Add e2e test for basic ContrastChecker functionality #68856
base: trunk
Are you sure you want to change the base?
Testing: Add e2e test for basic ContrastChecker functionality #68856
Conversation
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. |
After the first test gets refined, it would be nice to add another test as @juanfra mentioned in #68853 (comment) |
} ); | ||
|
||
await page.getByRole( 'button', { name: 'Text', exact: true } ).click(); | ||
await page.getByLabel( 'Black' ).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.
I think this can be located using the following getByRole
selector.
await page.getByRole( 'option', { name: 'Black' } ).click();
await page.getByLabel( 'Black' ).click(); | ||
|
||
await page.getByRole( 'button', { name: 'Background' } ).click(); | ||
await page.getByLabel( 'Black' ).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.
Same.
@himanshupathak95, thanks for refactoring. Left two minor notes. Let's add the test case @afercia mentioned and this should be good to merge. I think we can just use test steps and test everything in a single test. |
Closes: #68853
What?
Add a basic end-to-end test for the ContrastChecker component that verifies the low-contrast warning appears immediately when the text and background colors have insufficient contrast.
Why?
After enhancing the ContrastChecker component in #68799, it's important to ensure its core functionality of detecting and warning about low-contrast color combinations works reliably.
Testing Instructions
npm run test:e2e -- editor/various/contrast-checker.spec.js
to execute the testScreencast
Screen.Recording.2025-01-24.at.13.25.25.mov