Building APIs is fun β but testing them? That used to feel like a chore.
As part of the Keploy GitHub Learning Program, I recently built a full-stack Habit Tracker API using Flask and MongoDB β but the real shift came when I got to test it using AI.
π The Project: Habit Tracker API
The idea was simple β track personal habits for different users with full CRUD operations. I built:
A custom REST API in Flask
A MongoDB backend
A basic HTML + JavaScript frontend for testing
5 core endpoints: Add, Get, Update, and Delete habits
Sounds complete, right? Almost. But what about testing?
π« The Problem: Manual API Testing
Initially, I tried writing unit tests manually β and it worked, but:
It was time-consuming
I struggled to cover all use cases
Every time I changed my API, I had to update my tests again
Thatβs when Keploy entered the scene.
π€ The Game Changer: Keploy's AI Testing
With Keploy CLI, I was able to:
β
Automatically record API calls
β
Replay them as test cases
β
Achieve real test coverage without manually scripting each test
I used curl commands and the frontend UI to simulate real use, while Keploy silently captured everything β and then turned those interactions into executable test cases.
Literally zero code for test writing!
π οΈ CI/CD Integration with GitHub Actions
Testing alone isnβt enough β it needs to be automated.
So I went ahead and:
Created an OpenAPI schema (using Flasgger)
Integrated Keploy test execution in GitHub Actions
Ensured my pipeline runs tests on every push and pull request
This step made my API production-ready in the truest sense.
π Chrome Extension Bonus
To take it one step further, I used Keployβs Chrome Extension to test APIs on real-world websites.
It felt amazing to inspect network traffic and capture meaningful test data without dev tools or Postman.
π‘ What I Learned
Testing doesnβt have to be painful.
AI + DevTools = game-changing productivity
CI/CD is not complete without reliable test automation
Real coverage > theoretical coverage
π§© Tech Stack Used
Backend: Flask (Python), MongoDB
Frontend: HTML + JS
Testing: Keploy CLI, Keploy Chrome Extension
CI/CD: GitHub Actions
π See it in action:
π GitHub Repo Link β Habit Tracker API
Big shoutout to @keploy for building such a developer-friendly tool and helping students like me explore test automation with real-world projects.
Want to test APIs like a pro?
Try Keploy β you might just fall in love with testing π
Top comments (0)