Skip to content

Commit

Permalink
Wait for the notice specifically for the published post
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 authored and tellthemachines committed Dec 14, 2021
1 parent e1cae89 commit 5bbcc41
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ describe( 'Multi-entity save flow', () => {
await assertExistance( saveA11ySelector, false );

await publishPost();
// Wait for the success notice specifically for the published post.
// `publishPost()` has a similar check but it only checks for the
// existence of any snackbars. In this case, there's another "Site updated"
// notice which will be sufficient for that and thus creating a false-positive.
await page.waitForXPath(
'//*[@id="a11y-speak-polite"][contains(text(), "Post published")]'
);

// Update the post.
await page.click( '.editor-post-title' );
Expand Down

0 comments on commit 5bbcc41

Please sign in to comment.