[e2e tests] Clean up created test products in product edit tests (#51112)

This commit is contained in:
Adrian Moldovan 2024-09-03 17:02:58 +01:00 committed by GitHub
parent 57ef5a884e
commit c656fdc59b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev

View File

@ -67,7 +67,10 @@ test(
} );
await test.step( 'publish the updated product', async () => {
await page.getByRole( 'button', { name: 'Update' } ).click();
await page
.locator( '#publishing-action' )
.getByRole( 'button', { name: 'Update' } )
.click();
} );
await test.step( 'verify the changes', async () => {
@ -276,7 +279,7 @@ test(
.toBe( 0 );
await expect
.soft( await page.locator( 'bdi' ).first() )
.soft( page.locator( 'bdi' ).first() )
.toContainText( expectedRegularPrice );
}
} );
@ -340,7 +343,7 @@ test(
test(
'increasing the sale price from 0 does not change the sale price when bulk editing products',
{ tag: [ '@gutenberg', '@services' ] },
async ( { page, api } ) => {
async ( { page, api, products } ) => {
let product;
await api
.post( 'products', {
@ -355,6 +358,8 @@ test(
} )
.then( ( response ) => {
product = response.data;
// For cleanup: products from this list are deleted in the fixture
products.push( product );
} );
const salePriceIncrease = 10;