serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
715 stars 513 forks source link

@WithTag, @WithTags, @Tag and @Tags do not work in Serenity Core 3.2.x - Gradle Junit 5 #2976

Open tibioneh opened 1 year ago

tibioneh commented 1 year ago

Cannot run tests by tags in a Serenity BDD - Junit 5 project.

The solution in this closed issue is not working for Gradle: https://github.com/serenity-bdd/serenity-core/issues/2801 Nor this: https://stackoverflow.com/questions/69541988/is-there-a-way-to-add-tags-to-tests-using-serenity-and-gradle Nor this: https://groups.google.com/g/thucydides-users/c/M5EqYS9Bmck

I tried all possible variations, still all tests are being ran.

ViktorMikhalkin commented 1 year ago

Also, true for Maven. The possible workaround can be Tag annotation from Junit5.

eotsevych commented 1 year ago

Still reproduced in 3.6.7

wakaleo commented 1 year ago

These annotations aren't supported with JUnit 5, since JUnit 5 has it's own @Tag annotation.

eotsevych commented 1 year ago

Indeed, now only junit5 @tag works

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-surefire-plugin</artifactId>
     <version>3.0.0</version>
     <configuration>
         <groups>integration, feature-a</groups>
         <excludedGroups>slow</excludedGroups>
      </configuration>
</plugin>

with CLI:

mvn -Dgroups="integration, feature-a"
mvn -DexcludedGroups="slow"