Skip to content

Commit

Permalink
[java] Remove deprecated "version" JWP capability
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Apr 26, 2023
1 parent dfe0784 commit 2930461
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
3 changes: 1 addition & 2 deletions java/src/org/openqa/selenium/Capabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ default Platform getPlatformName() {
}

default String getBrowserVersion() {
return String.valueOf(Optional.ofNullable(getCapability("browserVersion")).orElse(
Optional.ofNullable(getCapability("version")).orElse("")));
return String.valueOf(Optional.ofNullable(getCapability("browserVersion")).orElse(""));
}

/**
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 @@ -37,11 +37,6 @@ public interface CapabilityType {
*/
@Deprecated
String TAKES_SCREENSHOT = "takesScreenshot";
/**
* @deprecated Use {@link CapabilityType#BROWSER_VERSION}
*/
@Deprecated
String VERSION = "version";
/**
* @deprecated Non W3C compliant
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,6 @@ void shouldNotMatchIfRequestedBrowserVersionIsMissingFromStereotype() {
assertThat(slotMatcher.matches(stereotype, capabilities)).isFalse();
}

@Test
void matchesWithJsonWireProtocolCaps() {
Capabilities stereotype = new ImmutableCapabilities(
CapabilityType.BROWSER_NAME, "chrome",
CapabilityType.BROWSER_VERSION, "80",
CapabilityType.PLATFORM_NAME, Platform.WINDOWS
);
Capabilities capabilities = new ImmutableCapabilities(
CapabilityType.BROWSER_NAME, "chrome",
CapabilityType.VERSION, "80",
CapabilityType.PLATFORM, Platform.WINDOWS
);
assertThat(slotMatcher.matches(stereotype, capabilities)).isTrue();
}

@Test
void shouldNotMatchCapabilitiesThatAreDifferentButDoNotContainCommonCapabilityNames() {
Capabilities stereotype = new ImmutableCapabilities("acceptInsecureCerts", "true");
Expand Down

0 comments on commit 2930461

Please sign in to comment.