I've tests where based on some condition, I skip execution in @BeforeClass
itself like -
@BeforeClass(alwaysRun = true)
public void beforeClass() {
if (someCondition) {
//do something
} else {
throw new SkipException("THESE TESTS ARE NOT INTENDED TO EXECUTE: ");
}
}
@BeforeMethod
public void beforeMethod() {
// do something
}
But I run tests, skipExecution statement is executed still execution goes in method annotated with @BeforeMethod
and code under it is executed which results my tests in failure instead of skip status.
Is this known bug in TestNG or issue with TestNG version? I'm using TestNG 6.9.10
version