Wait for notice text to be visible instead of checking data store
This commit is contained in:
parent
b47ddcceab
commit
f26892a646
|
@ -33,17 +33,12 @@ export class LocalPickupUtils {
|
|||
|
||||
async saveLocalPickupSettings() {
|
||||
await this.page.getByRole( 'button', { name: 'Save changes' } ).click();
|
||||
await this.page.waitForFunction( () => {
|
||||
return window.wp.data
|
||||
.select( 'core/notices' )
|
||||
.getNotices()
|
||||
.some(
|
||||
( notice: Notice ) =>
|
||||
notice.status === 'success' &&
|
||||
notice.content ===
|
||||
'Local Pickup settings have been saved.'
|
||||
);
|
||||
} );
|
||||
|
||||
// Wait for the snackbar to appear with the success notice showing.
|
||||
await this.page
|
||||
.getByLabel( 'Dismiss this notice' )
|
||||
.getByText( 'Local Pickup settings have been saved.' )
|
||||
.isVisible();
|
||||
}
|
||||
|
||||
async enableLocalPickup() {
|
||||
|
|
Loading…
Reference in New Issue