I’m using Playwright to test UI and would like to only have to log in once per test suite. I’m currently using the way that Playwright says to do it Authentication | Playwright by having a setup project that runs first and am storing the storageState.
await page.context().storageState({ path: userDir });
When I do this, it is not actually saving all of the data. It is storing the keys, but not the data for it.
{
"cookies": [
{
"name": "JSESSIONID",
"value": "F1E094139209EAEEABF3AA681CE2C01C",
"domain": "my.app",
"path": "/myContainer",
"expires": -1,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
}
],
"origins": [
{
"origin": "https://my.app:8444",
"localStorage": [
{
"name": "userProperties",
"value": "\"{}\"" <--- no values being saved here
}
]
}
]
}
Is this not ever going to work for allowing me to then create another browser context and apply this storage state to bypass the need to log in again?
What is the proper way to do this then?