Skip to content

Commit

Permalink
[java] Fixing Chrome logging capability name renamed to "goog:logging…
Browse files Browse the repository at this point in the history
…Prefs" in Chrome 75
  • Loading branch information
barancev committed Jul 20, 2019
1 parent 51b6b33 commit 85e17c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public Map<String, Object> apply(Map<String, Object> unmodifiedCaps) {
entry ->
("browserName".equals(entry.getKey()) && "chrome".equals(entry.getValue())) ||
entry.getKey().startsWith("goog:") ||
"chromeOptions".equals(entry.getKey()))
"chromeOptions".equals(entry.getKey()) ||
"loggingPrefs".equals(entry.getKey()))
.filter(entry -> Objects.nonNull(entry.getValue()))
.distinct()
.collect(Collectors.toMap(
Expand All @@ -44,6 +45,10 @@ public Map<String, Object> apply(Map<String, Object> unmodifiedCaps) {
caps.put("goog:chromeOptions", caps.get("chromeOptions"));
}

if (caps.containsKey("loggingPrefs") && !caps.containsKey("goog:loggingPrefs")) {
caps.put("goog:loggingPrefs", caps.get("loggingPrefs"));
}

return caps.isEmpty() ? null : caps;
}

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

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import static org.openqa.selenium.remote.CapabilityType.ENABLE_PROFILING_CAPABILITY;
import static org.openqa.selenium.testing.TestUtilities.getChromeVersion;
Expand Down

0 comments on commit 85e17c1

Please sign in to comment.