-
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: fix Site Editor Styles test #62111
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. |
Size Change: 0 B Total Size: 1.74 MB ℹ️ View Unchanged
|
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!
Let's give this a try.
@@ -54,6 +54,6 @@ test.describe( 'Styles', () => { | |||
await paddingControl.fill( '2' ); | |||
|
|||
// Check the padding value | |||
await expect( block ).toHaveCSS( 'padding-left', '35.4644px' ); | |||
await expect( block ).toHaveCSS( 'padding-left', '35.4932px' ); |
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.
Maybe we should set a px value instead in the padding control for testing 😃
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.
That's true, but I don't have much time left today, so I'd appreciate it if you could just merge it as is, or update the tests 🙏
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 it could be achieved with something like this, although I am not sure if those are the best selectors:
// find the second padding control
await page.getByRole("button", { name: "Set custom size" }).nth(1).click();
await page.locator('[id*="inspector-input-control"]').fill("35");
// Check the padding value
await expect(block).toHaveCSS("padding-left", "35px");
Happy to make a follow-up PR if we consider it necessary.
3655cf7
to
1a55c15
Compare
Do we know why the test didn't fail in the PR? |
@youknowriad, the branch on |
I have addressed this and the tests should continue to pass. |
Now that I set a px value, this test should be stable. I would like to merge this PR. |
Thanks for fixing this @t-hamano 🍺 ! |
* e2e: fix Site Editor Styles test * Set a px value Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
* e2e: fix Site Editor Styles test * Set a px value Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
What?
This PR fixes the failing E2E tests.
Why?
This failure first occurred after #61835 was merged, which changed the border to box-shadow in the site editor sidebar. This changes the width of the editor canvas by 1px.
The failing test, on the other hand, applies padding in the global styles and asserts a calculated value. But in TT3, this spacing value uses the clamp function, so it depends on the width of the editor canvas. Since the width of the editor canvas has changed by 1px, it seems the calculated value would change too.
Testing Instructions
The E2E tests should pass, but Linting will fail. Linting will be fixed in #62109.