Skip to content

Commit

Permalink
Make the adding patterns test stable (#26345)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Oct 21, 2020
1 parent e9cf78f commit 8c45369
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/e2e-test-utils/src/inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ export async function insertBlock( searchTerm ) {
*/
export async function insertPattern( searchTerm ) {
await searchForPattern( searchTerm );
const insertButton = (
await page.$x(
`//div[@role = 'button']//div[contains(text(), '${ searchTerm }')]`
)
)[ 0 ];
const insertButton = await page.waitForXPath(
`//div[@role = 'button']//div[contains(text(), '${ searchTerm }')]`
);
await insertButton.click();
// We should wait until the inserter closes and the focus moves to the content.
await waitForInserterCloseAndContentFocus();
Expand Down

0 comments on commit 8c45369

Please sign in to comment.