Is there a way to output pretty report when running Karate via the command line?
Running this:
java -jar karate-0.9.1.jar tests/*.feature
Produces this:
15:32:56.363 [main] INFO com.intuit.karate.netty.Main - Karate
version: 0.9.1
15:32:56.466 [main] INFO com.intuit.karate.Runner - Karate version:
0.9.1
15:32:56.868 [ForkJoinPool-1-worker-1] WARN com.intuit.karate -
skipping bootstrap configuration: could not find or read file:
classpath:karate-config.js
15:32:57.065 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate -
request:
1 > GET http://localhost:8080/ping
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Host: localhost:8080
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191)
15:32:57.114 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate -
response time in milliseconds: 47.35
1 < 200
1 < Content-Length: 18
1 < Content-Type: application/json; charset=utf-8
1 < Date: Wed, 16 Jan 2019 15:32:57 GMT
1 < X-Request-Id: ffa3630d-19a3-11e9-bbab-0242ac180007
{"message":"pong"}
15:32:57.138 [ForkJoinPool-1-worker-1] ERROR com.intuit.karate -
assertion failed: path: $.message, actual: 'pong', expected:
'pong2', reason: not equal
15:32:57.163 [ForkJoinPool-1-worker-1] INFO
com.intuit.karate.Runner - <<fail>> feature 1 of 1:
tests/ping.feature
---------------------------------------------------------
feature: tests/ping.feature
report: target/tests.ping.json
scenarios: 1 | passed: 0 | failed: 1 | time: 0.2609
---------------------------------------------------------
Karate version: 0.9.1
======================================================
elapsed: 0.70 | threads: 1 | thread time: 0.26
features: 1 | ignored: 0 | efficiency: 0.37
scenarios: 1 | passed: 0 | failed: 1
======================================================
failed features:
tests.ping: ping.feature:8 - path: $.message, actual: 'pong',
expected: 'pong2', reason: not equal
Exception in thread "main" picocli.CommandLine$ExecutionException:
there are test failures
at
com.intuit.karate.netty.Main$1.handleExecutionException
(Main.java:118)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1157)
at com.intuit.karate.netty.Main.main(Main.java:124)
Which is more of a log than a report.
I know Karate generates a pretty HTML report, but this isn't really useful in a CI pipeline when you want to quickly identify what tests have failed.
Something simialar to this would be great:
Feature:
Scenario:
Before hook
Given this step passes
AfterStep hook
After hook
error (RuntimeError)
./features/step_definitions/output_steps.rb:11:in `After'
Failing Scenarios:
cucumber features/test.feature:2
1 scenario (1 failed)
1 step (1 passed)