Skip to content
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

Merged
merged 3 commits into from
May 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/specs/site-editor/styles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Copy link
Member

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 😃

Copy link
Contributor Author

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 🙏

Copy link
Contributor

@SantosGuillamot SantosGuillamot May 29, 2024

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.

} );
} );
Loading