Skip to content

Commit

Permalink
Merge 018bd48 into ab5ce21
Browse files Browse the repository at this point in the history
  • Loading branch information
uarlouski committed Jun 25, 2018
2 parents ab5ce21 + 018bd48 commit 2b970df
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,17 @@ public void successful(String step) {

private void prepareNextStep() {
TestState testState = this.testState.get();
if (testState.currentStep != null && testState.currentStep.isTest()) {
testCounter.incrementAndGet();
if (testState.currentStep != null) {
if (testState.currentStep.isTest()) {
testCounter.incrementAndGet();
}
// Lifecycle After story steps
if(testState.currentStep == testState.currentScenario) {
testState.moveToNextScenario();
return;
}
}
// Lifecycle After story steps
if (testState.currentStep == testState.currentScenario) {
testState.moveToNextScenario();
} else if (testState.stepDescriptions != null) {
if (testState.stepDescriptions != null) {
testState.moveToNextStep();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;

import java.util.Collections;

Expand Down Expand Up @@ -246,6 +247,16 @@ public void shouldNotifyAboutLifecycleStorySteps() {
verifyStoryFinished();
}

@Test
public void shouldNotNotifySubStepWithoutBeforeAction() {
scenarioDescription.addChild(Description.TEST_MECHANISM);

reporter = new JUnitScenarioReporter(notifier, 1, rootDescription, keywords);

reportStepSuccess(reporter);
verifyZeroInteractions(notifier);
}

@Test
public void shouldNotifyGivenStory() {

Expand Down

0 comments on commit 2b970df

Please sign in to comment.