Skip to content

kensa-dev/clearwave-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clearwave Kensa Example

A showcase project demonstrating Kensa — BDD testing for Kotlin & Java.

The domain is a fictional telecoms provider ("Clearwave") with two services and a small UI under test:

  • FeasibilityService — checks whether a broadband service can be delivered to a given address

  • OrderService — places a broadband order and coordinates with external network and tracking systems

  • Feasibility checker UI — a Vite + React + shadcn page that submits the feasibility form to the live FeasibilityService, exercised end-to-end through both Playwright and Selenium

  • System View — auto-generated component diagram showing the relationships across all services exercised in tests. Available as a top-level page in the report sidebar.

Tests are written using the Kensa Given-When-Then DSL with http4k stubs standing in for downstream APIs. The HTML report generated from these tests is published as a live example at:

kensa-dev.github.io/clearwave-example

Running locally

The project has two test cycles.

Service-level tests (canary build)

./gradlew test

Runs the http4k-driven FeasibilityServiceTest and OrderServiceTest. No browser needed. The report is written to build/kensa-output.

UI tests

./gradlew installPlaywrightBrowsers   # one-off — installs Chromium for Playwright
./gradlew uiTest                      # builds the UI and runs Playwright + Selenium tests

UI tests need Chrome installed (Selenium uses it via Selenium Manager). The Vite UI is built automatically before the tests run. The report is written to build/kensa-output-ui.

To open either report:

kensa --dir build/kensa-output
kensa --dir build/kensa-output-ui

Purpose

This project serves two roles:

  1. Showcase — a realistic example of Kensa tests that visitors to kensa.dev can explore. The tests and domain are updated alongside the documentation.

  2. Canary — run as part of Kensa's CI on every commit to master, building against the latest snapshot to catch regressions early. (UI tests are excluded from the canary because they need browsers.)

Dependencies

Library Role
Kensa BDD test framework
Kensa Playwright / Kensa Selenium UI testing drivers
http4k HTTP client & stub server
Vite + React + shadcn/ui Feasibility UI
Kotest Assertions
JUnit 5 Test runner

Releases

No releases published

Packages

 
 
 

Contributors