Skip to content

Commit 000cb08

Browse files
committed
[java] Overriding methods to have main platform names lowercase
Fixes #11952
1 parent 74e0af8 commit 000cb08

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

java/src/org/openqa/selenium/Platform.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public enum Platform {
3838
public Platform family() {
3939
return null;
4040
}
41+
42+
@Override
43+
public String toString() {
44+
return "windows";
45+
}
4146
},
4247

4348
/**
@@ -132,6 +137,11 @@ public String toString() {
132137
public Platform family() {
133138
return null;
134139
}
140+
141+
@Override
142+
public String toString() {
143+
return "mac";
144+
}
135145
},
136146

137147
SNOW_LEOPARD("snow leopard", "os x 10.6", "macos 10.6") {
@@ -284,6 +294,11 @@ public Platform family() {
284294
public Platform family() {
285295
return UNIX;
286296
}
297+
298+
@Override
299+
public String toString() {
300+
return "linux";
301+
}
287302
},
288303

289304
ANDROID("android", "dalvik") {
@@ -311,6 +326,12 @@ public Platform family() {
311326
public boolean is(Platform compareWith) {
312327
return this == compareWith;
313328
}
329+
330+
@Override
331+
public String toString() {
332+
return "any";
333+
}
334+
314335
};
315336

316337
private static Platform current;

java/test/org/openqa/selenium/remote/RemoteWebElementTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void canHandleWebDriverExceptionThrownByCommandExecutor() {
8080
.withMessageContaining(String.format(
8181
"Command: [%s, clickElement {id=%s}]", fixture.driver.getSessionId(), fixture.element.getId()))
8282
.withMessageContaining(String.format(
83-
"Element: [[RemoteWebDriver: cheese on WINDOWS (%s)] -> id: test]", fixture.driver.getSessionId()));
83+
"Element: [[RemoteWebDriver: cheese on windows (%s)] -> id: test]", fixture.driver.getSessionId()));
8484

8585
fixture.verifyCommands(
8686
new CommandPayload(
@@ -106,7 +106,7 @@ void canHandleGeneralExceptionThrownByCommandExecutor() {
106106
.withMessageContaining(String.format(
107107
"Command: [%s, clickElement {id=%s}]", fixture.driver.getSessionId(), fixture.element.getId()))
108108
.withMessageContaining(String.format(
109-
"Element: [[RemoteWebDriver: cheese on WINDOWS (%s)] -> id: test]", fixture.driver.getSessionId()))
109+
"Element: [[RemoteWebDriver: cheese on windows (%s)] -> id: test]", fixture.driver.getSessionId()))
110110
.havingCause()
111111
.withMessage("BOOM!!!");
112112

@@ -134,7 +134,7 @@ void canHandleWebDriverExceptionReturnedByCommandExecutor() {
134134
.withMessageContaining(String.format(
135135
"Command: [%s, clickElement {id=%s}]", fixture.driver.getSessionId(), fixture.element.getId()))
136136
.withMessageContaining(String.format(
137-
"Element: [[RemoteWebDriver: cheese on ANY (%s)] -> id: test]", fixture.driver.getSessionId()));
137+
"Element: [[RemoteWebDriver: cheese on any (%s)] -> id: test]", fixture.driver.getSessionId()));
138138

139139
fixture.verifyCommands(
140140
new CommandPayload(
@@ -160,7 +160,7 @@ void canHandleResponseWithErrorCodeButNoExceptionReturnedByCommandExecutor() {
160160
.withMessageContaining(String.format(
161161
"Command: [%s, clickElement {id=%s}]", fixture.driver.getSessionId(), fixture.element.getId()))
162162
.withMessageContaining(String.format(
163-
"Element: [[RemoteWebDriver: cheese on ANY (%s)] -> id: test]", fixture.driver.getSessionId()));
163+
"Element: [[RemoteWebDriver: cheese on any (%s)] -> id: test]", fixture.driver.getSessionId()));
164164

165165
fixture.verifyCommands(
166166
new CommandPayload(

java/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void shouldIncludeRemoteInfoForWrappedDriverTimeout() throws IOException {
7777

7878
assertThatExceptionOfType(TimeoutException.class)
7979
.isThrownBy(() -> wait.until(d -> false))
80-
.withMessageContaining("Capabilities {platformName: ANY}")
80+
.withMessageContaining("Capabilities {platformName: any}")
8181
.withMessageContaining("Session ID: foo");
8282
}
8383

0 commit comments

Comments
 (0)