REST API test suite built with Karate DSL and Maven against the public Makeup API: data-driven scenarios, response schema matching and negative cases, executed in parallel and on CI.
Endpoint under test: GET /api/v1/products.json with query-string filters.
| Feature | Filters | @positive scenario |
@negative scenario |
|---|---|---|---|
brand.feature |
brand |
200, schema match, first item's brand matches | wrong path returns 404 with an HTML body |
product-type.feature |
product_type |
200, schema match, product type matches | wrong path returns 404 with an HTML body |
brand-and-product-type.feature |
brand, product_type |
200, schema match, brand and product type match | wrong path returns 404 with an HTML body |
brand-product-type-and-tag.feature |
brand, product_type, product_tags |
200, schema match, product type matches | wrong or empty path returns 404 with an HTML body |
product-type-and-category.feature |
product_type, product_category |
200, schema match, product type and category match | wrong or empty path returns 404 with an HTML body |
Every scenario is a Scenario Outline with three example rows: 5 features, 30 scenarios.
- Karate DSL: HTTP calls, assertions and JSON matching written in Gherkin, no glue code.
- Schema matching: expected response shapes live in
schema_response/*.jsonusing Karate fuzzy markers (#number,#string,#array,#present) and are applied withmatch response contains. - Configuration:
karate-config.jsdefinesbaseUrland connect/read timeouts (5 s each). - Runner: a single JUnit 5 test (
runner/ApiSuiteTest) executes all features with 5 parallel threads and fails the build on any scenario failure.
Requires JDK 17 and Maven 3.x.
git clone https://github.com/criguex/karate-api-testing.git
cd karate-api-testing
mvn clean test
mvn test -Dkarate.options="--tags @positive"
mvn test -Dkarate.options="--tags @negative".
├── .github/workflows/ci.yml
├── pom.xml
└── src/test/java/
├── features/
│ ├── brand.feature
│ ├── product-type.feature
│ ├── brand-and-product-type.feature
│ ├── brand-product-type-and-tag.feature
│ └── product-type-and-category.feature
├── runner/ApiSuiteTest.java
├── schema_response/
│ ├── responseMarcaJson200.json
│ └── responseProductoJson200.json
├── karate-config.js
└── logback-test.xml
- Karate HTML report:
target/karate-reports/karate-summary.html, with a page per feature including request and response logs. - Cucumber JSON in
target/karate-reports/for downstream tooling; Surefire XML intarget/surefire-reports/. - On CI
target/karate-reports/is uploaded as a build artifact.
GitHub Actions (.github/workflows/ci.yml) runs mvn -B test with Temurin JDK 17 on every push and pull request to main. The suite depends on the public Makeup API being available.
Cristian Guerra · Senior SDET · linkedin.com/in/criguex