You can edit almost every page by Creating an account and confirming your email.

Karate (software)

From EverybodyWiki Bios & Wiki

Karate is an open-source general-purpose test-automation framework that can script calls to HTTP end-points and assert that the JSON or XML responses are as expected. Karate also has support for service-virtualization where it can bring up "mock" (or stub) servers which can substitute for web-services that need to participate in an integration-test. Karate's capabilities include being able to run tests in parallel, HTML reports and compatibility with Continuous Integration tools.

Karate is implemented in Java but test-scripts are written in Gherkin since Karate was originally an extension of the Cucumber framework.

History

Karate was created by Peter Thomas.[1]

Basic usage

This example shows what a simple Karate test script looks like and how it is based on the Gherkin syntax.

Feature: karate 'hello world' example
Scenario: create and retrieve a cat

Given url 'http://myhost.com/v1/cats'
And request { name: 'Billie' }
When method post
Then status 201
And match response == { id: '#notnull', name: 'Billie' }

Given path response.id
When method get
Then status 200

This actually makes two calls, first an HTTP POST to 'http://myhost.com/v1/cats' and then a GET to the same URL but with the value of response.id appended as a REST-ful path parameter. The match keyword is used for asserting that a given payload is as expected. The use of the #notnull "fuzzy match" token takes care of "ignoring" the actual value since it is dynamic, as it is a server-side auto-generated identifier.

Features

  • Although based on Cucumber, Karate does not require the user to write extra "step-definitions", which saves a lot of effort. Tests are fully described in Gherkin.[2]
  • Built-in support for switching the environment[3]
  • Comprehensive support for HTTP, including SOAP/XML, HTTPS, HTTP proxies, URL-encoded form data, multi-part file uploads[3]
  • HTTP API mocks
  • Integration with popular Java unit-testing frameworks such as JUnit[4]
  • Compatibility with continuous integration tools[4]
  • Web-browser automation of Chrome via the Chrome DevTools Protocol
  • Cross-browser automation via the W3C WebDriver specification

Reception

Karate was featured as one of the top 5 open-source API testing tools within six months of its release.[5] It was also mentioned as one of the 10 API testing tools to try in 2017.[3]

Karate was first listed in the ThoughtWorks Technology Radar in 2019[6] with a rating of "Assess". One year later it moved into the "Trial" category in May 2020.[7]

References

  1. Quiel, Peter (2021-07-21). "7 New Features in Karate". Software That Matters. Retrieved 2018-02-23.
  2. "REST API Testing with Karate | Baeldung". Baeldung. 2017-11-16. Retrieved 2018-02-23.
  3. 3.0 3.1 3.2 Assertible. "10 API testing tools to try in 2017". Assertible. Retrieved 2018-02-23.
  4. 4.0 4.1 "Testing a Java Spring Boot REST API with Karate". semaphoreci.com. Retrieved 2018-02-23.
  5. "5 top open-source API testing tools: How to choose | TechBeacon". TechBeacon. Retrieved 2018-02-23.
  6. "ThoughtWorks Technology Radar Vol. 20 (April 2019)" (PDF). Retrieved 2019-09-19. Unknown parameter |url-status= ignored (help)
  7. "ThoughtWorks Technology Radar (Languages & Frameworks) Vol. 22 (May 2020)". Unknown parameter |url-status= ignored (help)

External links


This article "Karate (software)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Karate (software). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.