I don't have a lot of experiences with TestNG, so do you know hot to skip or ignore some tests in Java Runtime. My idea is to write @Before-annotiation test and if it fails the incoming test will be ignored.
I tried to use JUnit with assume method, but I don't prefer it because if "before-test" fails the incoming test is highlighted as passed and it's not a reliable solution because it has ambiguous meaning.
So if you have any experiences with TestNG, please help I would be grateful.
You can skip test by throwing SkipException
throw new SkipException("Skip this");
You need group of tests. Annotation @Test with next params
dependOnGroup
or
dependsOnMethods
e.g.
@Test
public void verifyConfig() {
//verify some test config parameters
}
@Test(dependsOnMethods={"verifyConfig"})
public void dotest(){
//Actual test
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With