Test Automation Made Simple
Karate 1.5.0 will require Java 17. Karate 1.5.0 will also change the Maven group-id from com.intuit.karate
to io.karatelabs
. For a smoother transition, the Java APIs would be changed in a future release (most likely 1.6.0).
This is an RC release, so there could be minor changes before 1.5.0 (final). But most teams can start using this, especially those who need Java 17 and the CVE resolutions.
Here is a complete list of all issues fixed in this release. Since the statuses can change, use the below snapshot as a reference.
Full Changelog: https://github.com/karatelabs/karate/compare/v1.4.1...v1.5.0.RC3
First, a big THANK YOU to all new contributors !
For those interested in participating in Hacktoberfest, you can find instructions here: Karate and Hacktoberfest
Some notable improvements:
driver.intercept()
(Chrome only) now returns a mock, which opens up some advanced use-cases, see #2361Here is a complete list of all issues fixed in this release.
The good news is that for most teams there should not be any breakages to existing test scripts. But there are a few things to note, read on below.
match each
defaults to fail if array is emptyYou can read a detailed description in the issue #2364. This may break existing test scripts only if you are extensively using the fuzzy matching short-cut #[]
in enbedded schema validations. The good news is that if you see any of your existing tests break, you can do this to get back the old behavior.
* configure matchEachEmptyAllowed = true
if a match each
fails now with Karate 1.4.1, ensure that any JsonPath expression on the LHS (Left Hand Side) is accurate. The reason for this change in Karate behavior is that previously - if you had an invalid JsonPath expression on the LHS of a match each
, it would always return an empty array, and the match
would always pass.
karatelabs
organizationUntil now, the karate-chrome Docker image was published at ptrthomas/karate-chrome. It has now moved to karatelabs/karate-chrome.
IDE debugging now requires an extra dependency on the classpath. Maven and Gradle users can use the io.karatelabs:karate-debugserver
dependency. For details on how to use the new debug-server in IntelliJ or VS Code, please refer to this wiki page: Debug Server.
Karate used to have a distributed-testing (experimental) option released in v0.9.5. This is no-longer available as part of karate-core
Karate 1.5.0 will require Java 17. This is a bit sooner than we expected, but reasons are explained in #2401 - mainly because of needing to address some CVEs. 1.4.1 may be the last release that supports Java 11.
Karate 1.5.0 will also change the Maven group-id from com.intuit.karate
to io.karatelabs
. Note that a 1.5.0.RC1 is available for teams to start trying this out. For a smoother transition, the Java APIs would be changed in a future release (most likely 1.6.0).
Full Changelog: https://github.com/karatelabs/karate/compare/v1.4.0...v1.4.1
There are multiple security vulnerabilities in libraries that Karate depends on that are fixed in this release. If you are on an old version of Karate - it is strongly recommended that you upgrade. Refer #2148 | #2265 | #2277
The main change in this release is that Karate requires Java 11 or above. We no longer support Java 8. Otherwise there should not be any syntax or behavior changes (from Karate 1.3.X).
Note that some of the security / CVE fixes cannot be back-ported to Java 8 because they depend on Java 11.
Also note:
Runner
API or JUnit 5
karate-mock-servlet
dependency is no longer publishedcucumber-java
1.2.5 dependency is no longer included, refer #2214Here is a complete list of all issues fixed in this release.
Full Changelog: https://github.com/karatelabs/karate/compare/v1.3.1...v1.4.0
@setup
wrongly increased scenario count #2169@setup
was running even when supposed to be skipped #2169@setup
missed a way to run setup once #2210karate.env
#2196match each
now works for contains deep
#2170A big thanks to @jkeys089 who contributed this after exploring various commercial and open-source tools. This is designed to solve issues encountered using existing / external screenshot comparison services. For example:
The solution:
Karate now has a compareImage
keyword and the corresponding karate.compareImage()
JS API.
Refer to this video for how to use the HTML UI in the Karate report to inspect, configure and update the screenshots.
This is a big deal, achieved after upgrading Graal to version 22.0.
Advanced users of Karate may have run into some edge cases when trying to pass a JavaScript function to called feature files, especially when callonce
and karate.callSingle()
are involved and tests are run in parallel.
These issues were mostly solved in 1.1.0 and 1.2.0, but a few rare cases were still reported.
This issue is finally resolved along with some code clean-up and we are back to how things were in v0.9.X. You can freely pass JS functions all over the place.
karate.response
and karate.request
APIThis specifically solves for retrieving a given header while ignoring the case. While Karate already had support for this in simple match
statements and via the configure lowerCaseResponseHeaders
option, there were advanced use-cases that required more control. You can find more details here. Here is an example:
karate.response.header('content-type')
.
This also makes mock request routing based on headers much easier, for e.g. karate.request.header('foo') == 'bar'
.
This is an alternate option for those who want to write more complicated mocks and opens up a lot of possibilities. The "server side" JS API is simple, clean and designed to even serve dynamic HTML.
Refer to this documentation for more: Karate JavaScript Mocks.
contains only deep
for match
This is an enhancement to match
that makes it possible to assert that a JSON is "deep equal to" another - but with the slight twist that JSON array order is ignored. Come to think of it, we should have had this sooner :| This is expected to be very relevant for teams using GraphQL. Details here: https://github.com/karatelabs/karate/issues/2093
configure abortSuiteOnFailure
Some teams have requested for being able to stop the entire test suite if one test fails. This will save time when the environment has issues and "fail fast" instead of letting the CI job plough on and result in all tests failing. Details here: https://github.com/karatelabs/karate/issues/2090
Scenario Outline
sSee the new @setup
life-cycle described below.
@setup
life-cycleThis is an important change that adds a new life-cycle to scenarios. There is a description and discussion here. The updated documentation can be found here.
The highlights are:
Scenario
startsScenario Outline
(but can also be called from any Scenario
)Background
was only run once, but with this change, the Background
will run before every Scenario
whether it is
Scenario
Examples:
in a "normal" Scenario Outline:
Scenario Outline:
<-- this is the breaking changeHere is a diff of what to expect. In most cases, where you were using a Background
to "drive" a dynamic Scenario Outline
, the change is to use a Scenario
tagged with @setup
instead.
url
is not passed to called featuresMost likely you won't be affected by this. But in 1.2.0 we un-intentionally introduced a bug that the url
and path
in the HTTP "builder" behind the scenes would NOT reset when you call a feature. You can find more details here.
For details, see: https://github.com/karatelabs/karate/issues/2009#issuecomment-1228632313
karate.webSocket()
APIThis is a breaking change, but the pattern for editing your existing tests is quite straightforward. Here below is a before-and-after:
socket.listen(5000)
call has to be replaced with * listen 5000
- where 5000 (here just an example) is the timeout in millisecondslistenResult
holds the result of the captured websocket message1.3.0 will be the last release of Karate that allows for usage of Java 8. From 1.4.0 onwards, Karate will have a minimum requirement of Java 11. Please comment here if you have any concerns.
For what's fixed in this version, refer to this list.
Full Changelog: https://github.com/karatelabs/karate/compare/v1.2.0...v1.3.0
Only the "fatjar" release that fixes #2028
A "final" release after half a year. Multiple fixes and stability improvements. Thanks to all who tested RC releases.
For what's fixed in this version, refer to this list.
Note that we have an experimental NPM package for Node / JS teams. Please spread the word !
Please read the 1.2.0 Upgrade Guide. The good news is that this will not impact most projects.
Karate also starts tracking a very basic level of analytics. Read more here.
Thanks to all contributors, past and present !
Full Changelog: https://github.com/karatelabs/karate/compare/v1.1.0...v1.2.0
We want to make sure that our new release automation pipeline delivers artifacts that work for all Java versions (8 and above).
For what's fixed in this version, look at the issues here that have the fixed
tag.
This release includes the Docker image.
Note that we have an experimental NPM package for Node / JS teams. Please spread the word !
Please read the 1.2.0 Upgrade Guide. The good news is that this will not impact most projects.
This release is for the benefit of those blocked by some specific issues.
For what's fixed in this version, look at the issues here that have the fixed
tag. A screen-shot of the 7 issues is shown below for handy reference.
Note that the Docker container has not been released.
Yes really.
karate.callSingle()
and callonce
#1558@ignore
tag is now "baked-in", and there are some new ones, refer to the docs
karate.env
in a very interesting and useful way, refer to the docs
You are all awesome 🙏 @jfougere #1679 @ericdriggs #1666 #1672 @sormuras #1646 @dhamo-pk #1629 @aaronjwhiteside #1624 #1625 @abhi-rao #1611 #1613 @brianngo313 #1599 @burhanh #1594 @arthur25000 #1584 #1590 @chaudharydeepak #1581 @dinesh19aug #1573 #1585 @ivangsa #1570 @joelpramos #1562 #1603 #1615 #1636 #1637 @babusekaran #1550 @aleruz #1534 #1556 @parched #1529 @workwithprashant #1524
For a list of all issues closed in this release, go here.
To keep track of news and releases, follow us on Twitter @KarateDSL or on LinkedIn or by joining this group.