βI went from writing manual test scripts line-by-line to achieving 100% API test coverage in minutes β thanks to Keploy!β
π Who Am I?
Hi, Iβm Nishant Kumar Chaubey, a B.Tech student at KIIT with a deep interest in web development and blockchain. As a developer, Iβve spent countless hours writing and debugging tests manually for APIs β and honestly, it hasnβt always been fun.
Thatβs why discovering Keploy, an AI-based API testing platform, was a game-changer.
π§² Why API Testing Matters
When building full-stack applications β like my recent Pet Adoption Center project β one thing thatβs essential but often overlooked is robust testing. Writing unit, integration, and API tests ensures:
- APIs behave as expected
- Bugs are caught early
- Refactors donβt break things silently
But writing all of those tests manually is time-consuming and repetitive.
π‘ Enter Keploy β AI-Powered API Testing
Keploy made me rethink testing. Instead of writing boilerplate code for each endpoint, Keploy automatically generated test cases based on:
- Live API traffic (from curl or browser)
- OpenAPI schema
- Chrome Extension traffic capture
π§© Task 1: AI API Testing + GitHub Actions Integration
As part of the API Fellowship, my first challenge was to:
- β Create an OpenAPI schema
- β Capture curl traffic from real API usage
- β Generate tests using Keploy Cloud
- β Integrate those tests into GitHub Actions for CI/CD
π οΈ My Stack
- Backend: Node.js + Express.js
- Frontend: React.js
- Database: MongoDB Atlas
- Testing: Jest, Supertest, and now... Keploy AI
π§² How I Used Keploy for API Testing
- Generated OpenAPI schema for my backend
- Used Keploy CLI to run:
keploy record --command "npm start"
- Performed real curl/API requests
- Keploy recorded the requests/responses and auto-created test cases
- I then ran:
keploy test --config config.yaml
- Result: It generated 20 suites, with 0 boilerplate written by me, and tested CRUD operations!
π€ GitHub Actions Integration
I added the Keploy test suite into my GitHub workflow:
- name: Install Keploy CLI
run: |
curl --silent -L https://keploy.io/ent/install.sh | bash
- name: Run Keploy Test Suite
run: |
export KEPLOY_API_KEY=your_key && keploy test-suite --app=your_app_id --base-path http://localhost:5000/api --cloud
Now, on every push, tests are triggered and verified via the Keploy Cloud Dashboard. π
π Task 2: Chrome Extension API Test Recording
Next, I tried Keploy's Chrome Extension β and it blew my mind how simple it was.
βοΈ Steps I Followed:
- Cloned the Keploy Chrome Extension Repo
- Loaded it into Chrome via
chrome://extensions
- Visited two real-world websites to test their live API interactions:
- ποΈ Flipkart β Browsed mobile phones, filtered by price and brand, opened product pages.
- π¦ Amazon β Searched for books, explored product categories, checked product details.
- Clicked Start Recording on the Keploy Chrome Extension β interacted with the websites.
- Clicked Stop Recording once done β hit Generate Tests to let Keploy convert those captured API calls into ready-to-use test cases.
Keploy redirected me to the dashboard and generated tests based on the captured traffic β again, without writing a single line of test code.
βοΈ Manual vs Keploy AI β A Quick Comparison
Aspect | Manual Testing | Keploy AI Testing |
---|---|---|
Time to write test cases | 2β3 hours (for 15 endpoints) | Under 10 minutes |
Maintenance | Prone to human error | Regenerates tests from traffic |
Coverage | Partial (usually) | 100% coverage from recorded interactions |
Setup Complexity | Medium | Low (just run with curl or browser) |
Integration in CI/CD | Manual with Jest/Supertest | Seamless via GitHub Actions + CLI |
π Final Thoughts
Using Keploy was like unlocking a cheat code in development. As someone whoβs manually written hundreds of lines of test cases β I truly appreciate how:
- Fast π¨
- Accurate β
- Intelligent π€ Keploy is.
Whether through its CLI + GitHub CI pipeline or Chrome extension, I was able to move from 0 to 100% API test coverage in just a few minutes.
π Whatβs Next?
- Iβm planning to use Keploy in future backend projects β especially for microservices.
- Iβll be exploring test assertions customization and mocking responses too.
- And most importantly, Iβll recommend this to any developer building APIs.
π Try It Yourself!
- Keploy Website: https://keploy.io
- Chrome Extension: https://github.com/keploy/extension
- My GitHub Repo: [https://github.com/NishantChaubey534/pet-adoption-center]
π§βπ» About Me
Nishant Kumar Chaubey
B.Tech CSE | KIIT
π» Web Dev | π§± Blockchain | π§² API Enthusiast
Thanks for reading! Feel free to reach out or comment if you're exploring Keploy too π
Top comments (0)