v1.40.0
Test Generator Update
New tools to generate assertions:
- "Assert visibility" tool generates assertThat(locator).isVisible([options]).
- "Assert value" tool generates assertThat(locator).hasValue(value[, options]).
- "Assert text" tool generates assertThat(locator).containsText(expected[, options]).
Here is an example of a generated test with assertions:
page.navigate("https://playwright.dev/");
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Get started")).click();
assertThat(page.getByLabel("Breadcrumbs").getByRole(AriaRole.LIST)).containsText("Installation");
assertThat(page.getByLabel("Search")).isVisible();
page.getByLabel("Search").click();
page.getByPlaceholder("Search docs").fill("locator");
assertThat(page.getByPlaceholder("Search docs")).hasValue("locator");New APIs
- Option
reasonin page.close([options]), browserContext.close([options]) and browser.close([options]). Close reason is reported for all operations interrupted by the closure. - Option
firefoxUserPrefsin browserType.launchPersistentContext(userDataDir[, options]).
Other Changes
- Methods download.path() and download.createReadStream() throw an error for failed and cancelled downloads.
Browser Versions
- Chromium 120.0.6099.28
- Mozilla Firefox 119.0
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 119
- Microsoft Edge 119
