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.
npm test
├─ API on a random port, temp SQLite file
├─ Vite UI proxying to that API
├─ Playwright
└─ teardown
Prerequisites
| Requirement | Setup |
|---|---|
| Go | Used to boot the ephemeral API |
| Frontend dependencies | cd frontend && npm install |
| Sample engines | docker compose -f docker-compose.dev.yml up -d sample-pgsql sample-mysql |
| TLS sample | add sample-pgsql-ssl if you run SSL specs |
| Chromium | cd e2e && npx playwright install chromium |
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.
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
| Symptom | Likely cause |
|---|---|
PLAYWRIGHT_API_URL is not set | Ran Playwright directly — use npm test |
| Connection refused to Postgres or MySQL | Sample containers are down, or ports in .env do not match Compose |
| Stale editor or overlay errors | Leftover workspace tabs from a previous run |
Related
- Getting started — local stack and sample databases
- Configuration — e2e and Compose port variables