--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
One year has passed, is there anything implemented by now that would allow this?
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/ElUq_cuEA_kJ.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
public static Boolean abortTestSuite = false;
public static Boolean getAbortTestSuite() {
return abortTestSuite;
}
public static void setAbortTestSuite(Boolean abortTestSuite) {
TestBedEnv.abortTestSuite = abortTestSuite;
}
@Test(priority = -10)
public void test01() throws Exception {
// if something catastrophic happens then....
TestBedEnv.setAbortTestSuite(true);
}
@Override
public void onTestStart(ITestResult tr) {
if (TestBedEnv.getAbortTestSuite()) {
throw new SkipException ("Skipping Test: " + tr.getName());
}
}
<?xml version="1.0" encoding="utf-8" standalone="yes"?><suite name="SOAPUI" verbose="3"> <test name="SOAPUI024"> <classes> <class name="TestLab.APOutsource.SOAPUI.SOAPUI024" /> </classes> </test> <test name="SOAPUI025"> <classes> <class name="TestLab.APOutsource.SOAPUI.SOAPUI025" /> </classes> </test> <test name="SOAPUI026"> <classes> <class name="TestLab.APOutsource.SOAPUI.SOAPUI026" /> </classes> </test> <test name="SOAPUI027"> <classes> <class name="TestLab.APOutsource.SOAPUI.SOAPUI027" /> </classes> </test></suite>
@Listeners(ListenerSample.Listen.class)
public class ListenerSample {
@Test
public void test1() {
System.err.println("test1() executed");
}
@Test
public void test2() {
System.err.println("test2() executed");
throw new RuntimeException("Simulating a failure");
}
@Test
public void test3() {
System.err.println("test3() will never be executed");
}
public static class Listen implements IInvokedMethodListener {
private boolean hasFailures = false;
@Override
public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
synchronized (this) {
if (hasFailures) {
throw new SkipException("Skipping this test");
}
}
}
@Override
public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
if (! method.isTestMethod()) {
return;
}
if (! testResult.isSuccess()) {
synchronized (this) {
hasFailures = true;
}
}
}
}
--
@Test
(groups = {
"Primary"
})
3. I set testcase dependency with Anotation
@Test(groups = {"
Dependency
"})
---> It means testcase SOAPUI005 depends on SOAPUI003, when SOAPUI003 fail, it will not run testcase SOAPUI005
4. On testsuite.xml
5. When test case SOAPUI003 failed --> it will skip running SOAPUI005