Skip to content

Commit

Permalink
Greening small tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 26, 2018
1 parent 0ff4b5d commit 945f8a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected boolean hasShutdownEndpoint() {
/**
* Builder used to configure new {@link GeckoDriverService} instances.
*/
@AutoService(FirefoxDriverService.Builder.class)
@AutoService(GeckoDriverService.Builder.class)
public static class Builder extends FirefoxDriverService.Builder<
GeckoDriverService, GeckoDriverService.Builder> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public static Builder builder() {
return new Builder();
}

@AutoService(FirefoxDriverService.Builder.class)
@AutoService(XpiDriverService.Builder.class)
public static class Builder extends FirefoxDriverService.Builder<XpiDriverService, XpiDriverService.Builder> {

private FirefoxBinary binary = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,27 +244,29 @@ public void shouldDetectDriverServicesAndUseThoseIfNoOtherChoiceMade() {

if (caps == null) {
try {
GeckoDriverService.createDefaultService();
caps = new FirefoxOptions();
expectedServiceClass = GeckoDriverService.class;
ChromeDriverService.createDefaultService();
caps = new ChromeOptions();
expectedServiceClass = ChromeDriverService.class;
} catch (IllegalStateException e) {
// Fall through
}
}

if (caps == null) {
try {
ChromeDriverService.createDefaultService();
caps = new ChromeOptions();
expectedServiceClass = ChromeDriverService.class;
GeckoDriverService.createDefaultService();
caps = new FirefoxOptions();
expectedServiceClass = GeckoDriverService.class;
} catch (IllegalStateException e) {
// Fall through
}
}

assumeNotNull(caps, expectedServiceClass);

RemoteWebDriverBuilder.Plan plan = RemoteWebDriver.builder().addAlternative(caps).getPlan();
RemoteWebDriverBuilder.Plan plan = RemoteWebDriver.builder()
.addAlternative(caps)
.getPlan();

assertThat(plan.isUsingDriverService()).isTrue();
assertThat(plan.getDriverService().getClass()).isEqualTo(expectedServiceClass);
Expand Down

0 comments on commit 945f8a1

Please sign in to comment.