From 29c57d0bea7a901adca685661349a955f9e56bbc Mon Sep 17 00:00:00 2001 From: Niranjan Kumar <45349200+niranjankagri@users.noreply.github.com> Date: Sun, 22 Nov 2026 14:46:22 +0530 Subject: [PATCH 1/2] Pattern Shop now serves four frameworks Robot Framework, Playwright for Java (and Cucumber) moved from saucedemo.com to my own Pattern Shop on 22 Nov, so their pages no longer name Sauce Demo; their limits now name only the public demo APIs. Pattern Shop: 32 tests, product pages, sorting, two-step checkout, problem and slow users, used by four frameworks (evidence: CI run 45005697097). Design patterns: 39 tests, 13 UI (evidence: CI run 45004125413). Co-Authored-By: Claude Opus 5.5 --- projects.html | 14 +++++------ projects/design-patterns-test-framework.html | 4 +-- projects/enterprise.html | 2 +- projects/jenkins-kubernetes.html | 2 +- projects/pact-contract.html | 2 +- projects/pattern-shop-demo-app.html | 12 ++++----- projects/playwright-java.html | 4 +-- projects/robot-framework.html | 4 +-- tools/make_pages.py | 26 +++++++++++--------- tools/project_data.py | 23 ++++++++--------- 10 files changed, 48 insertions(+), 45 deletions(-) diff --git a/projects.html b/projects.html index e80fa7c..f78a780 100644 --- a/projects.html +++ b/projects.html @@ -321,30 +321,30 @@

Gatling Perfo

Evidence checked 15 Nov 2026 | Scheduled CI run on main

-
+
CI run on main: the unit and API job and seven UI jobs on Selenium and Playwright, all passed

Project | Web & API

Design Patterns in a Selenium and Playwright Framework

Five design patterns doing real work in one Java framework: Page Object, Factory (browser and engine), Strategy (JSON, CSV or API test data)…

-

The same 11 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

Historical repository or workflow evidence

+

The same 13 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

Historical repository or workflow evidence

Case study Source
-

Evidence checked 20 Nov 2026 | CI run on main

+

Evidence checked 22 Nov 2026 | CI run on main

-
+
Pattern Shop product list: four products with prices and add-to-cart buttons

Project | Web & API, CI/CD

Pattern Shop: a Shared Demo App for Test Frameworks

-

Sign-in, products, cart and checkout pages with a data-testid on every element a test needs, and the same catalog through REST/JSON, a…

-

A small shop I control, so my frameworks never depend on a public demo site: each CI job starts a fresh copy from a Docker image in seconds. 19 JUnit tests and an image smoke test gate every change, and a hosted copy is online for demos.

Historical repository or workflow evidence

+

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…

+

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.

Historical repository or workflow evidence

Case study Source
-

Evidence checked 20 Nov 2026 | CI run on main

+

Evidence checked 22 Nov 2026 | CI run on main

diff --git a/projects/design-patterns-test-framework.html b/projects/design-patterns-test-framework.html index 203710b..2d4b7aa 100644 --- a/projects/design-patterns-test-framework.html +++ b/projects/design-patterns-test-framework.html @@ -17,13 +17,13 @@

Project | Web & API

Design Patterns in a Selenium and Playwright Framework

Five design patterns doing real work in one Java framework: Page Object, Factory (browser and engine), Strategy (JSON, CSV or API test data), Adapter (two browser engines, three catalog APIs) and Observer (reports, logs, metrics and screenshots from test events).

-

The same 11 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

Evidence checked 20 Nov 2026 | CI run on main

GitHub Actions workflow badge
+

The same 13 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

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

Pattern names are easy to list and hard to show. Here each pattern solves a problem the framework really has: two browser engines behind one interface, test data that can come from three sources, three catalog APIs that disagree on names and prices, and reporting that must not be called from the tests. Running one set of tests on two engines also turns environment problems into visible differences instead of flaky tests.

Architecture

run config ──► BrowserFactory ──► Browser (Selenium or Playwright adapter)     Factory, Adapter
                                     ▲
 test ──► LoginPage / ProductsPage ──┘  (no locators or waits in the test)     Page Object
   └── users, products ◄── TestDataSource (json | csv | api)                     Strategy
-TestNG ──► TestNgEventBridge ──► TestEventBus ──► report, log, metrics, screenshots   Observer

Technology and tools

AreaTools
TestsJava 21, TestNG 7.12, AssertJ: 37 tests (26 unit and API, 11 UI)
EnginesSelenium 4.53 (Chrome, Firefox, Edge, Selenium Grid) and Playwright 1.65 for Java (Chromium, Firefox, WebKit)
ApplicationPattern Shop: pages, REST, SOAP-style XML and a legacy text API
CIGitHub Actions: a core job and 7 UI jobs, each with its own shop container; weekly and on demand

