Skip to content

v0.9.3

Compare
Choose a tag to compare
@ptrthomas ptrthomas released this 10 Jun 01:39
· 3078 commits to master since this release

Breaking Changes

  • Karate UI no longer part of karate-core and has to be explicitly added to your Maven (or Gradle) dependencies if you want to use it - as karate-ui.
  • WebSocket API changes, see the documentation here - and you call listen() on the socket instance, not on the karate object. You can now juggle multiple websocket connections within a Scenario. Custom headers can be added and you can change the default message limit, in case you are using large binary websocket payloads.
  • The karate-netty Maven artifact has been retired. The Netty / mocks code has been part of karate-core since 0.9.0, and in fact if you use karate-apache (or karate-jersey) you don't need any additional dependency any more. If you were using only karate-netty in a project, change it to karate-apache. The karate-netty dependency used to include the net.masterthought:cucumber-reporting dependency, 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 } - the true here 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 times
  • karate.mapWithKey() - convenient for the common case of converting an array of primitives into an array of "single key-value pair" JSON-s
  • karate.set() - set multiple variables in one shot from a JSON / bag of key-values
  • karate.merge() - merge 2 or more JSON / map-like objects
  • karate.append() - append 2 or more objects or list-like objects into a single array / list
  • karate.sizeOf() - future-proof way to get the size of an object / map or array / list without worrying about the Java type behind the scenes
  • karate.keysOf() - future-proof way to get the keys of an object / map without worrying about the Java type behind the scenes
  • karate.valuesOf() - future-proof way to get the values of an object / map (or array / list) without worrying about the Java type behind the scenes
  • karate.appendTo() - useful for appending items into an existing variable that is expected to be list-like, without worrying about the Java type behind the scenes
  • karate.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.