# E2E Testing Guide

KushoAI's End-to-End (E2E) testing feature enables you to create complex workflows by chaining multiple APIs together. This functionality allows for seamless, sequential, and interconnected API testing.

You can add APIs either manually or select from existing test suites. Since APIs are managed separately, when you select an API from your existing test suites, new test cases are automatically generated for it.

# Creating an E2E Workflow

  1. Navigate to the "Create E2E Workflow" page

  2. Provide a name and description for your E2E workflow, then click "Create"

    After creating the workflow, the following page will be displayed:

# Adding APIs to the Workflow

You can add APIs in two ways:

  • Manually by clicking "Enter New API"
  • From existing test suites by clicking "Select Existing API"

# Adding APIs Manually

  1. Fill in the required details and click the "Add API" button at the bottom right of the screen

  2. Once added, test cases will automatically generate. Click the hamburger icon at the top of the API box to view generated test cases

Note: While you can add or remove APIs from the workflow, single API execution in isolation isn't supported. A workflow requires multiple APIs.

Now, let's add another API.

# API Response Handling

# Passing Responses Between APIs

To pass a response from one API to another:

  1. Click on the source API's response field
  2. Drag it to the target API

Dragging API Response
Dragging API Response
Completing API Connection
Completing API Connection

# Using Specific Response Data

To use specific data from one API's response in another:

  1. Click the edit button on the target API
  2. Locate the Edit Drawer on the right side of the nodes
  3. Under "Connected API Requests," copy the test suite name and format Edit Drawer Location
  4. Add the required field to your API using the following format:
{
  "filter": "%%IBM Intraday Data Fetch.<key_object>.<key>%%"
}

Replace <key_object> and <key> with the previous API's result or response fields. For example, to use a date field from the response, set <key_object> to "response" and <key> to "date".

Test Suite IDs
Test Suite IDs

# Reference Format

Basic format:

%%<test_suite_id>.<response_field>%%

For connected APIs:

%%<test_suite_name>.<key>.<field>%%

# Accessible Response Components

  • response: Main response body
  • headers: Response headers
  • statusCode: HTTP status code
  • request: Original request details

# JSON-e Integration

KushoAI now supports JSON-e for advanced template operations. Use $eval for expressions.

# Connected API Example

# Sample Response Structure

{
  "response": {
    "userId": 1,
    "id": 1,
    "body": "Sample response body"
  },
  "headers": {
    "access-control-allow-credentials": "true"
  },
  "statusCode": 200
}

# Usage Examples

# Basic Usage

{
  "id": "%%Previous Connected API.response.id%%",
  "allowCredentials": "%%Previous Connected API.headers['access-control-allow-credentials']%%"
}

# Advanced JSON-e Integration

{
  "id": "%%Previous Connected API.headers['access-control-allow-credentials']%%",
  "body": {
    "$eval": "split(%%Previous Connected API.response.body%%, ' ')[2]"
  },
  "title": "%%Previous Connected API.response.body%%",
  "userId": ""
}

# JSON-e Features

  • Use %%API_Name.key.field%% to reference connected API values
  • $eval enables JavaScript-like expressions and operations
  • Supported operations include:
    • Array operations
    • String manipulations
    • Arithmetic
    • Logical comparisons
  • Multiple API responses can be combined in a single request
  • Complex objects can be created within $eval expressions
  • Variables can be accessed using \{\{variable_name\}\}

Tip: While JSON-e offers powerful functionality, maintain readable and maintainable expressions.

# Managing Test Cases

After adding test cases, you can choose to add or delete them. Only the selected test cases will run. KushoAI will create and execute various test case combinations. You can perform these actions by clicking the hamburger icon on each node.

Clicking this button opens the Test Case management modal:

Here, you can:

  1. Select the test cases you want to run
  2. Configure test cases for each API individually to create different combinations
  3. Close the window using the "X" button
  4. Click "Run" at the top to execute the selected test combinations

    After selecting your test cases, click "Run" at the top. A new window will appear showing the execution of all possible combinations of the selected tests.

# Random functions

# Random date

For random future date, this is the syntax. The arg is datetime format for the random date you want to generate. For the example shown below, the date will be something like "2026-01-01 10:33:56"

 "<field name>": {
      "$eval": "randomFutureDate('YYYY-MM-DD HH:mm:ss')"
  }

We use dayjs internally for this. You can refer this section of dayjs docs (https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens) for constructing different formats. Or prompting Datetime format for in dayjs on ChatGPT also works.

# Random string

This is syntax for generating random string of a particular format. In this function, "x" will be replaced with a random lowercase letter, "X" with random uppercase letter, "#" with random number and "*" with random alphanum. The example below will generate 2 separate strings with first letter capitalized (something like firstname lastname)

"<field name>": {
      "$eval": "randomStringFromFormat('Xxxxxx Xxxxxxx')"
}

For a random string of particular length, where format doesn't matter, you can use this syntax

"<field name>": {
      "$eval": "randomString(6)"
}

# Auto Field Mapping

For automatically picking up value from previous API response, you can use the __autofill__ placeholder for the fields that you want to automatically fill. By default, we'll match the field name and fill the value if found.

"accountId": "__autofill__"

If you want to fill the value from a different field (e.g. account_id instead of accountId), you can do it like this

"accountId": "__autofill:account_id__"

If you're not sure about the field name, you can also perform fuzzy matching. This syntax will try matching all variations of field name like "accountId", "account_id", etc.

"accountId": "__autofill:fuzzy:account_id__"