I'm basically attempting to run my scenarios in sequence and trying to find if there is a way to get the handle to Results
in @AfterClass method.
I know that it is possible when running in parallel, but our necessity is to get a break down of all the test executed in test report which is not possible when implemented like below.
public class AllTestRunner {
@Test
public void testParallel() {
Results results = Runner.parallel(1, "classpath:karate/feature");
}
}
The issue with this approach is that test reports appear as only 1 test executed which is not expected.
Is there a way to get Results when running like below ?
@RunWith(Karate.class)
@KarateOptions(features = "classpath:karate/feature")
public class AllTestRunner {
@AfterClass
public void testParallel() {
Results results = ...;
}
}
Basically the purpose of trying to get the Results is to perform an API call if a scenario has failed, by checking result.isFailed()
.
Again, running tests in parallel is generating in test report like below.
1 tests 0 failures 0 ignored 7.373s duration 100% successful
Tests Standard output
Test Duration Result
testParallel 7.373s passed