Serenity BDD fun features by groups Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Serenity BDD fun features by groups without wasting too much if your time.

The question is published on by Tutorial Guruji team.

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.


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"
We are here to answer your question about Serenity BDD fun features by groups - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji