Fix failing e2e test merchant/settings-tax (#48792)

* Remove unnecessary step in the settings tax test

* Add changelog

* Remove unnecessary waituntil
This commit is contained in:
Veljko V 2024-06-25 13:46:52 +02:00 committed by GitHub
parent 7a8d5e0b6d
commit 134f431187
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 20 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: fix failing settings-tax e2e test

View File

@ -56,9 +56,7 @@ test.describe.serial( 'WooCommerce Tax Settings', () => {
} ); } );
test( 'can set tax options', async ( { page } ) => { test( 'can set tax options', async ( { page } ) => {
await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', { await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', {} );
waitUntil: 'networkidle',
} );
// Make sure we're on the tax tab // Make sure we're on the tax tab
await expect( page.locator( 'a.nav-tab-active' ) ).toContainText( await expect( page.locator( 'a.nav-tab-active' ) ).toContainText(
@ -117,26 +115,12 @@ test.describe.serial( 'WooCommerce Tax Settings', () => {
} ); } );
test( 'can add tax classes', async ( { page } ) => { test( 'can add tax classes', async ( { page } ) => {
await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', { await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', {} );
waitUntil: 'networkidle',
} );
await expect( page.locator( 'a.nav-tab-active' ) ).toContainText( await expect( page.locator( 'a.nav-tab-active' ) ).toContainText(
'Tax' 'Tax'
); );
// Clear out existing tax classes
await page.locator( '#woocommerce_tax_classes' ).fill( '' );
await page.locator( 'text=Save changes' ).click();
// Verify that the settings have been saved
await expect( page.locator( 'div.updated.inline' ) ).toContainText(
'Your settings have been saved.'
);
await expect( page.locator( '#woocommerce_tax_classes' ) ).toHaveValue(
''
);
// Add a "fancy" tax class // Add a "fancy" tax class
await page.locator( '#woocommerce_tax_classes' ).fill( 'Fancy' ); await page.locator( '#woocommerce_tax_classes' ).fill( 'Fancy' );
await page.locator( 'text=Save changes' ).click(); await page.locator( 'text=Save changes' ).click();
@ -152,8 +136,7 @@ test.describe.serial( 'WooCommerce Tax Settings', () => {
test( 'can set rate settings', async ( { page } ) => { test( 'can set rate settings', async ( { page } ) => {
await page.goto( await page.goto(
'wp-admin/admin.php?page=wc-settings&tab=tax&section=fancy', 'wp-admin/admin.php?page=wc-settings&tab=tax&section=fancy'
{ waitUntil: 'networkidle' }
); );
// Make sure the tax tab is active, with the "fancy" subsection // Make sure the tax tab is active, with the "fancy" subsection