Skip to content

Commit

Permalink
[java] Changing a test for RemoteWebDriverBuilder to analyze requests…
Browse files Browse the repository at this point in the history
… in time, later the streams can be closed
  • Loading branch information
barancev committed Feb 22, 2021
1 parent e874b53 commit fd7a4b6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ public void justCallingBuildWithoutSettingAnyOptionsIsAnError() {

@Test
public void mustSpecifyAtLeastOneSetOfOptions() {
List<HttpRequest> requests = new ArrayList<>();
List<List<Capabilities>> caps = new ArrayList<>();

RemoteWebDriver.builder().oneOf(new FirefoxOptions())
.address("http://localhost:34576")
.connectingWith(config -> req -> {
requests.add(req);
caps.add(listCapabilities(req));
return CANNED_SESSION_RESPONSE;
})
.build();

assertThat(requests).isNotEmpty();
List<Capabilities> caps = listCapabilities(requests.get(0));
assertThat(caps.get(0).getBrowserName()).isEqualTo(FIREFOX);
assertThat(caps).hasSize(1);
List<Capabilities> caps0 = caps.get(0);
assertThat(caps0.get(0).getBrowserName()).isEqualTo(FIREFOX);
}

@Test
Expand Down

0 comments on commit fd7a4b6

Please sign in to comment.