2

I use Serenity BDD + Cucumber to perform my test, in fact that I have too many tests I need to run hem separately sometimes. Is it possible to execute Serenity BDD features by groups? Like in jUnit @Group(MyTestGroup.class)?

I can not find any examples.

Eugene S
  • 6,709
  • 8
  • 57
  • 91
java_user
  • 929
  • 4
  • 16
  • 39

2 Answers2

3

You can use tagging for that purpose. Information about that feature can be found in Serenity BDD official documentation.

Just a short excerpt, tags are added to jUnit tests using WithTag annotation. The following will add a tag of type feature (this is a default Serenity type) with name Reporting:

@WithTag(type="feature", name="Reporting")

Then you can run tests with this tag with jUnit like this:

mvn clean verify -Dtags="feature:Reporting"
Eugene S
  • 6,709
  • 8
  • 57
  • 91
0

Follow this documentation Running Serenity BDD tests with Tags.

You can use -Dcucumber.options=" --tags '@Reporting'"

Muthukumaran
  • 126
  • 1
  • 4