v1.27.0
Highlights
Locators
With these new APIs writing locators is a joy:
- Page.GetByText(text, options) to locate by text content.
- Page.GetByRole(role, options) to locate by ARIA role, ARIA attributes and accessible name.
- Page.GetByLabel(text, options) to locate a form control by associated label's text.
- Page.GetByPlaceholder(text, options) to locate an input by placeholder.
- Page.GetByAltText(text, options)e to locate an element, usually image, by its text alternative.
- Page.GetByTitle(text, options) to locate an element by its title.
await Page.GetByLabel("User Name").FillAsync("John");
await Page.GetByLabel("Password").FillAsync("secret-password");
await Page.GetByRole("button", new() { Name = "Sign in" }).ClickAsync();
await Expect(Page.GetByText("Welcome, John!")).ToBeVisibleAsync();
All the same methods are also available on Locator, FrameLocator and Frame classes.
Other highlights
- As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release.
Behavior Changes
-
Expect(Locator).ToHaveAttributeAsync(name, value, options) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when
button
does not have adisabled
attribute.await Expect(page.GetByRole("button")).ToHaveAttribute("disabled", "");
Browser Versions
- Chromium 107.0.5304.18
- Mozilla Firefox 105.0.1
- WebKit 16.0
This version was also tested against the following stable channels:
- Google Chrome 106
- Microsoft Edge 106