Testing

DBO Studio covers product behavior with Playwright. There is no separate unit-test suite for user-visible features in the API or UI packages.

Each npm test run boots an ephemeral API and Vite UI on random ports, with a temporary app database. Your daily DBO data is never touched.

text
npm test
  ├─ API on a random port, temp SQLite file
  ├─ Vite UI proxying to that API
  ├─ Playwright
  └─ teardown

Prerequisites

RequirementSetup
GoUsed to boot the ephemeral API
Frontend dependenciescd frontend && npm install
Sample enginesdocker compose -f docker-compose.dev.yml up -d sample-pgsql sample-mysql
TLS sampleadd sample-pgsql-ssl if you run SSL specs
Chromiumcd e2e && npx playwright install chromium
bash
cd e2e
npm install

Copy e2e/.env.example to e2e/.env if you need to point at non-default sample ports. Variable names are listed under Configuration.

Running tests

Always go through npm test (or npm run test:pg, test:mysql, test:sqlite). Bare npx playwright test fails because the harness has not set PLAYWRIGHT_API_URL.

bash
cd e2e

npm test
npm run test:pg
npm run test:mysql
npm run test:sqlite
npm run test:ui
npm test -- tests/shared/connections.spec.ts

Warning: Playwright must run on the real machine. It launches Chromium, binds ports, and talks to Docker on 127.0.0.1. Restricted sandboxes will fail.

Default workers is 1. Override with PLAYWRIGHT_WORKERS. Traces, screenshots, and video are kept on failure.

What a spec should look like

  • One user-visible flow per file
  • test.step() around each meaningful action
  • Role or test-id locators, web-first expect
  • Unique names for anything that creates a connection, and cleanup that always runs

Troubleshooting

SymptomLikely cause
PLAYWRIGHT_API_URL is not setRan Playwright directly — use npm test
Connection refused to Postgres or MySQLSample containers are down, or ports in .env do not match Compose
Stale editor or overlay errorsLeftover workspace tabs from a previous run

Previous

Building

Next

Configuration