Skip to content

Commit

Permalink
Synchronizing "platform" and "platformName" capability values. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Aug 24, 2017
1 parent 6afbc2e commit 1940813
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ protected void startSession(Capabilities desiredCapabilities,
DesiredCapabilities returnedCapabilities = new DesiredCapabilities();
for (Map.Entry<String, Object> entry : rawCapabilities.entrySet()) {
// Handle the platform later
if (CapabilityType.PLATFORM.equals(entry.getKey())) {
if (CapabilityType.PLATFORM.equals(entry.getKey()) || "platformName".equals(entry.getKey())) {
continue;
}
returnedCapabilities.setCapability(entry.getKey(), entry.getValue());
}
String platformString = (String) rawCapabilities.get(CapabilityType.PLATFORM);
String platformString = (String) rawCapabilities.getOrDefault(CapabilityType.PLATFORM, rawCapabilities.get("platformName"));
Platform platform;
try {
if (platformString == null || "".equals(platformString)) {
Expand All @@ -275,7 +275,8 @@ protected void startSession(Capabilities desiredCapabilities,
// system property. Try to recover and parse this.
platform = Platform.extractFromSysProperty(platformString);
}
returnedCapabilities.setPlatform(platform);
returnedCapabilities.setCapability(CapabilityType.PLATFORM, platform);
returnedCapabilities.setCapability("platformName", platform);

if (rawCapabilities.containsKey(SUPPORTS_JAVASCRIPT)) {
Object raw = rawCapabilities.get(SUPPORTS_JAVASCRIPT);
Expand Down

0 comments on commit 1940813

Please sign in to comment.