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