Skip to content

Commit e32cfbd

Browse files
authored
feat: add api testing cicd integration (#595)
Signed-off-by: Achanandhi-M <[email protected]>
1 parent 3d7a396 commit e32cfbd

File tree

3 files changed

+101
-2
lines changed

3 files changed

+101
-2
lines changed

src/components/KeployCloud.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const KeployCloud = () => {
66
id="cloud"
77
className="mb-12 mt-24 flex max-w-7xl items-center space-x-5 rounded-lg bg-[color:var(--ifm-card-background-color)] p-5"
88
>
9-
<div className="max-w-3xl mx-auto prose prose-orange">
9+
<div className="prose prose-orange mx-auto max-w-3xl">
1010
<h1> Question? 🤔💭</h1>
1111
<p className="my-3 block">
1212
For any support please{" "}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
id: api-testing-cicd
3+
title: API Test Setup for GitHub CI/CD
4+
sidebar_label: CI/CD Integration
5+
description: Learn how to seamlessly integrate Keploy's AI-powered API tests with GitHub Actions for continuous testing.
6+
tags:
7+
- API testing
8+
- test automation
9+
- AI testing
10+
- ci testing
11+
- plugin
12+
- ci pipeline
13+
keywords:
14+
- fix failing tests
15+
- ci testing
16+
- ci/cd
17+
- github
18+
---
19+
20+
Keploy makes it super simple to run API tests during your CI/CD pipeline on GitHub. Here’s a step-by-step guide to help you set it up in just a few minutes!
21+
22+
## Step 1: Get the Test Command from Keploy Dashboard
23+
24+
1. Go to [app.keploy.io](https://app.keploy.io)
25+
2. Click on **Test Suite** in the sidebar
26+
27+
![Test Suite Page](https://keploy-devrel.s3.us-west-2.amazonaws.com/testsuite-apitesting.png)
28+
29+
3. You'll see an option to “Run test suites natively”
30+
31+
![Run Natively Button](https://keploy-devrel.s3.us-west-2.amazonaws.com/apitestsuites.png)
32+
33+
4. **Copy the command**
34+
![Copy Command](https://keploy-devrel.s3.us-west-2.amazonaws.com/apitesting-ci-cmd.png)
35+
36+
## Step 2: Set Up GitHub Actions Workflow
37+
38+
Add the following steps to your `.github/workflows/ci.yml` file:
39+
40+
### Install Keploy CLI
41+
42+
```yaml
43+
- name: Install Keploy CLI
44+
run: |
45+
curl --silent -L https://keploy.io/ent/install.sh | bash
46+
```
47+
48+
### Run Keploy API Tests
49+
50+
Paste the command copied from the dashboard here:
51+
52+
```yaml
53+
- name: Run Keploy Test Suite
54+
run: |
55+
export KEPLOY_API_KEY=${{ secrets.KEPLOY_API_KEY }}
56+
keploy test-suite --app=03d24177-315c-4ee1-a3ac-64ed0ab38567 --base-path http://localhost:8080/books --cloud
57+
```
58+
59+
### ⚠️ **Note**
60+
61+
Don’t forget to add your `KEPLOY_API_KEY` as a GitHub secret!
62+
**Go to your repo → Settings → Security → Actions → _New Repository Secret_**
63+
64+
Replace `--app` and `--base-path` with your actual values from the Keploy Dashboard.
65+
66+
## Output Example: Real-time Test Execution Logs
67+
68+
Once integrated, here’s what a successful run may look like in your GitHub Actions console:
69+
70+
```sh
71+
🐰 Keploy: Running test suite {"name": "Create and update one book verify other is unaffected via list"}
72+
🐰 Keploy: Running test case {"name": "Create Book A"}
73+
🐰 Keploy: step passed {"step": "Create Book A"}
74+
...
75+
76+
+------------------------------------------+--------+-------+
77+
| Test Case | Status | Runs |
78+
+------------------------------------------+--------+-------+
79+
| Create book with only title | PASSED | 1 |
80+
| Create book with invalid progress | PASSED | 1 |
81+
| Delete book by very large ID | PASSED | 1 |
82+
| Update book by invalid ID format | PASSED | 1 |
83+
| ... | ... | ... |
84+
+------------------------------------------+--------+-------+
85+
86+
Test suite execution summary
87+
Total suites: 122
88+
Passed suites: 122
89+
Failed suites: 0
90+
```
91+
92+
## That's it!
93+
94+
With just a few lines of YAML, you’ve added **AI-powered API test automation** into your GitHub CI pipeline. Now every PR or deployment will be automatically tested with Keploy’s smart test engine.
95+
96+
import GetSupport from '../concepts/support.md'
97+
98+
<GetSupport/>

versioned_sidebars/version-3.0.0-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"running-keploy/review-and-improve-ai-generated-tests",
2424
"running-keploy/share-tests",
2525
"running-keploy/self-healing-ai-api-tests",
26-
"running-keploy/run-ai-generated-api-tests"
26+
"running-keploy/run-ai-generated-api-tests",
27+
"running-keploy/api-testing-cicd"
2728

2829
]
2930
},

0 commit comments

Comments
 (0)