mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
29 lines
757 B
TypeScript
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;
|