Skip to content

Commit

Permalink
[java] Deprecating VERSION to favour BROWSER_VERSION
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
diemol committed Oct 1, 2021
1 parent 4a1bc4c commit 59055b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
11 changes: 10 additions & 1 deletion java/src/org/openqa/selenium/remote/CapabilityType.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@
* Commonly seen remote webdriver capabilities.
*/
public interface CapabilityType {

String BROWSER_NAME = "browserName";
@Deprecated String PLATFORM = "platform";
/**
* @deprecated Use {@link CapabilityType#PLATFORM_NAME}
*/
@Deprecated
String PLATFORM = "platform";
String PLATFORM_NAME = "platformName";
String SUPPORTS_JAVASCRIPT = "javascriptEnabled";
String TAKES_SCREENSHOT = "takesScreenshot";
/**
* @deprecated Use {@link CapabilityType#BROWSER_VERSION}
*/
@Deprecated
String VERSION = "version";
String BROWSER_VERSION = "browserVersion";
String SUPPORTS_ALERTS = "handlesAlerts";
Expand Down
13 changes: 5 additions & 8 deletions java/src/org/openqa/selenium/remote/DesiredCapabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@
import org.openqa.selenium.Platform;

import java.util.Map;
import java.util.logging.Logger;

public class DesiredCapabilities extends MutableCapabilities {

private static final Logger LOG = Logger.getLogger(Capabilities.class.getName());

public DesiredCapabilities(String browser, String version, Platform platform) {
setCapability(BROWSER_NAME, browser);
setCapability(VERSION, version);
Expand Down Expand Up @@ -63,6 +60,11 @@ public DesiredCapabilities(Capabilities... others) {
}
}

@Deprecated
public static DesiredCapabilities htmlUnit() {
return new DesiredCapabilities(HTMLUNIT.browserName(), "", Platform.ANY);
}

public void setBrowserName(String browserName) {
setCapability(BROWSER_NAME, browserName);
}
Expand Down Expand Up @@ -110,9 +112,4 @@ public DesiredCapabilities merge(Capabilities extraCapabilities) {
}
return this;
}

@Deprecated
public static DesiredCapabilities htmlUnit() {
return new DesiredCapabilities(HTMLUNIT.browserName(), "", Platform.ANY);
}
}

0 comments on commit 59055b3

Please sign in to comment.