docs: fix tracing java examples (#7145)

This commit is contained in:
Yury Semikhatsky 2021-06-15 11:14:09 -07:00 committed by GitHub
parent 9550106e1d
commit 2b980da86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,12 +17,12 @@ await context.tracing.stop({ path: 'trace.zip' });
```java
Browser browser = chromium.launch();
BrowserContext context = browser.newContext();
context.tracing.start(new Tracing.StartOptions()
context.tracing().start(new Tracing.StartOptions()
.setScreenshots(true)
.setSnapshots(true);
.setSnapshots(true));
Page page = context.newPage();
page.goto("https://playwright.dev");
context.tracing.stop(new Tracing.StopOptions()
page.navigate("https://playwright.dev");
context.tracing().stop(new Tracing.StopOptions()
.setPath(Paths.get("trace.zip")));
```
@ -70,12 +70,12 @@ await context.tracing.stop({ path: 'trace.zip' });
```
```java
context.tracing.start(new Tracing.StartOptions()
context.tracing().start(new Tracing.StartOptions()
.setScreenshots(true)
.setSnapshots(true);
.setSnapshots(true));
Page page = context.newPage();
page.goto('https://playwright.dev');
context.tracing.stop(new Tracing.StopOptions()
page.navigate("https://playwright.dev");
context.tracing().stop(new Tracing.StopOptions()
.setPath(Paths.get("trace.zip")));
```