v0.9.3
Breaking Changes
- Karate UI no longer part of
karate-coreand has to be explicitly added to your Maven (or Gradle) dependencies if you want to use it - askarate-ui. - WebSocket API changes, see the documentation here - and you call
listen()on the socket instance, not on thekarateobject. You can now juggle multiple websocket connections within aScenario. Custom headers can be added and you can change the default message limit, in case you are using large binary websocket payloads. - The
karate-nettyMaven artifact has been retired. The Netty / mocks code has been part ofkarate-coresince 0.9.0, and in fact if you usekarate-apache(orkarate-jersey) you don't need any additional dependency any more. If you were using onlykarate-nettyin a project, change it tokarate-apache. Thekarate-nettydependency used to include thenet.masterthought:cucumber-reportingdependency, which may have been convenient - but now if you need that reporting solution, you have to add that dependency explicitly. - a long pending issue where nested arrays in JSON created within JS would turn into JSON objects (instead of remaining as arrays) has been fixed - so in the rare chance that you have this happening in your existing tests, they might break.
- if you are using
* configure ssl = { trustAll: true }- thetruehere is now a boolean, not a string #772
See complete / detailed list of fixes here.
Notable improvements
Gatling fixes #721
Some kinds of tests would not "complete" leaving some requests missing from the final report and perf stats. Also the tendency to "hang" is fixed.
Enhanced Scenario Outline #717
This is possibly one of the best innovations yet in the Cucumber improvements that Karate brings. Now the Scenario Outline is tightly integrated with Karate's JSON data-driven capabilities. Read about it in detail here: Scenario Outline Enhancements
Run Scenario by name and line-number #770 #773
You can now run a Scenario by name or line-number which is extremely convenient in development mode. While possible in Cucumber, this had been temporarily lost after we dropped the Cucumber-JVM engine.
New API methods on the karate object
karate.repeat()- avoid nasty JS loops to do an action N timeskarate.mapWithKey()- convenient for the common case of converting an array of primitives into an array of "single key-value pair" JSON-skarate.set()- set multiple variables in one shot from a JSON / bag of key-valueskarate.merge()- merge 2 or more JSON / map-like objectskarate.append()- append 2 or more objects or list-like objects into a single array / listkarate.sizeOf()- future-proof way to get the size of an object / map or array / list without worrying about the Java type behind the sceneskarate.keysOf()- future-proof way to get the keys of an object / map without worrying about the Java type behind the sceneskarate.valuesOf()- future-proof way to get the values of an object / map (or array / list) without worrying about the Java type behind the sceneskarate.appendTo()- useful for appending items into an existing variable that is expected to be list-like, without worrying about the Java type behind the sceneskarate.exec()- convenient way to invoke a native OS command and scrape the console output
experimental Appium support / UI automation #743
Do try / contribute if you can !
Karate confirmed to work with Java 12 #724
Karate is one of the few automation frameworks that is Java 12 ready. Note that we have a migration to Graal planned that will ensure support for Java versions beyond 12.