Issues with skipped tests in summary and html report
See original GitHub issueI have been using karate for automated tests (starting with 0.6.0, in September 2017) and am very happy with this excellent tool. I pulled the latest 0.8.0 (for https://github.com/intuit/karate/issues/418) and noticed couple of things that I would like to bring to your notice. Let me start of by saying this issue is related to karate.abort()
and related summary/html reports (the undocumented / secret unreleased feature) and can be treated as enhancement
. I did look at the open issues and feel this issue was not raised before.
Now here is the issue I would like to discuss before sending a PR. For the hypothetical test given below:
Scenario: test abort
* def result = call read('some-test.feature')
// skip tests below if some-test.feature failed for what ever reason
* def check2Abort = (result.response == 'failed' ? karate.abort() : {} )
// continue with rest of the steps in this scenario
The two issues are
- summary shown after the test is executed doesn’t show any skipped tests
- and the cucumber html report doesn’t show any skipped tests as well
Please note that the steps are actually skipped (as expected), but the report doesn’t reflect these skipped steps. Let me point two one line changes that I was thinking about Change needed in https://github.com/intuit/karate/blob/master/karate-core/src/main/java/com/intuit/karate/cucumber/KarateHtmlReporter.java#L236
else if ((StepResult.ABORTED.equals(result.getStatus())) || (Result.SKIPPED.getStatus()
.equals(result.getStatus()))) {
And https://github.com/intuit/karate/blob/master/karate-core/src/main/java/com/intuit/karate/cucumber/KarateRuntime.java#L77 need to be modified as
Result result = aborted ? Result.SKIPPED : StepResult.PASSED;
This is the first time I was looking at karate source tree (so far I have been a passive user), so please bear with me if I missed the reason for proposed karate.abort() and feel free to shoot down the issue/suggested code change.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (10 by maintainers)
@ptrthomas sure, I will try to work on it and raise a PR with a test case.
On a separate note: I am happy to see (from community news) that you will be presenting at Dev Conf in Bangalore (https://devconfin2018.sched.com/event/F749/karate-microservices-test-automation-made-simple), hoping to meet you in person.
@Adarshkrishna9099 unlikely. open a new issue and make sure you follow this process please: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue