Skip to content

Files

Latest commit

 

History

History
 
 

api-tests

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Karate

Web-Services Testing Made Simple.

Maven Central Build Status GitHub release Support Slack Twitter Follow

Karate enables you to script a sequence of calls to any kind of web-service and assert that the responses are as expected. It makes it really easy to build complex request payloads, traverse data within the responses, and chain data from responses into the next request. Karate's payload validation engine can perform a 'smart compare' of two JSON or XML documents without being affected by white-space or the order in which data-elements actually appear, and you can opt to ignore fields that you choose.

Since Karate is built on top of Cucumber-JVM, you can run tests and generate reports like any standard Java project. But instead of Java - you write tests in a language designed to make dealing with HTTP, JSON or XML - simple.

Hello World

It is worth pointing out that JSON is a 'first class citizen' of the syntax such that you can express payload and expected data without having to use double-quotes and without having to enclose JSON field names in quotes. There is no need to 'escape' characters like you would have had to in Java or other programming languages.

And you don't need to create Java objects (or POJO-s) for any of the payloads that you need to work with.

Setup and Run Tests

Make sure a local instance of api-audit service is running on your local host.

If you running tests for api-audit

$> cd Hygieia/api-tests/api-audit

$> mvn clean install

If you want to add tests to api, create a sub project api in api-tests project and create similar folder structure as api-tests/api-audit