Skip to content

Commit

Permalink
Revert selector updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanand01 committed Jun 27, 2024
1 parent 080a14d commit d5d9a38
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/e2e-test-utils/src/publishPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function openPublishPanel() {
if (isEntityPublishToggle) {
await page.waitForSelector('.editor-entities-saved-states__save-button');
} else {
await page.waitForSelector('.editor-post-publish-button__button');
await page.waitForSelector('.editor-post-publish-button');
}
}

Expand Down Expand Up @@ -60,13 +60,16 @@ async function publishPost() {
}

// Publish the post
await page.click('.editor-post-publish-button__button');
await page.click('.editor-post-publish-button');

// Wait until the selector returns a truthy value.
await page.waitForFunction(
() =>
wp.data.select('core/editor').getEditedPostAttribute('status') ===
'publish'
'publish' &&
document.querySelector(
'.editor-post-publish-button[aria-disabled="true"]'
).textContent === 'Update'
);

// The first time around the selector might return undefined.
Expand Down

0 comments on commit d5d9a38

Please sign in to comment.