1
0
mirror of synced 2026-08-31 19:55:37 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Yury Semikhatsky 71ea72ba53 chore: bump version to 1.28.1 (#1134) 2022-11-28 16:14:43 -08:00
Yury Semikhatsky 7d69f7a087 chore: roll driver to 1.28.1 (#1133) 2022-11-28 16:01:51 -08:00
Yury Semikhatsky 04158db747 cherry-pick(#1131): fix: implement LocatorImpl.getByRole (#1132)
Fixes https://github.com/microsoft/playwright-java/issues/1130
2022-11-28 15:13:25 -08:00
Yury Semikhatsky e47d0ab16c chore: set release version to 1.28.0 (#1125) 2022-11-16 12:42:59 -08:00
14 changed files with 47 additions and 30 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId> <artifactId>parent-pom</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
</parent> </parent>
<artifactId>driver-bundle</artifactId> <artifactId>driver-bundle</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId> <artifactId>parent-pom</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
</parent> </parent>
<artifactId>driver</artifactId> <artifactId>driver</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>org.example</groupId> <groupId>org.example</groupId>
<artifactId>examples</artifactId> <artifactId>examples</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Playwright Client Examples</name> <name>Playwright Client Examples</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId> <artifactId>parent-pom</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
</parent> </parent>
<artifactId>playwright</artifactId> <artifactId>playwright</artifactId>
@@ -245,7 +245,7 @@ class LocatorImpl implements Locator {
@Override @Override
public Locator getByRole(AriaRole role, GetByRoleOptions options) { public Locator getByRole(AriaRole role, GetByRoleOptions options) {
return null; return locator(getByRoleSelector(role, options));
} }
@Override @Override
@@ -171,4 +171,12 @@ public class TestSelectorsGetBy extends TestBase {
asList("<a href=\"https://playwright.dev\">he llo 56</a>"), asList("<a href=\"https://playwright.dev\">he llo 56</a>"),
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName(" he \n llo 56 ").setExact(true)).evaluateAll("els => els.map(e => e.outerHTML)")); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName(" he \n llo 56 ").setExact(true)).evaluateAll("els => els.map(e => e.outerHTML)"));
} }
@Test
void locatorGetByRole() {
page.setContent("<div><button>Click me</button></div>");
assertEquals(
asList("<button>Click me</button>"),
page.locator("div").getByRole(AriaRole.BUTTON).evaluateAll("els => els.map(e => e.outerHTML)"));
}
} }
@@ -153,26 +153,35 @@ public class TestSelectorsRole extends TestBase {
@Test @Test
void shouldSupportExpanded() { void shouldSupportExpanded() {
page.setContent("<button>Hi</button>\n" + page.setContent("<div role=\"treeitem\">Hi</div>\n" +
" <button aria-expanded=\"true\">Hello</button>\n" + " <div role=\"treeitem\" aria-expanded=\"true\">Hello</div>\n" +
" <button aria-expanded=\"false\">Bye</button>"); " <div role=\"treeitem\" aria-expanded=\"false\">Bye</div>");
assertEquals(asList( assertEquals(asList(
"<button aria-expanded=\"true\">Hello</button>" "<div role=\"treeitem\">Hi</div>",
), page.locator("role=button[expanded]").evaluateAll("els => els.map(e => e.outerHTML)")); "<div role=\"treeitem\" aria-expanded=\"true\">Hello</div>",
"<div role=\"treeitem\" aria-expanded=\"false\">Bye</div>"
), page.locator("role=treeitem").evaluateAll("els => els.map(e => e.outerHTML)"));
assertEquals(asList( assertEquals(asList(
"<button aria-expanded=\"true\">Hello</button>" "<div role=\"treeitem\">Hi</div>",
), page.locator("role=button[expanded=true]").evaluateAll("els => els.map(e => e.outerHTML)")); "<div role=\"treeitem\" aria-expanded=\"true\">Hello</div>",
assertEquals(asList( "<div role=\"treeitem\" aria-expanded=\"false\">Bye</div>"
"<button aria-expanded=\"true\">Hello</button>" ), page.getByRole(AriaRole.TREEITEM).evaluateAll("els => els.map(e => e.outerHTML)"));
), page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setExpanded(true)).evaluateAll("els => els.map(e => e.outerHTML)"));
assertEquals(asList( assertEquals(asList("<div role=\"treeitem\" aria-expanded=\"true\">Hello</div>"),
"<button>Hi</button>", page.locator("role=treeitem[expanded]").evaluateAll("els => els.map(e => e.outerHTML)"));
"<button aria-expanded=\"false\">Bye</button>" assertEquals(asList("<div role=\"treeitem\" aria-expanded=\"true\">Hello</div>"),
), page.locator("role=button[expanded=false]").evaluateAll("els => els.map(e => e.outerHTML)")); page.locator("role=treeitem[expanded=true]").evaluateAll("els => els.map(e => e.outerHTML)"));
assertEquals(asList( assertEquals(asList("<div role=\"treeitem\" aria-expanded=\"true\">Hello</div>"),
"<button>Hi</button>", page.getByRole(AriaRole.TREEITEM, new Page.GetByRoleOptions().setExpanded(true)).evaluateAll("els => els.map(e => e.outerHTML)"));
"<button aria-expanded=\"false\">Bye</button>"
), page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setExpanded(false)).evaluateAll("els => els.map(e => e.outerHTML)")); assertEquals(asList("<div role=\"treeitem\" aria-expanded=\"false\">Bye</div>"),
page.locator("role=treeitem[expanded=false]").evaluateAll("els => els.map(e => e.outerHTML)"));
assertEquals(asList("<div role=\"treeitem\" aria-expanded=\"false\">Bye</div>"),
page.getByRole(AriaRole.TREEITEM, new Page.GetByRoleOptions().setExpanded(false)).evaluateAll("els => els.map(e => e.outerHTML)"));
// Workaround for expanded='none'.
assertEquals(asList("<div role=\"treeitem\">Hi</div>"),
page.locator("[role=treeitem]:not([aria-expanded])").evaluateAll("els => els.map(e => e.outerHTML)"));
} }
@Test @Test
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId> <artifactId>parent-pom</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Playwright Parent Project</name> <name>Playwright Parent Project</name>
<description>Java library to automate Chromium, Firefox and WebKit with a single API. <description>Java library to automate Chromium, Firefox and WebKit with a single API.
+1 -1
View File
@@ -1 +1 @@
1.28.0 1.28.1
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>api-generator</artifactId> <artifactId>api-generator</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Playwright - API Generator</name> <name>Playwright - API Generator</name>
<description> <description>
This is an internal module used to generate Java API from the upstream Playwright This is an internal module used to generate Java API from the upstream Playwright
+1 -1
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>test-cli-version</artifactId> <artifactId>test-cli-version</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Test Playwright Command Line Version</name> <name>Test Playwright Command Line Version</name>
<properties> <properties>
<compiler.version>1.8</compiler.version> <compiler.version>1.8</compiler.version>
+1 -1
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>test-local-installation</artifactId> <artifactId>test-local-installation</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Test local installation</name> <name>Test local installation</name>
<description>Runs Playwright test suite (copied from playwright module) against locally cached Playwright</description> <description>Runs Playwright test suite (copied from playwright module) against locally cached Playwright</description>
<properties> <properties>
+1 -1
View File
@@ -9,7 +9,7 @@
</parent> </parent>
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>test-spring-boot-starter</artifactId> <artifactId>test-spring-boot-starter</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Test Playwright With Spring Boot</name> <name>Test Playwright With Spring Boot</name>
<properties> <properties>
<spring.version>2.4.3</spring.version> <spring.version>2.4.3</spring.version>
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.microsoft.playwright</groupId> <groupId>com.microsoft.playwright</groupId>
<artifactId>update-version</artifactId> <artifactId>update-version</artifactId>
<version>1.28.0-SNAPSHOT</version> <version>1.28.1</version>
<name>Playwright - Update Version in Documentation</name> <name>Playwright - Update Version in Documentation</name>
<description> <description>
This is an internal module used to update versions in the documentation based on This is an internal module used to update versions in the documentation based on