Test by Design

Dashboard and test suites

Three repositories with no shared code, meeting at two points. The dashboard is a demo and starts nothing real; once a day each suite — API or UI — runs in CI and reports to it the same way. One run, end to end.

No password: press “Log in to demo” for a sandbox of your own.

User browser Machine API key Dashboard, repo 1 Test suite, repo 2 or 3 Front end React Backend Worker · the only writer File storage R2 · private Database D1 · run rows CI pipeline GitHub Actions · daily Test suite API or UI · one per run Test report Allure · one file picks + Run POST /runs session status, polled POST /runs no browser, same rules no dispatch a visitor’s run is simulated queued row out, result back POST /webhook HMAC signed runs main builds PUT scoped storage token report, read back

Scroll sideways to see the whole diagram.

  1. Ask for a run. A visitor picks a suite and presses Run, and the front end sends POST /runs with their session. A machine holding an API key sends the same call straight to the backend, and meets the same rules.
  2. Simulate it. The backend writes the run into the visitor’s own sandbox and plays it out itself. It dispatches nothing: the dashboard is a demo.
  3. Run the suite, for real. Once a day each suite’s CI pipeline runs all of it on main, on its own schedule, and builds one report.
  4. Send it back. The suite uploads the report into the dashboard’s private storage with a scoped token, then posts a signed result to the backend, which records it as a real run every visitor sees and none can change.
  5. Read it. The front end polls the backend for status, and the report is read back through the backend, never from storage directly.
Steps 1 and 2 are what a visitor does in the demo; steps 3 and 4 are each suite’s real daily run. Blue marks a crossing that has to prove who it is. Only the backend writes run rows, the suite writes only its own report, and reports are served through the backend — the storage is never public.
Repo 1 playwright-run-dashboard the dashboard and the Worker
Repo 2 playwright-api-automation-patterns the API suite, reporting daily
Repo 3 playwright-ui-automation-patterns the UI suite, same two points

Inside a suite run

What “the test suite runs” means: one command, a pool of workers, and tests that do not depend on each other.

Schedule on-demand.yml One suite package, repo 2 or 3 playwright test --workers=N <slice> Worker pool, N processes worker 1 own process fixtures set up · per worker test · test · test own context each own data each worker 2 own process fixtures set up · per worker test · test · test own context each own data each worker N own process fixtures set up · per worker test · test · test own context each own data each allure-results → one report every worker writes into the same run One shared target API suite → bundled mock 127.0.0.1:4010/api/v1 the runner boots it, then tears it down UI suite → the real site www.saucedemo.com nobody here controls it one target, N workers — which is where the ceiling comes from

Scroll sideways to see the whole diagram.

Of the two targets, the mock belongs to the suite — the runner boots it and tears it down — while the real site, drawn dashed, is nobody’s to control from here. The API suite signs in once per worker; the UI suite signs in for every test, because its cart lives in the browser. Everything a test changes is its own.

What makes the tests independent

API suite: each test makes its own data

One mock serves every worker and is never reset. Each test creates uniquely named data and checks only what it created.

UI suite: each test signs in fresh

The cart lives in the browser, so a shared session would carry one test’s cart into the next.

What parallelism buys

The API suite on a ten-core machine, as its Playwright config records it:

WorkersWall clockNote
52.9sthe setting — 50% of ten cores
103.5sslower
164.1sslower still

More workers made it slower. One mock serves every worker and becomes the bottleneck, so past half the cores the extra workers only queue. That is why the setting is 50%, written as a fraction so a bigger runner is still used.

Before a suite is called stable, it runs at 12 workers, five times over, with nothing flaky.

The same suite, built twice

Each repository builds the same tests two ways, with identical settings, so the two styles can be compared fairly.

API

functional-style and class-style, the same tests in each.

UI

locator-first and page-first — the same journeys, held level by a check.

Test by Design

© 2026 Surakiart Yasaka