mardi 17 février 2015

Does @AfterGroups execute after unit tests without any group

I have a test class in which there is an @AfterMethod annotated method. I also have a unit test which has a DataProvider. I want the after method to run only once on the above said unit test. For this I can use an @AfterGroups method but will this method run after unit tests which do not specify any groups. Thus in effect I want the @AfterMethod functionality in some unit tests and @AfterGroup functionality in others. I tried to find this out by using breakpoint and by printing a String but it does not work.


I know I can specify unique group name for the unit tests without data providers but I am looking for a more elegant solution.


Aucun commentaire:

Enregistrer un commentaire