-
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
E2E tests: Add width and color test to button block #46452
Conversation
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
await page.click( | ||
'role=button[name=/^Gradient control point at position 0% with color code/]' | ||
); |
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.
The button to change the point of the gradient actually has the following text:
Gradient control point at position 0% with color code rgb(6,147,227).
I used forward matching because rgb values may change with WordPress and Gutenberg updates.
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.
For other themes, the test will fail because the selectors in the gradient palette don’t match.
Is this still true if we use regex matching here?
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! Mostly look good to me! Sad that we don't have accessible name for the custom color picker. It might be worth to add that in another PR.
@kevin940726 |
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 👍.
While I have concerns for overusing snapshots here but we don't have other easy alternatives for now until #45709 (reviews/feedback welcome!).
I think we also use twentytwentyone locally too, no? |
For some reason, the switch to Twenty Twenty One doesn't seem to be working in my environment ( Is this a problem with my environment or is it not intended? |
Interesting. 🤔 Yeah, it's not intended, I thought it would always use twentytwentyone. |
Perhaps the theme switching doesn't occur when running a specific test? If so, that would make sense. |
Found the bug! Opened #46459. Thanks a lot! |
Closes: #29992
What?
This PR adds a test for width and colors (text, background color, gradient color) to the E2E test for the button block.
Why?
To cover more test cases and to prevent regressions reported in #29992.
How?
This test adds the following five test cases:
Testing Instructions
Run either of the following:
npm run test:e2e:playwright test/e2e/specs/editor/blocks/buttons.spec.js
npm run test:e2e:playwright test/e2e/specs/editor/blocks/buttons.spec.js -- --headed