docs(trace-viewer-intro): fix code snippet for C# (#22648)

This commit is contained in:
Adrien Clerbois 2023-04-26 22:20:45 +02:00 committed by GitHub
parent f3852d4511
commit b7656e605a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,24 +62,24 @@ context.tracing.stop(path = "trace.zip")
```
```csharp
await using var browser = playwright.Chromium.LaunchAsync();
await using var browser = await Playwright.Chromium.LaunchAsync();
await using var context = await browser.NewContextAsync();
// Start tracing before creating / navigating a page.
await context.Tracing.StartAsync(new()
{
Screenshots = true,
Snapshots = true,
Sources = true
Screenshots = true,
Snapshots = true,
Sources = true
});
var page = context.NewPageAsync();
var page = await context.NewPageAsync();
await page.GotoAsync("https://playwright.dev");
// Stop tracing and export it into a zip archive.
await context.Tracing.StopAsync(new()
{
Path = "trace.zip"
Path = "trace.zip"
});
```