From b243dc91b2c4cf8a8c0b15c63b494b8a9bf52073 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 22 Mar 2022 09:43:24 +1300 Subject: [PATCH] Gallery block: reduce e2e flakiness (#39565) * Select Image from list view panel to try and avoid issues with uploaded image getting and losing focus Co-authored-by: Glen Davies --- packages/e2e-tests/specs/editor/blocks/gallery.test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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'