diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md b/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md index b26d814e555..a8be35c092e 100644 --- a/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Add Customers to analytics pages tested #7573 + # 0.1.1 - Allow packages to be built in isolation. #7286 diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Customers.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Customers.ts new file mode 100644 index 00000000000..55cecd48a25 --- /dev/null +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/pages/Customers.ts @@ -0,0 +1,9 @@ +/** + * Internal dependencies + */ +import { Analytics } from './Analytics'; + +export class Customers extends Analytics { + // The analytics pages are `analytics-{slug}`. + url = 'wp-admin/admin.php?page=wc-admin&path=%2Fcustomers'; +} diff --git a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts index 51a6d183dd2..65a8a41a1e4 100644 --- a/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts +++ b/plugins/woocommerce-admin/packages/admin-e2e-tests/src/specs/analytics/analytics.ts @@ -2,6 +2,7 @@ * Internal dependencies */ import { Analytics } from '../../pages/Analytics'; +import { Customers } from '../../pages/Customers'; import { Login } from '../../pages/Login'; /* eslint-disable @typescript-eslint/no-var-requires */ @@ -10,6 +11,7 @@ const { afterAll, beforeAll, describe, it } = require( '@jest/globals' ); const testAdminAnalyticsPages = () => { describe( 'Analytics pages', () => { const analyticsPage = new Analytics( page ); + const customersPage = new Customers( page ); const login = new Login( page ); beforeAll( async () => { @@ -73,6 +75,11 @@ const testAdminAnalyticsPages = () => { await analyticsPage.navigateToSection( 'settings' ); await analyticsPage.isDisplayed(); } ); + + it( 'A user can view the customers page without it crashing', async () => { + await customersPage.navigate(); + await customersPage.isDisplayed(); + } ); } ); };