Skip to content

Commit

Permalink
Fix flaky media inserter drag-and-dropping e2e test (#50740)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored May 18, 2023
1 parent 0f893f7 commit 02a7c49
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/e2e/specs/editor/blocks/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,16 @@ test.describe( 'Image', () => {
} );

async function openMediaTab() {
await page
.getByRole( 'button', { name: 'Toggle block inserter' } )
.click();
const blockInserter = page.getByRole( 'button', {
name: 'Toggle block inserter',
} );
const isClosed =
( await blockInserter.getAttribute( 'aria-pressed' ) ) ===
'false';

if ( isClosed ) {
await blockInserter.click();
}

await blockLibrary.getByRole( 'tab', { name: 'Media' } ).click();

Expand Down

0 comments on commit 02a7c49

Please sign in to comment.