Releases: microsoft/playwright-java
v1.18.0
API Testing
Playwright for Java 1.18 introduces new API Testing 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 page.request()
API:
// 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.
Web-First Assertions
Playwright for Java 1.18 introduces Web-First Assertions.
Consider the following example:
...
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.
Locator Improvements
Locator.dragTo()
- Each locator can now be optionally filtered by the text it contains:
Read more in locator documentation
page.locator("li", new Page.LocatorOptions().setHasText("my item")) .locator("button").click();
Tracing Improvements
Tracing now can embed Java sources to recorded
traces, using new setSources
option.
New APIs & changes
acceptDownloads
option now defaults totrue
.
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
v1.17.2
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#10638 - [BUG] Locator.click -> subtree intercepts pointer events since version 1.17.0
microsoft/playwright#10632 - [BUG] Playwright 1.17.0 -> After clicking the element - I get an error that click action was failed
microsoft/playwright#10627 - [REGRESSION]: Can no longer click Material UI select box
microsoft/playwright#10620 - [BUG] trailing zero width whitespace fails toHaveText
Browser Versions
- Chromium 98.0.4695.0
- Mozilla Firefox 94.0.1
- WebKit 15.4
This version of Playwright was also tested against the following stable channels:
- Google Chrome 96
- Microsoft Edge 96
v1.17.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#10127 - [BUG] Add Trace Viewer error handling (file not found, not parsable)
microsoft/playwright#10436 - [Bug]: Add hints on how to open trace from HTML report when opened locally
microsoft/playwright#10492 - [Bug]: Fix broken Firefox User-Agent on 'Desktop Firefox' devices
Browser Versions
- Chromium 98.0.4695.0
- Mozilla Firefox 94.0.1
- WebKit 15.4
This version was also tested against the following stable channels:
- Google Chrome 96
- Microsoft Edge 96
v1.17.0
Playwright v1.17.0
Frame Locators
Playwright 1.17 introduces frame locators - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the iframe
and then locate elements in that iframe. Frame locators are strict by default, will wait for iframe
to appear and can be used in Web-First assertions.
Frame locators can be created with either page.FrameLocator(selector)
or locator.FrameLocator(selector)
method.
Locator locator = page.frameLocator("#my-frame").locator("text=Submit");
locator.click();
Read more at our documentation.
Trace Viewer Update
Playwright Trace Viewer is now available online at https://trace.playwright.dev! Just drag-and-drop your trace.zip
file to inspect its contents.
NOTE: trace files are not uploaded anywhere; trace.playwright.dev is a progressive web application that processes traces locally.
- Trace Viewer now shows test name
- New trace metadata tab with browser details
- Snapshots now have URL bar
Ubuntu ARM64 support + more
- Playwright now supports Ubuntu 20.04 ARM64. You can now run Playwright tests inside Docker on Apple M1 and on Raspberry Pi.
New APIs
Browser Versions
- Chromium 98.0.4695.0
- Mozilla Firefox 94.0.1
- WebKit 15.4
This version was also tested against the following stable channels:
- Google Chrome 96
- Microsoft Edge 96
v1.16.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#9692 - [BUG] HTML report shows locator._withElement for locator.evaluate
microsoft/playwright#7818 - [Bug]: dedup snapshot CSS images
Browser Versions
- Chromium 97.0.4666.0
- Mozilla Firefox 93.0
- WebKit 15.4
This version was also tested against the following stable channels:
- Google Chrome 94
- Microsoft Edge 94
(1.16.2-1635322350000)
v1.16.0
🎭 Playwright Library
Locator.waitFor
Wait for a locator to resolve to a single element with a given state.
Defaults to the state: 'visible'
.
Locator orderSent = page.locator("#order-sent");
orderSent.waitFor();
Read more about Locator.waitFor()
.
🎭 Playwright Trace Viewer
- run trace viewer with
npx playwright show-trace
and drop trace files to the trace viewer PWA - better visual attribution of action targets
Read more about Trace Viewer.
Browser Versions
- Chromium 97.0.4666.0
- Mozilla Firefox 93.0
- WebKit 15.4
This version of Playwright was also tested against the following stable channels:
- Google Chrome 94
- Microsoft Edge 94
(1.16.0-1634781227000)
v1.15.2
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#9261 - [BUG] npm init playwright fails on path spaces
microsoft/playwright#9298 - [Question]: Should new Headers methods work in RouteAsync ?
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
(driver version: 1.15.2-1633455481000
)
v1.15.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#8955 - [BUG] fix(inspector): stop on all snapshottable actions
microsoft/playwright#8999 - [BUG] fix: do not dedup header values
microsoft/playwright#9038 - [BUG] fix: restore support for slowmo connect option
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
v1.15.0
Version 1.15
🖱️ Mouse Wheel
By using Mouse.wheel
you are now able to scroll vertically or horizontally.
📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- Request.allHeaders()
- Request.headersArray()
- Request.headerValue(name: string)
- Response.allHeaders()
- Response.headersArray()
- Response.headerValue(name: string)
- Response.headerValues(name: string)
🌈 Forced-Colors emulation
Its now possible to emulate the forced-colors
CSS media feature by passing it in the context options or calling Page.emulateMedia().
New APIs
- Page.route() accepts new
times
option to specify how many times this route should be matched. - Page.setChecked(selector: string, checked: boolean) and Locator.setChecked(selector: string, checked: boolean) was introduced to set the checked state of a checkbox.
- Request.sizes() Returns resource size information for given http request.
- Tracing.startChunk() - Start a new trace chunk.
- Tracing.stopChunk() - Stops a new trace chunk.
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
v1.14.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#8287 - [BUG] webkit crashes intermittently: "file data stream has an unexpected number of bytes"
microsoft/playwright#8281 - [BUG] HTML report crashes if diff snapshot does not exists
microsoft/playwright#8230 - Using React Selectors with multiple React trees
microsoft/playwright#8366 - [BUG] Mark timeout in isVisible as deprecated and noop
Browser Versions
- Chromium 94.0.4595.0
- Mozilla Firefox 91.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 92
- Microsoft Edge 92