Storagestateis OK but not in all test()

hi All,
I use playwright fw.
I save storagestate.json before test with global-setup.ts
in config i add: storageState: ‘storageState.json’,

my tests:

test.only(‘use state’, async ({ page,request }) => {
//this step is working with storagestate
await page.goto('IMS);
await page.getByRole(‘link’, { name: ‘Cases’ }).click()
//but this is not working the response is 401 but why, because i am not navigate windows or anything
const response = await request.get("https://stage-app-avander-ims-ui.azurewebsites.net/api/activity/list")
console.log((await response.body()).toString())
expect(response.status()).toBe(200)
})
thanks the help in advance

2 Likes