diff --git a/tests/e2e/utils/frontend/frontend-utils.page.ts b/tests/e2e/utils/frontend/frontend-utils.page.ts index 01df6174a5c..f0ae11cee13 100644 --- a/tests/e2e/utils/frontend/frontend-utils.page.ts +++ b/tests/e2e/utils/frontend/frontend-utils.page.ts @@ -5,50 +5,15 @@ import { Page } from '@playwright/test'; import { RequestUtils } from '@wordpress/e2e-test-utils-playwright'; import { expect } from '@woocommerce/e2e-playwright-utils'; -const { - CUSTOMER_USER, - CUSTOMER_PASSWORD, - CUSTOMER_USER_EMAIL, - CUSTOMER_FIRST_NAME, - CUSTOMER_LAST_NAME, -} = process.env; +/** + * Internal dependencies + */ +import { customer } from '../../test-data/data/data'; export class FrontendUtils { page: Page; requestUtils: RequestUtils; - private customer = { - username: CUSTOMER_USER ?? 'customer', - password: CUSTOMER_PASSWORD ?? 'password', - email: - CUSTOMER_USER_EMAIL ?? 'customer@woocommercecoree2etestsuite.com', - first_name: CUSTOMER_FIRST_NAME ?? 'Jane', - last_name: CUSTOMER_LAST_NAME ?? 'Smith', - billing: { - us: { - first_name: 'Maggie', - last_name: 'Simpson', - address: '123 Evergreen Terrace', - city: 'Springfield', - country: 'US', - state: 'OR', - zip: '97403', - phone: '555 555-5555', - email: 'customer@example.com', - }, - malta: { - first_name: 'Maggie', - last_name: 'Simpson', - address: '123 Evergreen Terrace', - city: 'Valletta', - country: 'MT', - zip: 'VT 1011', - phone: '555 555-5555', - email: 'vt-customer@example.com', - }, - }, - }; - constructor( page: Page, requestUtils: RequestUtils ) { this.page = page; this.requestUtils = requestUtils; @@ -172,10 +137,10 @@ export class FrontendUtils { await expect( this.page ).toHaveTitle( /My account/ ); await this.page .locator( 'input[name="username"]' ) - .fill( this.customer.username ); + .fill( customer.username ); await this.page .locator( 'input[name="password"]' ) - .fill( this.customer.password ); + .fill( customer.password ); await this.page.locator( 'text=Log In' ).click(); // eslint-disable-next-line playwright/no-networkidle await this.page.waitForLoadState( 'networkidle' );