Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs: add Java 1.18 release notes (#11477)
Andrey Lushnikov82c8baf9f6de
diff --git a/docs/src/api/class-playwrightassertions.md b/docs/src/api/class-playwrightassertions.mdindex 778a3f09a3..176a2babc5 100644--- a/docs/src/api/class-playwrightassertions.md+++ b/docs/src/api/class-playwrightassertions.md@@ -54,16 +54,6 @@ reached. You can pass this timeout as an option.By default, the timeout for assertions is set to 5 seconds.-**langs: java**To use Playwright assertions add the following dependency into the `pom.xml` of your Maven project:--```xml java-<dependency>- <groupId>com.microsoft.playwright</groupId>- <artifactId>assertions</artifactId>- <version>1.17.0</version>-</dependency>-```-## method: PlaywrightAssertions.expectAPIResponse* langs: js, java- alias-java: assertThatdiff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.mdindex dd97085259..70b5d9b622 100644--- a/docs/src/release-notes-java.md+++ b/docs/src/release-notes-java.md@@ -5,6 +5,90 @@ title: "Release notes"<!-- TOC -->+## Version 1.18++### API Testing++Playwright for Java 1.18 introduces new [API Testing](./api/class-apirequestcontext) that lets you send requests to the server directly from Java!+Now you can:++- test your server API+- prepare server side state before visiting the web application in a test+- validate server side post-conditions after running some actions in the browser++To do a request on behalf of Playwright's Page, use **new [`property: Page.request`] API**:++```java+// Do a GET request on behalf of page+APIResponse res = page.request().get("http://example.com/foo.json");+```++Read more about it in our [API testing guide](./test-api-testing).++### Web-First Assertions++Playwright for Java 1.18 introduces [Web-First Assertions](./api/class-playwrightassertions).++Consider the following example:++```java+...+import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;++public class TestExample {+ ...+ @Test+ void statusBecomesSubmitted() {+ ...+ page.click("#submit-button");+ assertThat(page.locator(".status")).hasText("Submitted");+ }+}+```++Playwright will be re-testing the node with the selector `.status` until+fetched Node has the `"Submitted"` text. It will be re-fetching the node and+checking it over and over, until the condition is met or until the timeout is+reached. You can pass this timeout as an option.++Read more in [our documentation](./api/class-playwrightassertions).++### Locator Improvements++- [`method: Locator.dragTo`]+- Each locator can now be optionally filtered by the text it contains:+ ```java+ page.locator("li", new Page.LocatorOptions().setHasText("my item"))+ .locator("button").click();+ ```+ Read more in [locator documentation](./api/class-locator#locator-locator-option-has-text)++### Tracing Improvements++[Tracing](./api/class-tracing.md) now can embed Java sources to recorded+traces, using new [`setSources`](./api/class-tracing#tracing-start-option-sources) option.++++### New APIs & changes++- [`acceptDownloads`](./api/class-browser#browser-new-context-option-accept-downloads) option now defaults to `true`.++++### Browser Versions++- Chromium 99.0.4812.0+- Mozilla Firefox 95.0+- WebKit 15.4++This version was also tested against the following stable channels:++- Google Chrome 97+- Microsoft Edge 97+++## Version 1.17### Frame Locators