docs(auth): small improvement to .NET storageState example (#30313)

This commit is contained in:
Christopher Dunderdale 2024-04-15 10:32:12 +02:00 committed by GitHub
parent 6ad48fb594
commit f7e612fb4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,15 +296,16 @@ context = browser.new_context(storage_state="state.json")
```csharp
// Save storage state into the file.
// Tests are executed in <TestProject>\bin\Debug\netX.0\ therefore relative path is used to reference playwright/.auth created in project root
await context.StorageStateAsync(new()
{
Path = "state.json"
Path = "../../../playwright/.auth/state.json"
});
// Create a new context with the saved storage state.
var context = await browser.NewContextAsync(new()
{
StorageStatePath = "state.json"
StorageStatePath = "../../../playwright/.auth/state.json"
});
```