Skip to content

Commit

Permalink
Retry one more time getting the last block after a delay on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhun committed Mar 23, 2021
1 parent 552721a commit be5d71b
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ describe( 'Gutenberg Editor Blocks test', () => {
lastBlockElement = await editorPage.getLastElementByXPath(
lastBlockAccessibilityLabel
);
if ( ! lastBlockElement ) {
const retryDelay = 5000;
// eslint-disable-next-line no-console
console.log(
`Warning: "lastBlockElement" was not found in the first attempt. Could be that all the blocks were not loaded yet.
Will retry one more time after ${ retryDelay / 1000 } seconds.`,
lastBlockElement
);
await editorPage.driver.sleep( retryDelay );
lastBlockElement = await editorPage.getLastElementByXPath(
lastBlockAccessibilityLabel
);
}
}

expect( lastBlockElement ).toBeTruthy();
Expand Down

0 comments on commit be5d71b

Please sign in to comment.