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

Block styles variations E2E: wait for Save button before editing global styles #62915

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions test/e2e/specs/site-editor/block-style-variations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ test.describe( 'Block Style Variations', () => {
},
},
} );
// The save button has been re-enabled.

// Wait for the save button to be re-enabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers here, just making sure I understand the change here:

This change is now checking that that Save is visible, rather than enabled. From looking at the editor manually, while saving, the button says "Saving" rather than "Save", so .toBeVisible() is a good check to use, as it'll only pass if the button says "Save" rather than "Saving". Also, once the revision has been saved the button is in a disabled state, so toBeVisible is a more reliable check than toBeEnabled.

Assuming that's all how it's meant to be, that sounds great to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what you said, thanks for confirming.

Much better expressed than what my caveman brain was thinking: "Wait for save. Save there. Good save."

await expect(
page
.getByRole( 'region', { name: 'Editor top bar' } )
.getByRole( 'button', { name: 'Save' } )
).toBeEnabled();
).toBeVisible();

// Second revision (current).
await siteEditorBlockStyleVariations.saveRevision( stylesPostId, {
blocks: {
Expand Down
Loading