How to include and exclude scenarios from test execution in JBehave?

Yury Staravoitau picture Yury Staravoitau · Feb 5, 2013 · Viewed 8.8k times · Source

I have some stories. Every story has some scenarios. Example:

Story 1.
Scenario 1.
Scenario 2.
Scenario 3.
Story 2.
Scenario 1.
Scenario 2.

TestNG has suite.xml file for configuration which test and\or methods should be executed.

I found in jBehave StoryFinder class, but it needs to modify my code every time when I execute different scenarios.

I want to execute, for example, in Story 1 Scenario 2 and Scenario 3 and in Story 2 only Scenario 2. I did not found how I make to configure jBehave stories for easily configuration.

Answer

Rahul picture Rahul · Feb 5, 2013

You can do this using meta tag, @skip in scenarios.

Example given here: http://jbehave.org/reference/stable/meta-info.html