You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BeforeSuite: The annotated method will be run before all tests in this suite have run.
@AfterSuite: The annotated method will be run after all tests in this suite have run.
@BeforeTest: The annotated method will be run before any test method belonging to the classes inside the tag is run.
@AfterTest: The annotated method will be run after all the test methods belonging to the classes inside the tag have run.
@BeforeGroups: The list of groups that this configuration method will run before. This method is guaranteed to run shortly before the first test method that belongs to any of these groups is invoked.
@AfterGroups: The list of groups that this configuration method will run after. This method is guaranteed to run shortly after the last test method that belongs to any of these groups is invoked.
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.
@AfterClass: The annotated method will be run after all the test methods in the current class have been run.
@BeforeMethod: The annotated method will be run before each test method.
@AfterMethod: The annotated method will be run after each test method.
It may be relevant to investigate that the inheritance behavior of the JUnit5 replacements is identical to TestNG:
The annotations above will also be honored (inherited) when placed on a superclass of a TestNG class. This is useful for example to centralize test setup for multiple test classes in a common superclass.
In that case, TestNG guarantees that the "@before" methods are executed in inheritance order (highest superclass first, then going down the inheritance chain), and the "@after" methods in reverse order (going up the inheritance chain).
All of these need to be migrated:
@BeforeSuite
: The annotated method will be run before all tests in this suite have run.@AfterSuite
: The annotated method will be run after all tests in this suite have run.@BeforeTest
: The annotated method will be run before any test method belonging to the classes inside the tag is run.@AfterTest
: The annotated method will be run after all the test methods belonging to the classes inside the tag have run.@BeforeGroups
: The list of groups that this configuration method will run before. This method is guaranteed to run shortly before the first test method that belongs to any of these groups is invoked.@AfterGroups
: The list of groups that this configuration method will run after. This method is guaranteed to run shortly after the last test method that belongs to any of these groups is invoked.@BeforeClass
: The annotated method will be run before the first test method in the current class is invoked.@AfterClass
: The annotated method will be run after all the test methods in the current class have been run.@BeforeMethod
: The annotated method will be run before each test method.@AfterMethod
: The annotated method will be run after each test method.(from the TestNG documentation)
These may be easily migrated using existing recipes:
https://github.com/MBoegers/migrate-testngtojupiter-rewrite/blob/b8031036df2c2207a1263a5b9f624c7703546024/src/main/resources/META-INF/rewrite/rewrite.yml#L20-L35
The text was updated successfully, but these errors were encountered: