docs: fix tracing java examples (#7145)
This commit is contained in:
parent
9550106e1d
commit
2b980da86b
|
|
@ -17,12 +17,12 @@ await context.tracing.stop({ path: 'trace.zip' });
|
||||||
```java
|
```java
|
||||||
Browser browser = chromium.launch();
|
Browser browser = chromium.launch();
|
||||||
BrowserContext context = browser.newContext();
|
BrowserContext context = browser.newContext();
|
||||||
context.tracing.start(new Tracing.StartOptions()
|
context.tracing().start(new Tracing.StartOptions()
|
||||||
.setScreenshots(true)
|
.setScreenshots(true)
|
||||||
.setSnapshots(true);
|
.setSnapshots(true));
|
||||||
Page page = context.newPage();
|
Page page = context.newPage();
|
||||||
page.goto("https://playwright.dev");
|
page.navigate("https://playwright.dev");
|
||||||
context.tracing.stop(new Tracing.StopOptions()
|
context.tracing().stop(new Tracing.StopOptions()
|
||||||
.setPath(Paths.get("trace.zip")));
|
.setPath(Paths.get("trace.zip")));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -70,12 +70,12 @@ await context.tracing.stop({ path: 'trace.zip' });
|
||||||
```
|
```
|
||||||
|
|
||||||
```java
|
```java
|
||||||
context.tracing.start(new Tracing.StartOptions()
|
context.tracing().start(new Tracing.StartOptions()
|
||||||
.setScreenshots(true)
|
.setScreenshots(true)
|
||||||
.setSnapshots(true);
|
.setSnapshots(true));
|
||||||
Page page = context.newPage();
|
Page page = context.newPage();
|
||||||
page.goto('https://playwright.dev');
|
page.navigate("https://playwright.dev");
|
||||||
context.tracing.stop(new Tracing.StopOptions()
|
context.tracing().stop(new Tracing.StopOptions()
|
||||||
.setPath(Paths.get("trace.zip")));
|
.setPath(Paths.get("trace.zip")));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue