Replace networkidle with web assertions

This commit is contained in:
rodelgc 2023-05-17 23:56:54 +08:00
parent 30e27254c1
commit bdb4fa35fe
2 changed files with 16 additions and 4 deletions

View File

@ -32,6 +32,12 @@ test.describe( 'Add variable product', () => {
}
);
await test.step( 'Expect permalink to appear.', async () => {
const permalink = page.locator( '#sample-permalink' );
await expect( permalink ).toBeVisible();
} );
await test.step(
'Select the "Variable product" product type.',
async () => {

View File

@ -223,8 +223,11 @@ test.describe( 'Update variations', () => {
} );
await test.step( 'Click "Save changes".', async () => {
await page.locator( 'button.save-variation-changes' ).click();
await page.waitForLoadState( 'networkidle' );
const saveButton = page.getByRole( 'button', {
name: 'Save changes',
} );
await saveButton.click();
await expect( saveButton ).toBeDisabled();
} );
await test.step( 'Click on the "Variations" tab.', async () => {
@ -549,8 +552,11 @@ test.describe( 'Update variations', () => {
} );
await test.step( 'Click "Save changes"', async () => {
await page.getByRole( 'button', { name: 'Save changes' } ).click();
await page.waitForLoadState( 'networkidle' );
const saveButton = page.getByRole( 'button', {
name: 'Save changes',
} );
await saveButton.click();
await expect( saveButton ).toBeDisabled();
} );
await test.step( 'View the product from the shop', async () => {