Skip to content

Latest commit

Β 

History

History
76 lines (52 loc) Β· 2.16 KB

File metadata and controls

76 lines (52 loc) Β· 2.16 KB
id test-generate
title What is API testing?
sidebar_label Generate Tests
description This section documents what is API Testing and why we need it
tags
API testing
API mocks
generate test cases
test automation
keywords
api testing
api mocks
automated testing
ai testing
keploy
Gemini
OpenAI

πŸ§ͺ AI-Powered API Test Suite Generation

Keploy enables you to automatically generate comprehensive API test suites for your application using AI, based on live requests, API schemas, and supporting documentation.

πŸš€ Create API Tests in 4 Simple Steps

1️⃣ Create a New App

Start by creating a new test project for your application:

  • Click on "Create New App"
  • Give it a name that matches your app/module
  • Optionally provide a description

2️⃣ Input URL or Endpoint

Provide a base URL or a specific API endpoint you want to test:

This helps Keploy identify where the API requests are sent and initiate context-aware test generation.

3️⃣ Add Test Inputs

πŸ” Authentication (Optional)

If your API requires authentication, make sure you:

  • Add API keys or bearer tokens in headers
  • Or include auth flows via test inputs below

πŸ“Ž Paste cURL Snippets (Recommended: 3–5)

Add working curl commands representing real user flows. These help the AI infer request types, payloads, and expected outcomes.

curl -X POST https://your-api.com/login -d 'username=john&password=secret'

curl -X GET https://your-api.com/users

curl -X PUT https://your-api.com/users/1 -d 'username=john&role=admin'

πŸ“„ Swagger / OpenAPI Schema

Paste your OpenAPI (Swagger) spec in either YAML or JSON format.
This schema provides a contract for how endpoints behave and enables accurate, schema-driven test generation.

4️⃣ Upload Supporting Resources (Optional but Valuable)

Enhance test accuracy by uploading documentation such as:

  • 🧾 API Docs (Postman collections, Swagger files)
  • πŸ’» Code Snippets
  • πŸ“„ PRD/BRD documents
  • πŸ—‚ Feature briefs or requirement docs

These help Keploy better understand the intended logic and behavior of each endpoint.