Skip to content

Commit

Permalink
Global styles revisions e2e: tidy up selectors to open revisions panel (
Browse files Browse the repository at this point in the history
#57146)

* Since #56454 the revisions button is no longer in the drop down actions list so we don't need to click it.

* delete openRevisions
  • Loading branch information
ramonjd authored Dec 18, 2023
1 parent 1ac1d88 commit bf8614e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions test/e2e/specs/site-editor/user-global-styles-revisions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test.describe( 'Global styles revisions', () => {
await editor.saveSiteEditorEntities();

// Now there should be enough revisions to show the revisions UI.
await userGlobalStylesRevisions.openRevisions();
await page.getByRole( 'button', { name: 'Revisions' } ).click();

const revisionButtons = page.getByRole( 'button', {
name: /^Changes saved by /,
Expand Down Expand Up @@ -81,7 +81,7 @@ test.describe( 'Global styles revisions', () => {
.getByRole( 'option', { name: 'Color: Luminous vivid amber' } )
.click( { force: true } );

await userGlobalStylesRevisions.openRevisions();
await page.getByRole( 'button', { name: 'Revisions' } ).click();

const unSavedButton = page.getByRole( 'button', {
name: /^Unsaved changes/,
Expand Down Expand Up @@ -117,7 +117,7 @@ test.describe( 'Global styles revisions', () => {
} ) => {
await editor.canvas.locator( 'body' ).click();
await userGlobalStylesRevisions.openStylesPanel();
await userGlobalStylesRevisions.openRevisions();
await page.getByRole( 'button', { name: 'Revisions' } ).click();
const lastRevisionButton = page
.getByLabel( 'Global styles revisions' )
.getByRole( 'button' )
Expand Down Expand Up @@ -147,13 +147,6 @@ class UserGlobalStylesRevisions {
return [];
}

async openRevisions() {
await this.page
.getByRole( 'menubar', { name: 'Styles actions' } )
.click();
await this.page.getByRole( 'button', { name: 'Revisions' } ).click();
}

async openStylesPanel() {
await this.page
.getByRole( 'region', { name: 'Editor top bar' } )
Expand Down

1 comment on commit bf8614e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in bf8614e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7243378293
📝 Reported issues:

Please sign in to comment.