Skip to content

Commit

Permalink
test: ControlOrMeta modifier (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored May 2, 2024
1 parent abfe50c commit 5636edf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ private void onLocatorHandlerTriggered(int uid) {
LocatorHandler handler = locatorHandlers.get(uid);
remove = handler != null && handler.call();
} finally {
if (remove) {
locatorHandlers.remove(uid);
}
JsonObject params = new JsonObject();
params.addProperty("uid", uid);
params.addProperty("remove", remove);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,9 @@ void shouldHandleSelectAll() {
page.navigate(server.PREFIX + "/input/textarea.html");
ElementHandle textarea = page.querySelector("textarea");
textarea.type("some text");
String modifier = isMac ? "Meta" : "Control";
page.keyboard().down(modifier);
page.keyboard().down("ControlOrMeta");
page.keyboard().press("a");
page.keyboard().up(modifier);
page.keyboard().up("ControlOrMeta");
page.keyboard().press("Backspace");
assertTrue(((String)page.evalOnSelector("textarea", "textarea => textarea.value")).isEmpty());
}
Expand All @@ -362,10 +361,9 @@ void shouldBeAbleToPreventSelectAll() {
" event.preventDefault();\n" +
" }, false);\n" +
"}");
String modifier = isMac ? "Meta" : "Control";
page.keyboard().down(modifier);
page.keyboard().down("ControlOrMeta");
page.keyboard().press("a");
page.keyboard().up(modifier);
page.keyboard().up("ControlOrMeta");
page.keyboard().press("Backspace");
assertEquals("some tex", page.evalOnSelector("textarea", "textarea => textarea.value"));
}
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<module>driver-bundle</module>
<module>playwright</module>
</modules>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
Expand Down

0 comments on commit 5636edf

Please sign in to comment.