Skip to content

Commit

Permalink
Revert to class-based save detection
Browse files Browse the repository at this point in the history
The `.getByRole()` way resolves a bit too early.
  • Loading branch information
mirka committed May 19, 2023
1 parent 5d53981 commit a2bf020
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/e2e-test-utils-playwright/src/editor/site-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export async function saveSiteEditorEntities( this: Editor ) {
.getByRole( 'button', { name: 'Save', exact: true } )
.click();

// Wait for the saved status.
await editorTopBar.getByRole( 'button', { name: 'Saved' } ).waitFor();
// A role selector cannot be used here because it needs to check that the `is-busy` class is not present.
await this.page
.locator( '[aria-label="Editor top bar"] [aria-label="Saved"].is-busy' )
.waitFor( {
state: 'hidden',
} );
}

0 comments on commit a2bf020

Please sign in to comment.