Engineering decisions and approach

  • Page objects hold no assertions; each action returns the page it leads to
  • One Browser interface: tests and page objects never import Selenium or Playwright
  • The Factory validates the configuration first, so an engine and browser that do not fit stop the run before a browser starts
  • Test data source chosen by one property (json, csv or api); the tests do not change
  • Listeners found through ServiceLoader: adding a report is a new class, not a change to the tests

Test scope and execution approach

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

  • Adapters for three catalog APIs: JSON in cents, SOAP-style XML in dollars, legacy upper-case text with error strings
  • Observer output on every run: a Markdown report (also in the CI job summary), metrics.json, a log line per test, a screenshot per failed UI test
  • Selenium Grid in Docker as one of the browser setups
  • Data-provider sign-in tests for each user state: active, locked, and a second active user
  • A personal guide with the reasons and the alternatives that were not chosen

Results with dated evidence

Historical repository or workflow evidence

CI run on main

The same 11 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

Evidence checked: | Open dated evidence

Evidence explorer

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

CI workflow screenshot. CI run on main, 20 Nov 2026: one core job and seven UI jobs on two engines, all passed. Static image; capture date is not recorded in the portfolio data.
CI run on main: the unit and API job and seven UI jobs passed

CI workflow screenshot. CI run on main, 20 Nov 2026: one core job and seven UI jobs on two engines, all passed. Static image; capture date is not recorded in the portfolio data.

The first Selenium Chrome run failed every test that clicked twice after signing in, while Playwright's Chromium passed. Chrome's password manager had recognised the demo password from a data breach and opened a dialog that swallowed the next click. The fix went into the Factory, and a unit test keeps it there.

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

Dated workflow record

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

Local setup and execution

docker run -d -p 8080:8080 ghcr.io/niranjankagri/pattern-shop-demo-app:latest
+TestNG ──► TestNgEventBridge ──► TestEventBus ──► report, log, metrics, screenshots   Observer

Technology and tools

AreaTools
TestsJava 21, TestNG 7.12, AssertJ: 39 tests (26 unit and API, 13 UI)
EnginesSelenium 4.53 (Chrome, Firefox, Edge, Selenium Grid) and Playwright 1.65 for Java (Chromium, Firefox, WebKit)
ApplicationPattern Shop: pages, REST, SOAP-style XML and a legacy text API
CIGitHub Actions: a core job and 7 UI jobs, each with its own shop container; weekly and on demand

Engineering decisions and approach

  • Page objects hold no assertions; each action returns the page it leads to
  • One Browser interface: tests and page objects never import Selenium or Playwright
  • The Factory validates the configuration first, so an engine and browser that do not fit stop the run before a browser starts
  • Test data source chosen by one property (json, csv or api); the tests do not change
  • Listeners found through ServiceLoader: adding a report is a new class, not a change to the tests

Test scope and execution approach

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

  • Adapters for three catalog APIs: JSON in cents, SOAP-style XML in dollars, legacy upper-case text with error strings
  • Observer output on every run: a Markdown report (also in the CI job summary), metrics.json, a log line per test, a screenshot per failed UI test
  • Selenium Grid in Docker as one of the browser setups
  • Data-provider sign-in tests for every demo user: active, locked, a problem user and a slow user
  • A personal guide with the reasons and the alternatives that were not chosen

Results with dated evidence

Historical repository or workflow evidence

CI run on main

The same 13 UI tests run on Selenium WebDriver and on Playwright for Java, on 7 browser setups, through one Browser interface. Running both engines exposed a Chrome password-leak dialog that swallowed clicks on Selenium only; the fix lives in the Factory and a test keeps it there.

Evidence checked: | Open dated evidence

Evidence explorer

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

CI workflow screenshot. CI run on main, 20 Nov 2026: one core job and seven UI jobs on two engines, all passed. Static image; capture date is not recorded in the portfolio data.
CI run on main: the unit and API job and seven UI jobs passed

CI workflow screenshot. CI run on main, 20 Nov 2026: one core job and seven UI jobs on two engines, all passed. Static image; capture date is not recorded in the portfolio data.

The first Selenium Chrome run failed every test that clicked twice after signing in, while Playwright's Chromium passed. Chrome's password manager had recognised the demo password from a data breach and opened a dialog that swallowed the next click. The fix went into the Factory, and a unit test keeps it there.

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
 mvnw.cmd verify -Dsuite=core
 mvnw.cmd verify -Dsuite=ui -Dengine=playwright -Dbrowser=webkit -Ddata.source=csv

Workflow and reports

View workflow definition.

