woocommerce-paypal-payments/tests/qa-legacy-ui/global-setup.ts
Misha Utkin 9f1445265d
Migrate tests for legacy UI
- Tests migration
- Tests correction
- Folder structure and file naming fixes
2025-04-30 06:48:12 +02:00

29 lines
757 B
TypeScript

/**
* External dependencies
*/
import { FullConfig } from '@playwright/test';
import { restLogin, guestStorageState } from '@inpsyde/playwright-utils/build';
async function globalSetup( config: FullConfig ) {
const projectUse = config.projects[ 0 ].use;
await restLogin( {
baseURL: projectUse.baseURL,
storageStatePath: String( projectUse.storageState ),
httpCredentials: projectUse.httpCredentials,
user: {
// @ts-ignore
username: process.env.WP_USERNAME,
// @ts-ignore
password: process.env.WP_PASSWORD,
},
} );
await guestStorageState( {
baseURL: projectUse.baseURL,
httpCredentials: projectUse.httpCredentials,
storageStatePath: `${ process.env.STORAGE_STATE_PATH }/guest.json`,
} );
}
export default globalSetup;