diff --git a/packages/e2e-tests/specs/editor/blocks/gallery.test.js b/packages/e2e-tests/specs/editor/blocks/gallery.test.js index d70f123902eff6..1cc47904a08c39 100644 --- a/packages/e2e-tests/specs/editor/blocks/gallery.test.js +++ b/packages/e2e-tests/specs/editor/blocks/gallery.test.js @@ -85,7 +85,13 @@ describe( 'Gallery', () => { '.wp-block-gallery .wp-block-image' ); - await figureElement.click(); + // The Image needs to be selected from the List view panel due to the + // way that Image uploads take and lose focus. + await openListView(); + const imageListLink = await page.waitForXPath( + `//a[contains(text(), 'Image')]` + ); + await imageListLink.click(); const captionElement = await figureElement.$( '.block-editor-rich-text__editable'