Skip to content

Commit

Permalink
Add PlatformName to CanonicalCapabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
shucon committed Jun 23, 2020
1 parent 2fac300 commit b0494d2
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.openqa.selenium.chrome;

import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

import org.openqa.selenium.Capabilities;
Expand All @@ -41,7 +43,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(CapabilityType.BROWSER_NAME, BrowserType.CHROME);
return new ImmutableCapabilities(CapabilityType.BROWSER_NAME, BrowserType.CHROME, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/edge/EdgeDriverInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.openqa.selenium.edge;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -42,7 +43,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.EDGE);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.EDGE, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.openqa.selenium.edgehtml;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -41,7 +42,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.EDGE, EdgeHtmlOptions.USE_CHROMIUM, false);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.EDGE, EdgeHtmlOptions.USE_CHROMIUM, false, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.openqa.selenium.firefox.FirefoxDriver.Capability.MARIONETTE;
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -42,7 +43,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.FIREFOX);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.FIREFOX, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.openqa.selenium.firefox.FirefoxDriver.Capability.MARIONETTE;
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -45,7 +46,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.FIREFOX, MARIONETTE, true);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.FIREFOX, MARIONETTE, true, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.ie;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -41,7 +42,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.IE);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.IE, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.opera;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -41,7 +42,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.OPERA_BLINK);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.OPERA_BLINK, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.safari;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -41,7 +42,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.SAFARI);
return new ImmutableCapabilities(BROWSER_NAME, BrowserType.SAFARI, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.safari;

import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;

import com.google.auto.service.AutoService;

Expand All @@ -40,7 +41,7 @@ public String getDisplayName() {

@Override
public Capabilities getCanonicalCapabilities() {
return new ImmutableCapabilities(BROWSER_NAME, SafariOptions.SAFARI_TECH_PREVIEW);
return new ImmutableCapabilities(BROWSER_NAME, SafariOptions.SAFARI_TECH_PREVIEW, PLATFORM_NAME, System.getProperty("os.name"));
}

@Override
Expand Down
4 changes: 4 additions & 0 deletions java/server/src/org/openqa/selenium/grid/graphql/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public int getMaxSession() {
return maxSession;
}

public String getCapabilities() {
return capabilities;
}

public String getStatus() {
return isUp ? "UP" : "UNAVAILABLE";
}
Expand Down

0 comments on commit b0494d2

Please sign in to comment.