Skip to content

karatelabs/karate-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karate-todo

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.

IDE plugins

Prerequisites

Using GitHub Codespaces or a VS Code devcontainer? Java and Maven are pre-installed — skip to Verify.

Get the code

git clone https://github.com/karatelabs/karate-todo.git
cd karate-todo

Verify

./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.

Run the app

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.

What's in the box

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.

Performance test

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).

Gradle

See Install & Get Started for the Gradle setup.

About

Self-contained demo of all Karate core capabilities

Resources

Stars

Watchers

Forks

Contributors