Our documentation site has been updated to AIO Tests Knowledge Base

Karate Framework

AIO Tests supports importing Karate Framework results through it’s 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 on how you can generate the Cucumber report from Karate and upload it to AIO Tests.

Required Karate Setup

  1. Java 8 + Maven

  2. 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.

Feature: AIO Tests Demo Karate file Scenario: get all users and then get the first user by id Given url baseUrl Given header Authorization = auth Given path '/project/',projectKey,'/config/testcase/status' When method get Then status 200 * def first = response[0] And print first Then assert first.name == 'Draft' Then assert first.description == 'The test is being worked upon and'

 

The archetype also generates a Karate configurations file (karate-config.js), which can hold variables per environment or to 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:

function fn() { //Setting showLog to false, to avoid cluttering response docstrings // with response objects karate.configure('report',{ showLog: false, showAllSteps: true } var config = { baseUrl: "https://tcms.aiojiraapps.com/aio-tcms/api/v1", auth: 'AioAuth <yourauth>', projectKey: 'NVTES' } return config; }

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 and is detailed @

https://aioreports.atlassian.net/wiki/spaces/NAT/pages/1900879638/Cucumber#Mapping-Cucumber-tests-to-AIO-Tests

Importing Results

Post execution of a suite, the TEST-<xxx>.xml file can be uploaded either via

Please follow the above links to continue to import results using either of the options.