I was looking for some way to have some @beforeMethod logic executing only for a group of java unit tests (using TestNG ). I found on TestNG documentation:
onlyForGroups: Only for @BeforeMethod and @AfterMethod. If specified, then this setup/teardown method will only be invoked if the corresponding test method belongs to one of the listed groups.
Which seems to be what I'm looking for.
But when I try to use it, it's not implemented in @BeforeMethod and @AfterMethod annotations. I couldn't find find any information on the web about it missing.
Maven dependency :
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.2</version>
<scope>test</scope>
</dependency>
Thanks for the help