Skip to content

Commit

Permalink
[java] Removing deprecated HAS_NATIVE_EVENTS cap
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Dec 7, 2022
1 parent 63a79bd commit 9e240b0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
5 changes: 4 additions & 1 deletion java/src/org/openqa/selenium/ie/InternetExplorerDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions java/src/org/openqa/selenium/remote/CapabilityType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
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;
import org.openqa.selenium.Capabilities;
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 {
Expand Down Expand Up @@ -118,6 +118,6 @@ private boolean isUsingNativeEvents() {
}

Capabilities capabilities = ((HasCapabilities) driver).getCapabilities();
return capabilities.is(CapabilityType.HAS_NATIVE_EVENTS);
return capabilities.is("nativeEvents");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
7 changes: 0 additions & 7 deletions java/test/org/openqa/selenium/testing/TestUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand Down

0 comments on commit 9e240b0

Please sign in to comment.