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