-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/test/java/com/github/valfirst/jbehave/junit/monitoring/FilteredOutScenariosNotStory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.valfirst.jbehave.junit.monitoring; | ||
|
||
import java.util.Arrays; | ||
|
||
import com.github.valfirst.jbehave.junit.monitoring.step.ExampleSteps; | ||
|
||
import org.jbehave.core.configuration.Configuration; | ||
import org.jbehave.core.configuration.MostUsefulConfiguration; | ||
import org.jbehave.core.embedder.EmbedderControls; | ||
import org.jbehave.core.junit.JUnitStory; | ||
import org.jbehave.core.steps.InjectableStepsFactory; | ||
import org.jbehave.core.steps.InstanceStepsFactory; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(JUnitReportingRunner.class) | ||
public class FilteredOutScenariosNotStory extends JUnitStory { | ||
|
||
public FilteredOutScenariosNotStory() { | ||
EmbedderControls embedderControls = JUnitReportingRunner.recommendedControls(configuredEmbedder()); | ||
embedderControls.doVerboseFailures(true); | ||
embedderControls.doIgnoreFailureInStories(false); | ||
configuredEmbedder().useMetaFilters(Arrays.asList("-first", "-second")); | ||
} | ||
|
||
@Override | ||
public InjectableStepsFactory stepsFactory() { | ||
return new InstanceStepsFactory(configuration(), new ExampleSteps()); | ||
} | ||
|
||
@Override | ||
public Configuration configuration() { | ||
return new MostUsefulConfiguration(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...urces/com/github/valfirst/jbehave/junit/monitoring/filtered_out_scenarios_not_story.story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Meta: | ||
@all | ||
|
||
Narrative: | ||
As a user | ||
I want to perform an action | ||
So that I can achieve a business goal | ||
|
||
Scenario: First scenario filtered by tag first | ||
Meta: @first | ||
Given a variable x with value 2 | ||
When I multiply x by 2 | ||
Then x should equal 4 | ||
|
||
Scenario: Second scenario filtered by tag second | ||
Meta: @second | ||
Then this step is not executed |