Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 3, 2023
1 parent 6f20790 commit 628bfb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/e2e-test-utils-playwright/src/editor/publish-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import type { Editor } from './index';
*/
export async function publishPost( this: Editor ) {
await this.page.click( 'role=button[name="Publish"i]' );
const publishEditorPanel = this.page.locator(
'role=region[name="Editor publish"i]'
const entitiesSaveButton = this.page.locator(
'role=region[name="Editor publish"i] >> role=button[name="Save"i]'
);

const isPublishEditorVisible = await publishEditorPanel.isVisible();
const isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();

// Save any entities.
if ( isPublishEditorVisible ) {
if ( isEntitiesSavePanelVisible ) {
// Handle saving entities.
await this.page.click(
'role=region[name="Editor publish"i] >> role=button[name="Save"i]'
Expand Down

0 comments on commit 628bfb4

Please sign in to comment.