A self-contained demo project for Karate v2. Includes a sample app (UI + API) and runnable examples of API tests, API mocks, UI automation, and performance tests.
Great for training, demos, or as a sandbox to learn Karate. No prior programming experience needed.
- Java 21+ with
JAVA_HOMEset — required by Karate v2 - Git (or download as ZIP and rename
karate-todo-main→karate-todo)
Using GitHub Codespaces or a VS Code devcontainer? Java and Maven are pre-installed — skip to Verify.
git clone https://github.com/karatelabs/karate-todo.git
cd karate-todo
./mvnw clean test
(Windows: mvnw clean test.) If ApiTest passes, you're good. All commands below assume the wrapper — drop the ./ and use plain mvn if you have Maven installed.
mvn test -Dtest=LocalRunner
Open http://localhost:8080 — a working TODO app backed by the same API the tests hit.
Stop with Ctrl+C or from your IDE.
| Type | Entry point | Docs |
|---|---|---|
| API test | api/simple.feature |
Making Requests |
| UI test | ui/simple.feature |
UI Testing |
| API mock | mock/test.feature (runs against mock.feature) |
Test Doubles |
| Performance | perf/TodoSimulation.java |
Performance Testing |
The same simple.feature runs against both the real API and the mock — a nice demonstration of Karate's contract-first testing.
Gatling hits the app over HTTP, so start it first. Two terminals:
# terminal 1 — app
mvn test -Dtest=LocalRunner
# terminal 2 — simulation
mvn test -P gatling
The HTML report is written to target/gatling/todosimulation-*/index.html.
Uses the Java DSL for Gatling (no Scala required).
See Install & Get Started for the Gradle setup.