Add explicit waits

This commit is contained in:
rodelgc 2023-05-17 15:20:02 +08:00
parent fd5bc2a420
commit 043bfa1943
1 changed files with 4 additions and 1 deletions

View File

@ -203,7 +203,6 @@ async function createVariableProductFixture( baseURL ) {
} }
test.describe( 'Add New Variable Product Page', () => { test.describe( 'Add New Variable Product Page', () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );
test.beforeAll( async ( { baseURL } ) => { test.beforeAll( async ( { baseURL } ) => {
@ -375,6 +374,7 @@ test.describe( 'Add New Variable Product Page', () => {
'Save before going to the Variations tab to prevent variations from all attributes to be automatically created.', 'Save before going to the Variations tab to prevent variations from all attributes to be automatically created.',
async () => { async () => {
await page.locator( '#save-post' ).click(); await page.locator( '#save-post' ).click();
await page.waitForLoadState( 'networkidle' );
} }
); );
@ -431,6 +431,7 @@ test.describe( 'Add New Variable Product Page', () => {
await test.step( 'Click "Save Draft" button.', async () => { await test.step( 'Click "Save Draft" button.', async () => {
await page.locator( '#save-post' ).click(); await page.locator( '#save-post' ).click();
await page.waitForLoadState( 'networkidle' );
} ); } );
await test.step( await test.step(
@ -776,6 +777,7 @@ test.describe( 'Add New Variable Product Page', () => {
// Save before going to the Variations tab to prevent variations from all attributes to be automatically created // Save before going to the Variations tab to prevent variations from all attributes to be automatically created
await page.locator( '#save-post' ).click(); await page.locator( '#save-post' ).click();
await page.waitForLoadState( 'networkidle' );
await expect( await expect(
page.getByText( 'Product draft updated. ' ) page.getByText( 'Product draft updated. ' )
).toBeVisible(); ).toBeVisible();
@ -804,6 +806,7 @@ test.describe( 'Add New Variable Product Page', () => {
} }
await page.locator( '#save-post' ).click(); await page.locator( '#save-post' ).click();
await page.waitForLoadState( 'networkidle' );
await expect( await expect(
page.getByText( 'Product draft updated. ' ) page.getByText( 'Product draft updated. ' )
).toBeVisible(); ).toBeVisible();