Skip to content

Commit

Permalink
Gallery block: reduce e2e flakiness (#39565)
Browse files Browse the repository at this point in the history
* Select Image from list view panel to try and avoid issues with uploaded image getting and losing focus

Co-authored-by: Glen Davies <[email protected]>
  • Loading branch information
glendaviesnz and Glen Davies authored Mar 21, 2022
1 parent 945ce7d commit b243dc9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/e2e-tests/specs/editor/blocks/gallery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b243dc9

Please sign in to comment.