Karate Framework
AIO Tests supports importing Karate Framework results through its support for Cucumber reports.
Karate is an open-source general-purpose test-automation framework that can script calls to HTTP end-points and assert that the responses are valid. It also supports UI Automation. Karate is implemented in Java but test scripts are written in Gherkin since Karate was originally an extension of the Cucumber framework.
Karate can generate Cucumber reports, which can then be imported into AIO Tests, to report results from Karate runs to AIO Tests. This document provides an overview of how you can generate the Cucumber report from Karate and upload it to AIO Tests.
In this documentation, you’ll understand:
Required Karate Setup
Java 8 + Maven
Use the karate archetype to generate a sample project.
mvn archetype:generate \ -DarchetypeGroupId=com.intuit.karate \ -DarchetypeArtifactId=karate-archetype \ -DarchetypeVersion=1.2.0 \ -DgroupId=com.aiotests \ -DartifactId=aio-karate-tests
To start using Karate, please follow the Get Started documentation.
Sample Case
This document will work on the below sample case, which demos a simple AIO Tests API test.
The archetype also generates a Karate configurations file (karate-config.js), which can hold variables per environment or define actions to be executed in different environments. Global variables accessible to all cases can be defined in this file.
The sample case above is using the below variables:
Running the Sample Case and Generating Cucumber JSON Report
For running the cases and generating the cucumber report, the following class identifies what needs to run.
Note the addition of .outputCucumberJson(true)
to generate the cucumber.report.
Running the above generates the following results file:
Mapping Cases with AIO Tests
AIO Tests supports creating tests using the cucumber reports as well as mapping existing cases. Cases can simply be mapped using the AIO Tests Case keys as tags on features.
The mapping of cases follows the same convention as Cucumber. To learn more, click here.
Importing Results
Post execution of a suite, the TEST-<xxx>.xml file can be uploaded either via
AIO Tests REST API calls using multipart form data to upload file
Please follow the above links to continue to import results using either of the options.
For further queries and suggestions, feel free to reach out to our customer support via help@aiotests.com.