From 134f4311874b916af2a5272d349c561d33aed1e7 Mon Sep 17 00:00:00 2001 From: Veljko V Date: Tue, 25 Jun 2024 13:46:52 +0200 Subject: [PATCH] Fix failing e2e test merchant/settings-tax (#48792) * Remove unnecessary step in the settings tax test * Add changelog * Remove unnecessary waituntil --- .../changelog/e2e-fix-settings-tax-test | 4 ++++ .../tests/merchant/settings-tax.spec.js | 23 +++---------------- 2 files changed, 7 insertions(+), 20 deletions(-) create mode 100644 plugins/woocommerce/changelog/e2e-fix-settings-tax-test diff --git a/plugins/woocommerce/changelog/e2e-fix-settings-tax-test b/plugins/woocommerce/changelog/e2e-fix-settings-tax-test new file mode 100644 index 00000000000..ec58d08b567 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-settings-tax-test @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +E2E tests: fix failing settings-tax e2e test \ No newline at end of file diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/settings-tax.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/settings-tax.spec.js index 81799a99951..d27f5c27c8c 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/settings-tax.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/settings-tax.spec.js @@ -56,9 +56,7 @@ test.describe.serial( 'WooCommerce Tax Settings', () => { } ); test( 'can set tax options', async ( { page } ) => { - await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', { - waitUntil: 'networkidle', - } ); + await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', {} ); // Make sure we're on the tax tab 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 } ) => { - await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', { - waitUntil: 'networkidle', - } ); + await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=tax', {} ); await expect( page.locator( 'a.nav-tab-active' ) ).toContainText( '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 await page.locator( '#woocommerce_tax_classes' ).fill( 'Fancy' ); await page.locator( 'text=Save changes' ).click(); @@ -152,8 +136,7 @@ test.describe.serial( 'WooCommerce Tax Settings', () => { test( 'can set rate settings', async ( { page } ) => { await page.goto( - 'wp-admin/admin.php?page=wc-settings&tab=tax§ion=fancy', - { waitUntil: 'networkidle' } + 'wp-admin/admin.php?page=wc-settings&tab=tax§ion=fancy' ); // Make sure the tax tab is active, with the "fancy" subsection