Replace deprecated page methods.
Blur and wait for autosave. Add a few explicit waits.
This commit is contained in:
parent
3be1f45f2e
commit
fd5bc2a420
|
@ -29,14 +29,20 @@ test.describe( 'Add New Coupon Page', () => {
|
|||
waitUntil: 'networkidle',
|
||||
} );
|
||||
|
||||
await page.fill( '#title', couponCode );
|
||||
await page.locator( '#title' ).fill( couponCode );
|
||||
|
||||
await page.fill( '#woocommerce-coupon-description', 'test coupon' );
|
||||
// Blur then wait for the auto-save to finish
|
||||
await page.locator( '#title' ).blur();
|
||||
await page.waitForLoadState( 'networkidle' );
|
||||
|
||||
await page.fill( '#coupon_amount', '100' );
|
||||
await page
|
||||
.locator( '#woocommerce-coupon-description' )
|
||||
.fill( 'test coupon' );
|
||||
|
||||
await expect( page.locator( '#publish:not(.disabled)' ) ).toBeVisible();
|
||||
await page.click( '#publish' );
|
||||
await page.locator( '#coupon_amount' ).fill( '100' );
|
||||
|
||||
await page.locator( '#publish:not(.disabled)' ).click();
|
||||
await page.waitForLoadState( 'networkidle' );
|
||||
|
||||
await expect(
|
||||
page
|
||||
|
|
Loading…
Reference in New Issue