@@ -27,23 +27,25 @@ async function globalSetup() {
27
27
const authenticateToBoundary = async ( ) => {
28
28
// Log in and save the authenticated state to reuse in tests
29
29
const browser = await chromium . launch ( ) ;
30
- const page = await browser . newPage ( ) ;
30
+ const browserContext = await browser . newContext ( ) ;
31
+ const page = await browserContext . newPage ( ) ;
31
32
await page . goto ( baseUrl ) ;
32
33
33
34
const loginPage = new LoginPage ( page ) ;
34
35
await loginPage . login (
35
36
process . env . E2E_PASSWORD_ADMIN_LOGIN_NAME ,
36
37
process . env . E2E_PASSWORD_ADMIN_PASSWORD ,
37
38
) ;
38
- const storageState = await page
39
- . context ( )
40
- . storageState ( { path : authenticatedState } ) ;
39
+ const storageState = await browserContext . storageState ( {
40
+ path : authenticatedState ,
41
+ } ) ;
41
42
42
43
const state = JSON . parse ( storageState . origins [ 0 ] . localStorage [ 0 ] . value ) ;
43
44
44
45
// Set the token in the environment for use in API requests
45
46
process . env . E2E_TOKEN = state . authenticated . token ;
46
47
48
+ await browserContext . close ( ) ;
47
49
await browser . close ( ) ;
48
50
} ;
49
51
@@ -90,4 +92,10 @@ export const test = baseTest.extend({
90
92
vaultAddr : process . env . E2E_VAULT_ADDR_PUBLIC ,
91
93
vaultAddrPrivate : process . env . E2E_VAULT_ADDR_PRIVATE ,
92
94
workerTagEgress : process . env . E2E_WORKER_TAG_EGRESS ,
95
+ request : async ( { playwright } , use ) => {
96
+ const request = await playwright . request . newContext ( {
97
+ baseURL : process . env . BOUNDARY_ADDR ,
98
+ } ) ;
99
+ await use ( request ) ;
100
+ } ,
93
101
} ) ;
0 commit comments