Commit e4eaf0211ce for woocommerce
commit e4eaf0211ce85030a044e0c8e46f6a91863454a2
Author: Jamel Noel Reid <MrJnrman@users.noreply.github.com>
Date: Mon Aug 31 17:19:14 2026 -0500
Remove core E2E tests covered elsewhere (#68207)
- checkout-link: the "Logged-in user" describe was a verbatim copy of
"Guest user" and set no storage state, so it ran anonymously too.
- lost-password: both tests drove wp-login.php, not WooCommerce's own
my-account/lost-password/ flow, which account-emails.spec.ts covers
more strongly (it asserts the mail is actually sent, with content).
- order-status-filter: eight generated cases each asserted only that a
filter link became current and the list was non-empty. Collapsed to
one case, and strengthened it to assert the listed rows carry the
filtered status -- which none of the eight did. The other seven
statuses are still seeded, so this now also proves they are excluded.
Verified with `playwright --list`: 1176 -> 1162 tests.
diff --git a/plugins/woocommerce/changelog/core-e2e-remove-redundant-tests b/plugins/woocommerce/changelog/core-e2e-remove-redundant-tests
new file mode 100644
index 00000000000..3b361ea0005
--- /dev/null
+++ b/plugins/woocommerce/changelog/core-e2e-remove-redundant-tests
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Remove core E2E tests whose coverage exists elsewhere: the duplicated logged-in Checkout Link block, the WordPress-core lost password specs, and seven of eight identical order status filter cases.
diff --git a/plugins/woocommerce/tests/e2e/tests/checkout/checkout-link.spec.ts b/plugins/woocommerce/tests/e2e/tests/checkout/checkout-link.spec.ts
index 5003b0fb552..20fd95c2ac0 100644
--- a/plugins/woocommerce/tests/e2e/tests/checkout/checkout-link.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/checkout/checkout-link.spec.ts
@@ -192,128 +192,4 @@ test.describe( 'Checkout Link Endpoint', () => {
}
);
} );
-
- test.describe( 'Logged-in user', () => {
- test(
- 'Logged-in user redirected to checkout with correct cart',
- { tag: [ tags.PAYMENTS, tags.SERVICES ] },
- async ( { page, baseURL, products, coupon } ) => {
- // Visit checkout-link
- const checkoutLink = `${ baseURL }/checkout-link?products=${ products[ 0 ].id },${ products[ 1 ].id }&coupon=${ coupon.code }`;
- await page.goto( checkoutLink );
-
- // Should redirect to checkout
- await expect( page ).toHaveURL( /\/checkout/ );
-
- // Assert both products are in the cart
- const cartItems = page.locator(
- '.wc-block-components-order-summary'
- );
- await expect( cartItems ).toContainText( products[ 0 ].name );
- await expect( cartItems ).toContainText( products[ 1 ].name );
-
- // Assert coupon is applied
- await expect(
- page.getByText( `Coupon: ${ coupon.code }` )
- ).toBeVisible();
- }
- );
-
- test(
- 'Logged-in user sees error when invalid coupon is applied',
- { tag: [ tags.PAYMENTS, tags.SERVICES ] },
- async ( { page, baseURL, products } ) => {
- // Visit checkout-link with invalid coupon
- const checkoutLink = `${ baseURL }/checkout-link?products=${ products[ 0 ].id },${ products[ 1 ].id }&coupon=INVALID_COUPON`;
- await page.goto( checkoutLink );
-
- // Should redirect to checkout
- await expect( page ).toHaveURL( /\/checkout/ );
-
- // Assert both products are in the cart
- const cartItems = page.locator(
- '.wc-block-components-order-summary'
- );
- await expect( cartItems ).toContainText( products[ 0 ].name );
- await expect( cartItems ).toContainText( products[ 1 ].name );
-
- // Assert error notice is shown for invalid coupon
- await expect(
- page.getByText(
- 'Coupon "INVALID_COUPON" cannot be applied because it does not exist.'
- )
- ).toBeVisible();
- }
- );
-
- test(
- 'Logged-in user sees error when invalid products are provided',
- { tag: [ tags.PAYMENTS, tags.SERVICES ] },
- async ( { page, baseURL, products } ) => {
- // Visit checkout-link with invalid product ID in list.
- const checkoutLink = `${ baseURL }/checkout-link?products=${ products[ 0 ].id },999999`;
- await page.goto( checkoutLink );
-
- // Should redirect to checkout
- await expect( page ).toHaveURL( /\/checkout/ );
-
- // Assert error notice is shown for invalid product
- await expect(
- page.getByText(
- 'Product with ID "999999" was not found and cannot be added to the cart.'
- )
- ).toBeVisible();
- }
- );
-
- test(
- 'Logged-in user sees error when invalid product is provided',
- { tag: [ tags.PAYMENTS, tags.SERVICES ] },
- async ( { page, baseURL } ) => {
- // Visit checkout-link with invalid product ID only.
- const checkoutLink = `${ baseURL }/checkout-link?products=999999`;
- await page.goto( checkoutLink );
-
- // Should redirect to cart if cart is empty.
- await expect( page ).toHaveURL( /\/cart/ );
-
- // Assert error notice is shown for invalid product
- await expect(
- page.getByText(
- 'Product with ID "999999" was not found and cannot be added to the cart.'
- )
- ).toBeVisible();
-
- // Cart should be empty
- await expect(
- page.getByText( 'Your cart is currently empty!' )
- ).toBeVisible();
- }
- );
-
- test(
- 'Logged-in user sees error when invalid link is provided',
- { tag: [ tags.PAYMENTS, tags.SERVICES ] },
- async ( { page, baseURL } ) => {
- // Visit checkout-link with invalid product ID only.
- const checkoutLink = `${ baseURL }/checkout-link?products=abc`;
- await page.goto( checkoutLink );
-
- // Should redirect to cart if cart is empty.
- await expect( page ).toHaveURL( /\/cart/ );
-
- // Assert error notice is shown for invalid product
- await expect(
- page.getByText(
- 'The provided checkout link was out of date or invalid. No products were added to the cart.'
- )
- ).toBeVisible();
-
- // Cart should be empty
- await expect(
- page.getByText( 'Your cart is currently empty!' )
- ).toBeVisible();
- }
- );
- } );
} );
diff --git a/plugins/woocommerce/tests/e2e/tests/order/order-status-filter.spec.ts b/plugins/woocommerce/tests/e2e/tests/order/order-status-filter.spec.ts
index f5c2787e643..d5ec5e60bee 100644
--- a/plugins/woocommerce/tests/e2e/tests/order/order-status-filter.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/order/order-status-filter.spec.ts
@@ -10,7 +10,7 @@ import { tags, expect, test } from '../../fixtures/fixtures';
import { ADMIN_STATE_PATH } from '../../playwright.config';
const orderBatchId: number[] = [];
-const statusColumnTextSelector = 'mark.order-status > span';
+const statusColumnSelector = 'mark.order-status';
// Define order statuses to filter against
const orderStatus = [
@@ -54,21 +54,25 @@ test.describe(
} );
} );
- for ( let i = 0; i < orderStatus.length; i++ ) {
- test( `should filter by ${ orderStatus[ i ][ 0 ] }`, async ( {
- page,
- } ) => {
- await page.goto( 'wp-admin/admin.php?page=wc-orders' );
+ // Processing is representative: the status filter is one code path. The
+ // other seven statuses are still seeded in beforeAll, so asserting that
+ // none of them appear also proves the filter excludes what it should.
+ test( 'should filter by Processing', async ( { page } ) => {
+ await page.goto( 'wp-admin/admin.php?page=wc-orders' );
- await page.locator( `li.${ orderStatus[ i ][ 1 ] }` ).click();
- await expect(
- page.locator( `li.${ orderStatus[ i ][ 1 ] } > a.current` )
- ).toBeVisible();
- const countElements = await page
- .locator( statusColumnTextSelector )
- .count();
- await expect( countElements ).toBeGreaterThan( 0 );
- } );
- }
+ await page.locator( 'li.wc-processing' ).click();
+ await expect(
+ page.locator( 'li.wc-processing > a.current' )
+ ).toBeVisible();
+
+ await expect(
+ page.locator( `${ statusColumnSelector }.status-processing` )
+ ).not.toHaveCount( 0 );
+ await expect(
+ page.locator(
+ `${ statusColumnSelector }:not(.status-processing)`
+ )
+ ).toHaveCount( 0 );
+ } );
}
);
diff --git a/plugins/woocommerce/tests/e2e/tests/user/lost-password.spec.ts b/plugins/woocommerce/tests/e2e/tests/user/lost-password.spec.ts
deleted file mode 100644
index 0af8d607161..00000000000
--- a/plugins/woocommerce/tests/e2e/tests/user/lost-password.spec.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * External dependencies
- */
-import { test, expect } from '@playwright/test';
-
-/**
- * Internal dependencies
- */
-import { admin } from '../../test-data/data';
-import { tags } from '../../fixtures/fixtures';
-
-test.describe( 'Can go to lost password page and submit the form', () => {
- test(
- 'can visit the lost password page from the login page',
- { tag: [ tags.NOT_E2E ] },
- async ( { page } ) => {
- await page.goto( 'wp-login.php' );
- await page
- .getByRole( 'link', { name: 'Lost your password?' } )
- .click();
- expect( page.url() ).toContain(
- '/wp-login.php?action=lostpassword'
- );
- await expect( page.getByText( 'Get New Password' ) ).toBeVisible();
- }
- );
-
- test(
- 'can submit the lost password form',
- { tag: [ tags.NOT_E2E ] },
- async ( { page } ) => {
- await page.goto( 'wp-login.php?action=lostpassword' );
- await page.getByLabel( 'Username or Email Address' ).click();
- await page
- .getByLabel( 'Username or Email Address' )
- .fill( admin.username );
- await page
- .getByRole( 'button', { name: 'Get New Password' } )
- .click();
-
- const emailSentMessage = page.getByText(
- 'check your email for the confirmation link'
- );
- const emailNotSentMessage = page.getByText(
- 'the email could not be sent'
- );
-
- // We don't have to care if the email was sent, we just want to know the button click attempts a reset.
- await expect(
- emailSentMessage.or( emailNotSentMessage )
- ).toBeVisible();
- }
- );
-} );