From 9e240b008c10ae5058a5d3490a4fb042fbf3d11a Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 7 Dec 2022 22:05:10 +0100 Subject: [PATCH] [java] Removing deprecated HAS_NATIVE_EVENTS cap --- .../src/org/openqa/selenium/ie/InternetExplorerDriver.java | 5 ++++- java/src/org/openqa/selenium/remote/CapabilityType.java | 5 ----- .../com/thoughtworks/selenium/corebased/TestClickAt.java | 4 ++-- .../selenium/interactions/CombinedInputActionsTest.java | 7 +++---- java/test/org/openqa/selenium/testing/TestUtilities.java | 7 ------- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/java/src/org/openqa/selenium/ie/InternetExplorerDriver.java b/java/src/org/openqa/selenium/ie/InternetExplorerDriver.java index 4439b73451a42..5d83a0a939838 100644 --- a/java/src/org/openqa/selenium/ie/InternetExplorerDriver.java +++ b/java/src/org/openqa/selenium/ie/InternetExplorerDriver.java @@ -38,8 +38,11 @@ public class InternetExplorerDriver extends RemoteWebDriver { /** * Capability that defines to use whether to use native or javascript events during operations. + * + * @deprecated Non W3C compliant */ - public static final String NATIVE_EVENTS = CapabilityType.HAS_NATIVE_EVENTS; + @Deprecated + public static final String NATIVE_EVENTS = "nativeEvents"; /** * Capability that defines the initial URL to be used when IE is launched. diff --git a/java/src/org/openqa/selenium/remote/CapabilityType.java b/java/src/org/openqa/selenium/remote/CapabilityType.java index 11944c9d2a7e5..87d389683b3a4 100644 --- a/java/src/org/openqa/selenium/remote/CapabilityType.java +++ b/java/src/org/openqa/selenium/remote/CapabilityType.java @@ -57,11 +57,6 @@ public interface CapabilityType { */ @Deprecated String SUPPORTS_WEB_STORAGE = "webStorageEnabled"; - /** - * @deprecated Non W3C compliant - */ - @Deprecated - String HAS_NATIVE_EVENTS = "nativeEvents"; /** * @deprecated Use {@link CapabilityType#UNHANDLED_PROMPT_BEHAVIOUR} */ diff --git a/java/test/com/thoughtworks/selenium/corebased/TestClickAt.java b/java/test/com/thoughtworks/selenium/corebased/TestClickAt.java index 9f780891b32ac..a774b20eab5a3 100644 --- a/java/test/com/thoughtworks/selenium/corebased/TestClickAt.java +++ b/java/test/com/thoughtworks/selenium/corebased/TestClickAt.java @@ -18,6 +18,7 @@ package com.thoughtworks.selenium.corebased; import com.thoughtworks.selenium.InternalSelenseTestBase; + import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -25,7 +26,6 @@ import org.openqa.selenium.HasCapabilities; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WrapsDriver; -import org.openqa.selenium.remote.CapabilityType; @Disabled() public class TestClickAt extends InternalSelenseTestBase { @@ -118,6 +118,6 @@ private boolean isUsingNativeEvents() { } Capabilities capabilities = ((HasCapabilities) driver).getCapabilities(); - return capabilities.is(CapabilityType.HAS_NATIVE_EVENTS); + return capabilities.is("nativeEvents"); } } diff --git a/java/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java b/java/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java index 4636ff2c2f547..2756dcb34a839 100644 --- a/java/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java +++ b/java/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java @@ -42,7 +42,6 @@ import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform; import static org.openqa.selenium.testing.TestUtilities.getIEVersion; import static org.openqa.selenium.testing.TestUtilities.isInternetExplorer; -import static org.openqa.selenium.testing.TestUtilities.isNativeEventsEnabled; import static org.openqa.selenium.testing.drivers.Browser.CHROME; import static org.openqa.selenium.testing.drivers.Browser.FIREFOX; import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT; @@ -334,9 +333,9 @@ public void testMouseMovementWorksWhenNavigatingToAnotherPage() { @NotYetImplemented(CHROME) public void testChordControlCutAndPaste() { assumeFalse(getEffectivePlatform(driver).is(Platform.MAC), "FIXME: macs don't have CONTROL key"); - assumeFalse(isNativeEventsEnabled(driver) && - getEffectivePlatform(driver).is(Platform.WINDOWS) && - isInternetExplorer(driver), "Windows: native events library does not support storing modifiers state yet"); + assumeFalse(getEffectivePlatform(driver).is(Platform.WINDOWS) && + isInternetExplorer(driver), + "Windows: native events library does not support storing modifiers state yet"); driver.get(pages.javascriptPage); diff --git a/java/test/org/openqa/selenium/testing/TestUtilities.java b/java/test/org/openqa/selenium/testing/TestUtilities.java index fe30aea47514b..df915c190c84c 100644 --- a/java/test/org/openqa/selenium/testing/TestUtilities.java +++ b/java/test/org/openqa/selenium/testing/TestUtilities.java @@ -23,7 +23,6 @@ import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; -import org.openqa.selenium.remote.CapabilityType; import java.io.File; import java.io.IOException; @@ -36,12 +35,6 @@ public class TestUtilities { - public static boolean isNativeEventsEnabled(WebDriver driver) { - return driver instanceof HasCapabilities && - ((HasCapabilities) driver).getCapabilities().is(CapabilityType.HAS_NATIVE_EVENTS); - - } - public static String getUserAgent(WebDriver driver) { try { return (String) ((JavascriptExecutor) driver).executeScript(