mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
docs: java release notes snippet (#20200)
This commit is contained in:
parent
9edc0ad988
commit
0facbe001d
@ -8,6 +8,20 @@ toc_max_heading_level: 2
|
||||
|
||||
### New APIs
|
||||
|
||||
- New method [`method: Route.fetch`]:
|
||||
|
||||
```java
|
||||
page.route("**/api/settings", route -> {
|
||||
// Fetch original settings.
|
||||
APIResponse response = route.fetch();
|
||||
// Force settings theme to a predefined value.
|
||||
String body = response.text().replace("\"theme\":\"default\"",
|
||||
"\"theme\":\"Solorized\"");
|
||||
// Fulfill with modified data.
|
||||
route.fulfill(new Route.FulfillOptions().setResponse(response).setBody(body));
|
||||
});
|
||||
```
|
||||
|
||||
- New method [`method: Locator.all`] to iterate over all matching elements:
|
||||
|
||||
```java
|
||||
@ -28,7 +42,7 @@ toc_max_heading_level: 2
|
||||
```
|
||||
|
||||
```java
|
||||
element.selectOption('Red');
|
||||
element.selectOption("Red");
|
||||
```
|
||||
|
||||
### Browser Versions
|
||||
|
Loading…
Reference in New Issue
Block a user