Known limitations

  • The application under test is a small demo shop; the patterns are shown at framework scale
  • Edge's first start on a fresh CI runner takes 30 to 45 seconds, so CI starts it once before the tests
  • Five patterns, not all of them: no Builder, Decorator or Singleton, by choice
  • The application under test is my own small demo shop; the patterns are shown at framework scale, not on a large product.

Back to Projects

diff --git a/projects/enterprise.html b/projects/enterprise.html index b743356..2fc2306 100644 --- a/projects/enterprise.html +++ b/projects/enterprise.html @@ -41,7 +41,7 @@

Layers depend downwards only: tests contain no Selenium, HTTP or SQL. The repository documents the architecture in docs/architecture.md and 21 architecture decision records in docs/adr.

Explore the architecture

Select a component to see its purpose, technology, inputs, outputs and implementation path.

Business-level assertions are grouped by API, UI, database, integration, end-to-end and platform behavior.

Technology
Java 17, TestNG
Inputs
Test data and the configured application environment.
Outputs
Assertions, named Allure steps and test results.
View sourceautomation/src/test/java/com/enterprise/automation/tests

Architecture components

Test suites

Business-level assertions are grouped by API, UI, database, integration, end-to-end and platform behavior.

Technology
Java 17, TestNG
Inputs
Test data and the configured application environment.
Outputs
Assertions, named Allure steps and test results.
View sourceautomation/src/test/java/com/enterprise/automation/tests
Pages, services and queries

Keep selectors, API resources and SQL out of test methods.

Technology
Java page objects, API services and JDBC query classes.
Inputs
Actions and data requests from the test layer.
Outputs
UI actions, HTTP responses and database rows.
View sourceautomation/src/main/java/com/enterprise/automation
Driver and configuration

Provide the configured local or remote browser and environment-specific settings.

Technology
Selenium WebDriver, immutable configuration and Selenium Grid.
Inputs
Browser, environment, execution mode and parallelism settings.
Outputs
A browser session per test thread and resolved configuration.
View sourceautomation/src/main/java/com/enterprise/automation/driver
Application under test

Expose the same shop records through the user interface, REST API and database.

Technology
The ShopEase demo application and H2 database.
Inputs
Browser requests, API calls and test data.
Outputs
UI state, API responses and persisted demo records.
View sourcedemo-app/src/main/java/com/enterprise/demoapp
Execution evidence

Attach failure diagnostics and per-test context to the run report.

Technology
TestNG listeners, Logback and Allure.
Inputs
Test steps, responses, rows, screenshots, logs and run metadata.
Outputs
Dated test reports and failure diagnostics.
View sourceautomation/src/main/java/com/enterprise/automation/reporting

Technology and tools

AreaTools
Language / buildJava 17, Maven (multi-module)
Test runnerTestNG 7.12
UISelenium 4 (local and Selenium Grid)
APIREST Assured 6, Jackson, JSON Schema validation
DatabaseJDBC (H2), parameterised queries
Assertions / dataAssertJ, Datafaker, JSON and CSV files
Logging / reportingSLF4J + Logback per thread and test; Allure 3
ContainersDocker, docker compose, Selenium Grid (hub + Chrome, Firefox, Edge nodes)
CI/CDGitHub Actions, Dependabot, dependency review, Checkstyle

Layers and responsibilities

LayerResponsibilityExamples
TestsWhat is checked, in business terms; no Selenium, HTTP or SQLtests/api, tests/ui, tests/db, tests/integration, tests/e2e
Pages, API services, DB queriesOne class per screen, API resource or query area; the only place that knows locators, endpoints and SQLpage objects, service objects, query classes
Components and clientsReusable UI components, the REST client, the query executor, waits on real stateApiClient, QueryExecutor, components
Driver and configurationBrowser per thread (local or Grid), layered configuration, secrets from the environmentDriverFactory, configuration loader
Execution and evidenceRetry policy for infrastructure failures, logging, Allure steps and attachmentslisteners, SecretMasker, Allure

Configuration and execution

Settings are layered: defaults, an environment (-Denv=qa), then system properties, so the same tests run on a laptop, in Docker, against Grid or in CI without edits. Examples: -Dbrowser=firefox, -Dthreads=4, -Dsuite=smoke, -Dexecution=remote -Dgrid.url=....

Parallel execution: one browser per thread, unique data per test, per-thread clean-up and logs; the full suite took about 242 s serial, 171 s with 2 threads and 148 s with 4 (clean clone).

Retries: only transient infrastructure failures (browser start-up, lost sessions, refused connections) are retried, for test methods and for browser start-up; assertion failures and wait timeouts never are, and every retry is visible in the report.

Reporting: Allure shows every UI action, API call (request and response attached) and SQL query as a step; failed UI tests get screenshot, URL, page source and browser console; failures are categorised (configuration, infrastructure, timeout, authentication, database, UI, API, assertion); logs mask secrets.

