Skip to content

Commit

Permalink
grid hub getting desired capabilites needs to account for w3c only re…
Browse files Browse the repository at this point in the history
…quests.
  • Loading branch information
lukeis committed Oct 7, 2016
1 parent d247a6f commit 1afc18b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public Map<String, Object> extractDesiredCapability() {
String json = getBody();
try {
JsonObject map = new JsonParser().parse(json).getAsJsonObject();
// Current W3C has required / desired capabilities wrapped in a 'capabilites' object.
// This will need to be updated if/when https://github.com/w3c/webdriver/pull/327 gets merged
if (map.has("capabilities")) {
return new JsonToBeanConverter().convert(Map.class, map.getAsJsonObject("capabilities").getAsJsonObject("desiredCapabilities"));
}
JsonObject dc = map.get("desiredCapabilities").getAsJsonObject();
return new JsonToBeanConverter().convert(Map.class, dc);

Expand Down

0 comments on commit 1afc18b

Please sign in to comment.