Skip to content

Commit

Permalink
always use w3c driver capabilities alwaysMatch #924
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed Jan 28, 2020
1 parent 805bd4a commit 088fcc9
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,17 @@ public static Driver start(ScenarioContext context, Map<String, Object> options,
}

private Map<String, Object> getCapabilities(String browserName) {
Map<String, Object> map = webDriverCapabilities;
if (map == null) {
map = new HashMap();
Map<String, Object> capabilities = webDriverCapabilities;
if (capabilities == null) {
capabilities = new HashMap();
}
map.putIfAbsent("browserName", browserName);
if (!map.containsKey("alwaysMatch")) {
map = Collections.singletonMap("alwaysMatch", map);
Map<String, Object> alwaysMatch = (Map) capabilities.get("alwaysMatch");
if (alwaysMatch == null) {
alwaysMatch = new HashMap();
capabilities.put("alwaysMatch", alwaysMatch);
}
return Collections.singletonMap("capabilities", map);
alwaysMatch.putIfAbsent("browserName", browserName);
return Collections.singletonMap("capabilities", capabilities);
}

public Map<String, Object> getCapabilities() {
Expand Down

0 comments on commit 088fcc9

Please sign in to comment.