I am using testng+webdriver for automated testing. And have a problem that @AfterClass annotation doesn't work as I expected.
I have following test class:
public class WorkspaceTest{
@BeforeClass
public void init(){
//Initialization steps
}
@Test
public void testMethod1{...}
@Test
public void testMethod2{...}
@Test(enabled=false)
public void testMethod3{...}
@AfterClass(alwaysRun=true)
public void tearDown{
//finalizing steps
}
}
If all test methods are enabled - tearDown method works fine, but if one of tests is disabled - I even don't reach break point in tearDown method.
Is it expected behavior for @AfterClass
annotation? or I do something wrong?
Testng version: 6.1.1
Webdriver 2.5.0
Java 1.6.0_26
@AfterClass
correctly (even when one method wasenabled=false
) when I ran the test via Gradle. – checketts