Karate v0.9.6 Release NotesRelease Date: 2020-08-24 // about 3 years ago
- 🏁 Windows Desktop app automation - Karate Robot - also see the detailed install guide
- 👀 Revamped HTML report (see video)
- 👀 Intercept browser HTTP requests in Chrome (see video)
configure callSingleCache- so that you don't need to wait for a "sign-in flow", every time you re-run a test in dev mode
driver.inputFile()- Chrome-native file-upload
- 💻 WebDriver support for the new (Chromium based) Microsoft Edge browser
- 👌 Improved tree walking in UI tests, e.g.
- 🤡 Multiple mock files can be combined into one at run-time (thanks @michaelpro1)
- 👀 CLI testing support ! See this thread for details
matchcan finally be used in JS with all the power you normally have in feature files, see this thread and some extras to introspect object / data types within JS blocks
contains deepfor recursive nested JSON matching (see example)
💥 Breaking Changes
karate.stop()now takes a mandatory port number argument, so you can call the same (static)
cURLcommand to resume, e.g.
exists()API refactored for UI tests, see this thread for details
- 👀 a
matchwith a primitive number on the right-hand-side could incorrectly pass, this should be very rare - see this thread for details
- again extremely unlikely and rare, but a backslash (
\) character was getting swallowed in doc-string (triple-quote) sections, so in case you were escaping them, you don't need to any more (commit details)
🚀 For a list of all issues closed in this release, go here.
Thanks to the following rock stars for contributions and pull-requests !
Vote for Karate !
Karate is in the running for "Best Open Source Project" in the HackerNoon "Noonies".
👉 Show your appreciation for Karate by voting here: Best Open Source Project
And here for the lead-developer of Karate (Peter Thomas): Contributor of the Year - OPEN SOURCE.
Previous changes from v0.9.5
The Big One
🚀 This took a while ! The last release was in July 2019 - but it does indicate that 0.9.4 was super-stable and that Karate for API testing is quite feature-complete. So what's new ? Web Browser Automation !
🍱 A lot of work went into this area, and the feedback from early adopters who used 0.9.5.RCX has been extremely encouraging. And now 🥁 we consider it ready for use.
👍 To know more about how Karate is different from (and better in our opinion than) the competition - please read this blog post: The world needs an alternative to Selenium - so we built one.
🚀 One additional point that is going to give us an edge over other browser-automation solutions is this - because Karate embeds a web-server (via the test-doubles capability) you can submit a self-contained snippet of HTML as a full-fledged project - to demo or replicate issues. The beauty of this is that it would run completely locally, yet perfectly replicate any exotic edge case. We put a lot of thought into Karate to make it easy for developers to build, extend and maintain, and if you find any gaps in the web-browser automation - we should be able to release minor / dot-releases pretty quickly.
💥 Breaking Changes
💻 What we used to call the "Karate UI" (implemented in JavaFX) has been retired.
Now we have what we feel is a game-changer - a debugger which is part of the Visual Studio Code extension for Karate created by Kirk Slota. This debugger is special - it can not only step-through code, but step backwards and hot-reload code. Note that this works for any Karate test, so API and UI automation is covered. See this video of the Karate-Runner in action. Thanks also to @peterquiel who contributed syntax-coloring support to the Karate-Runner.
🚀 Note that you can point the Karate-Runner to an existing Maven (or even Gradle) project, and it will work fine. The new ZIP Release is ideal for especially non-Java teams - who don't want to use Maven or Gradle.
We know of many .NET, JS and Python shops using the Karate standalone JAR - and the ZIP Release makes a very compelling case for Karate and UI automation. There is no need to compile code, and reports are built-in.
- ✅ Karate used to create a lot of log files on the file-system when running tests in parallel - and in rare cases, would exceed OS limits, not any more - #860
karate.get()now takes a default value, which is very useful for conditional logic and "called" features where a variable has not been "pre-defined". Note that
karate.get()is very flexible, it can evaluate even Json-Path and XPath - not just variable references
- 🐎 Gatling tests would freeze in some cases, performance issues have been fixed - #845
ExecutionHookinterface has been introduced for more control over the life-cycle and for teams that need to integrate with 3-rd party reporting solutions and the like, and you can inject your custom implementation via the parallel
- 🌲 And you can now "mask" parts of the HTTP log to avoid sensitive data such as
Authorizationheaders and passwords being persisted and leaked - #699
- ✅ Distributed Testing - that should solve for "scaling out" UI or Gatling tests
- 👀 Introducing Karate Robot (experimental) for desktop app automation and native mouse / keyboard events, you can navigate using images, see video - we know that many teams need this, there is a severe lack of solutions in this space - so please get in touch and contribute if you can !
karate.log()now "pretty prints" JSON and XML, so you don't have to resort to things like
JSON.parse()- and they cause problems in the long term.
- There is no need to use the
@KarateOptionsannotation for the parallel runner any more. Use the "builder" methods on the
Runnerclass, which handles multiple features (or just directory / paths), tags, and the number of threads. Going forward, as a best-practice, you are recommended to not use the annotations any more - and if you use JUnit 5, you don't need it at all, see the example below
- 👀 JUnit 5 API - a little less verbose syntax via
Karate.run(), see below:
🚀 For a list of all fixes in this release, see here.
Thanks to @paaco, @Celeo, @peterquiel, @ghostwriternr, @sivachithambaram, @BadgerOps, @man007yadav, @Nishant-sehgal, @TamannaBhasin27, @benjaminqc, @babusekaran, @celcius112, @khanguyen88 and @kirksl for pull-requests and other contributions. You rock !