Skip to content

Commit

Permalink
Make sure soft asserts don't make webdriver calls unnecessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed May 20, 2016
1 parent fe81e68 commit d2bb531
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ public void dropAllListeners() {
}

public boolean webdriverCallsAreSuspended() {

if (softAssertsActive()) {
return !webdriverSuspensions.isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

import static org.assertj.core.api.Assertions.assertThat;

;

public class WhenInstanciatingAAppiumDriver {

private EnvironmentVariables environmentVariables;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public void reportStepSkippedFor(Performable todo) {
public boolean aStepHasFailed() { return StepEventBus.getEventBus().getBaseStepListener().aStepHasFailed(); }

public boolean shouldIgnoreConsequences() {
if ((StepEventBus.getEventBus().currentTestIsSuspended() || StepEventBus.getEventBus().aStepInTheCurrentTestHasFailed())) {
return true;
};
return (!StepEventBus.getEventBus().softAssertsActive());
if (StepEventBus.getEventBus().softAssertsActive() && !StepEventBus.getEventBus().currentTestIsSuspended() ) {
return false;
}
return (StepEventBus.getEventBus().currentTestIsSuspended() || StepEventBus.getEventBus().aStepInTheCurrentTestHasFailed());
}

public void enableSoftAsserts() {
Expand Down

0 comments on commit d2bb531

Please sign in to comment.