v0.6.1
Breaking Changes
Java API method signature change
Additional boolean
argument, true
to process (and false
to skip) the evaluation of karate-config.js
at the start.
_$
instead of $
for match each
In case you were using $
for cross-field validations combined with a match each
, the concept of a 'self parent' was introduced, since you may still need the 'real' root $
. Refer to the documentation.
Notable Enhancements & Fixes
No more Stack Trace bloat
Yes, finally. Making sense of the console logs used to be difficult when scripts failed, and Karate used to dump a lot of un-necessary stack-traces. Not any more. Failures now are reported in as few lines as possible, line-breaks are included to make it easier to read (instead of scrolling around for very long lines) and the offending line number and feature-file name are clearly shown. Do submit feedback if you see any opportunities to improve further !
__arg
refers to call
argument #206
Yes, we should have had this earlier. While all key-values are 'unpacked' into the context of the 'called' feature, it does make sense to be able to access the passed-in argument as-a-whole. Refer to the documentation. This is a nice companion to __loop
which was introduced in the previous release.
SSL bypass fix #193
Handling SSL without needing a certificate was broken in some cases. In case you were having to use a certificate for HTTPS, do try setting * configure ssl = true
and it should now work without needing a certificate.
Scripts can introspect Cucumber tags #191
You can ask Karate for the values of all tags in scope. And for advanced users, Karate now natively supports tags with values in the form @name=value1,value2
. Tag 'inheritance' works as you expect since in Cucumber, you can have tags at the level of a Feature
, Scenario
or Scenario Outline
and even for rows within Examples
. The possibilities are best explained in this example: tags.feature
For even more advanced users, there is a way in which you can set up custom tag filtering. Thanks to Sunil Sishtla for the pull request.
print
now takes comma delimited arguments #190
Which means you no longer need to use karate.pretty()
in most cases. Refer to the documentation.
set
keyword can append to JSON arrays #189
* def foo = {}
# you can update json arrays (or create them automatically)
* set foo.bar[0] = 5
* match foo == { bar: [5] }
# omit the array index to append
* set foo.bar[] = 6
* match foo == { bar: [5, 6] }
parallel runner console stats now includes the count of feature files
And decimal-places reined in.
====================================================
elapsed time: 3.62 | total thread time: 13.79
features: 31 | threads: 5 | efficiency: 0.76
scenarios: 70 | failed: 0 | skipped: 0
====================================================
!contains
(not contains) for strings now works #201
!=
(not equals) implemented
You won't need this most of the time, but still.
charset
now supported in the Content-Type
header #203
Experimental HTML report for JUnit
When you use the @RunWith(Karate.class)
annotation, an HTML file will be generated in the target/surefire-reports
directory. As of now, it is not useful - but we will be enhancing this to make troubleshooting in dev easier. The long-term goal is to have HTML reports 'native' to Karate that better reflect API-testing concerns.