docs: fix java code snippets (#8319)

This commit is contained in:
Yury Semikhatsky 2021-08-19 11:24:38 -07:00 committed by GitHub
parent 5357b2f280
commit 3aae170b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -166,7 +166,7 @@ await page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.js
```java
page.route("**/xhr_endpoint", route -> route.fulfill(
new Route.FulfillOptions().setPath(Paths.get("mock_data.json")));
new Route.FulfillOptions().setPath(Paths.get("mock_data.json"))));
```
```python async

View File

@ -28,19 +28,19 @@ await context.tracing.stop({ path: 'trace.zip' });
```
```java
Browser browser = chromium.launch();
Browser browser = browserType.launch();
BrowserContext context = browser.newContext();
// Start tracing before creating / navigating a page.
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");
page.navigate("https://playwright.dev");
// Stop tracing and export it into a zip archive.
context.tracing.stop(new Tracing.StopOptions()
context.tracing().stop(new Tracing.StopOptions()
.setPath(Paths.get("trace.zip")));
```