Project | Web & API, CI/CD

Pattern Shop: a Shared Demo App for Test Frameworks

Sign-in, a sortable product list, product pages, cart and a two-step checkout, with a data-testid on every element a test needs, and the same catalog through REST/JSON, a SOAP-style XML API and a legacy text format, for adapter and contract tests. JDK only, no dependencies.

A small shop I control, used by four of my frameworks instead of public demo sites: each CI job starts a fresh copy from a Docker image in seconds. 32 JUnit tests and an image smoke test gate every change, and a hosted copy is online for demos.

Evidence checked 22 Nov 2026 | CI run on main

GitHub Actions workflow badge
On this page
  1. Problem and purpose
  2. Architecture
  3. Technology and tools
  4. Engineering decisions and approach
  5. Test scope and execution approach
  6. Results with dated evidence
  7. Evidence explorer
  8. Local setup and execution
  9. Workflow and reports
  10. Known limitations

Problem and purpose

Public demo sites are shared, slow, change without notice, and sometimes add bot checks. A framework that tests one of them is partly testing the internet. Pattern Shop is an application I control: same data on every run, no other users, and features added on purpose, such as an API in three formats for adapter tests.

Architecture

framework CI job ──► docker run ghcr.io/.../pattern-shop-demo-app ──► tests against localhost:8080
                     (fresh shop per job: fast, no shared data, never down)
people, demos    ──► hosted demo on Render (https://pattern-shop.onrender.com)

Technology and tools

AreaTools
ApplicationJava, JDK HTTP server only, no dependencies; compiled for Java 21, runs on Java 25 in the image; starts in under a second
TestsJUnit 6: 32 tests over real HTTP, plus a smoke test of the built image (sign-in, cart, checkout, all three APIs)
ImageMulti-stage Docker build, non-root user, health check; published to ghcr.io as :latest and :sha-<commit>
HostingRender free plan from render.yaml, deployed only after CI passes; uptime monitored

Engineering decisions and approach

  • Framework CI never depends on the hosted copy; it runs the image
  • A data-testid on every element a test needs, so frameworks need no fragile locators
  • The same catalog as JSON in cents, SOAP-style XML in dollars and legacy text, so adapter tests have real differences to translate
  • Sessions and carts per browser session, so parallel tests never share a cart
  • The image is published only after its own smoke test passed

Test scope and execution approach

Project-specific checks and execution details documented in the repository:

  • A sortable product list with pictures, a page per product, and a two-step checkout with 8 % tax
  • Users for each sign-in outcome (active, locked, wrong password, empty fields), plus a problem user who sees broken pictures and a slow user for wait tests
  • Used by four frameworks: design patterns (Selenium and Playwright), Playwright for Java, Robot Framework and Cucumber
  • A test-data API that lists the demo users, for a test-data service strategy
  • A health check that needs no extra tools in the image
  • At most 10,000 sessions on the hosted copy, then it starts over

Results with dated evidence

Historical repository or workflow evidence

CI run on main

A small shop I control, used by four of my frameworks instead of public demo sites: each CI job starts a fresh copy from a Docker image in seconds. 32 JUnit tests and an image smoke test gate every change, and a hosted copy is online for demos.

Evidence checked: | Open dated evidence

Evidence explorer

Static screenshots are labelled as images; dated workflow links identify the execution evidence and its check date.

Test report screenshot. The cart page, from a local run of the current version. Static image; capture date is not recorded in the portfolio data.
Pattern Shop cart with two products and the total

Test report screenshot. The cart page, from a local run of the current version. Static image; capture date is not recorded in the portfolio data.

Live demo: pattern-shop.onrender.com (sign in as standard_user / secret_sauce). It sleeps when idle, so the first request can take about a minute.

Static material from the public repository. The linked verification record was checked 2026-11-22; that date is not a screenshot capture date.

Dated workflow record

Evidence checked 2026-11-22. Open CI run on main

Local setup and execution

docker run -d -p 8080:8080 ghcr.io/niranjankagri/pattern-shop-demo-app:latest
:: or from source
mvnw.cmd package && java -jar target\pattern-shop.jar

Workflow and reports

View workflow definition.

Known limitations

  • Deliberately small: in-memory sessions, no database, four products
  • The hosted copy is on a free plan and sleeps when idle
  • Pages have no JavaScript on purpose (plain forms), so it cannot stand in for single-page-app behaviour
  • A deliberately small demo app: in-memory sessions, no database; the hosted copy is on a free plan and sleeps when idle.

Back to Projects