Expressive DSL

Write readable integration tests using a Scala DSL inspired by Gherkin.

JSON First

Powerful JSON assertions with path expressions, matchers, and ignoring keys.

Detailed Error Reports

Failures show JSON diffs, step execution traces, and replay commands.

Property Based Testing

Generate and explore random test scenarios with built-in PBT support.

Quick Example

import com.github.agourlay.cornichon.CornichonFeature

class SuperHeroesFeature extends CornichonFeature {

  def feature = Feature("Superheroes API") {

    Scenario("retrieve a superhero") {

      When I get("/superheroes/Batman")

      Then assert status.is(200)

      Then assert body.is("""
      {
        "name": "Batman",
        "realName": "Bruce Wayne",
        "city": "Gotham city",
        "publisher": {
          "name": "DC",
          "foundationYear": 1934
        }
      }
      """)

      Then assert body.path("publisher.name").is("DC")

      Then assert body.path("publisher.foundationYear").isGreaterThan(1900)
    }
  }
}