Engineering decisions and approach

  • Test at the cheapest level (API) and check consistency across UI, API and database
  • Every test owns its data: independent, parallel-safe, no order dependencies, no shared fixtures, no sleeps
  • Retry only transient infrastructure failures (browser start-up, lost sessions, refused connections); assertion failures and wait timeouts never
  • Every failure explains itself: steps, request/response, rows, screenshot, log, environment and build in the report
  • Same tests everywhere: laptop, Docker, Grid and CI are configured, never edited
  • Cloud device farms deferred on purpose; Grid covers remote browsers

Problem, decision and result

Problem

Verify the same demo-shop business flows across UI, API and database layers.

Decision

Separate business assertions from browser, HTTP and SQL access; isolate test data and retain failure evidence.

Observed result

19 Nov 2026 nightly execution results: Chrome 246/246 passed; Firefox, Edge and Selenium Grid each 182/182 passed; 0 failures, errors or skips.

Evidence checked 2026-11-19 | Nightly regression #103 on main

Scope: Repository demo application; these results do not establish production customer impact.

Test scope and execution approach

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

  • Earlier inventory (12 Oct 2026): 169 TestNG test executions from 124 test methods (data-driven tests run once per data row), all passing in that scheduled nightly run; by package, without overlap: API 57, UI 48, database 13, integration 9, end-to-end 2, framework unit tests 40. Evidence: nightly run 38226623404
  • Named suites (TestNG groups, which overlap): smoke 20, sanity 11, regression 121
  • Parallel execution: one browser per thread; full suite about 242 s serial, 171 s with 2 threads, 148 s with 4 (clean clone)
  • Allure report with every UI action, API call and SQL query as a step, failure categories and an environment panel
  • Secrets masked in every log line, report attachment and failure message
  • Docker compose: application, Selenium hub, Chrome/Firefox/Edge nodes and the test runner

Results with dated evidence

Historical workflow run · verified 20 Nov 2026

Nightly regression #103 on main

19 Nov 2026 nightly execution results: Chrome 246/246 passed; Firefox, Edge and Selenium Grid each 182/182 passed; 0 failures, errors or skips.

Evidence checked: | Open dated evidence

Evidence explorer

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

The interactive architecture map above lists components and their source paths. Open the repository architecture guide.

Test report screenshot. Allure overview of a smoke run with one deliberately failing demo check. Static image; capture date is not recorded in the portfolio data.
Allure overview of a smoke run

Test report screenshot. Allure overview of a smoke run with one deliberately failing demo check. Static image; capture date is not recorded in the portfolio data.

Test report screenshot. The Docker Selenium Grid used by the nightly run. Static image; capture date is not recorded in the portfolio data.
Selenium Grid console with Chrome, Firefox and Edge nodes

Test report screenshot. The Docker Selenium Grid used by the nightly run. Static image; capture date is not recorded in the portfolio data.

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

Test report screenshot. A static report example; it demonstrates how an individual failure is represented, not the latest nightly outcome. Static image; capture date is not recorded in the portfolio data.
Allure report showing a deliberately failing demo check

Test report screenshot. A static report example; it demonstrates how an individual failure is represented, not the latest nightly outcome. Static image; capture date is not recorded in the portfolio data.

Dated workflow record

Evidence checked 2026-11-19. Open Nightly regression #103 on main

Local setup and execution

mvn clean test                                   # full suite, local app, Chrome
 mvn clean test -Dsuite=smoke -Dheadless=true     # one suite
 mvn clean test -Dbrowser=firefox -Dthreads=4     # another browser, 4 threads
-docker compose -f docker/docker-compose.yml up --build --abort-on-container-exit --exit-code-from tests

Requirements: JDK 17+, Maven 3.9+, Chrome or Edge; Node.js for the Allure CLI. Full instructions in the README.

Workflow and reports

View workflow definition.

Known limitations

  • Cloud device farms are not integrated (deliberate, see the decision records)
  • The demo application uses an in-memory H2 database and demo-grade security; it is not a production deployment.
  • Allure steps are at user-action level; no business-level step names yet

Back to Projects

+docker compose -f docker/docker-compose.yml up --build --abort-on-container-exit --exit-code-from tests

Requirements: JDK 17+, Maven 3.9+, Chrome or Edge; Node.js for the Allure CLI. Full instructions in the README.

Workflow and reports

View workflow definition.

Known limitations

  • Cloud device farms are not integrated (deliberate, see the decision records)
  • The demo application uses an in-memory H2 database and demo-grade security; it is not a production deployment.
  • Allure steps are at user-action level; no business-level step names yet

Back to Projects