Fast, no external dependencies. Cover domain logic, application handlers, and worker jobs.
dotnet test tests/FlowLedger.Domain.Tests
dotnet test tests/FlowLedger.Application.Tests
dotnet test tests/FlowLedger.Worker.TestsRequire Docker (Testcontainers spins up Postgres automatically).
dotnet test tests/FlowLedger.Infrastructure.Tests
dotnet test tests/FlowLedger.Api.TestsTinyBDD + xUnit. Plain-English scenarios in .feature-style specs.
dotnet test tests/FlowLedger.Bdd.TestsEnforce layer boundaries and dependency rules using NetArchTest.
dotnet test tests/FlowLedger.Architecture.TestsTagged [Trait("Category","Perf")]. Fast enough to run in the normal suite but filterable.
Run all perf tests:
dotnet test --filter Category=PerfIncluded in the default sweep (they complete in well under a second).
Playwright browser tests that run against a live, fully composed stack. They use
headless Chromium and are gated by the E2E_BASE_URL environment variable.
Do not run locally unless you know what you are doing — Playwright in headed mode steals mouse and keyboard focus on Windows, and the full compose stack must already be running.
E2ETestBase reads E2E_BASE_URL at startup. When the variable is not set, every test
method exits immediately and is recorded as Passed (0 failures) by xUnit. No browser is
launched. This means the E2E suite is safe to include in a solution-wide test run — it
produces zero failures rather than errors when the stack is not up.
| Variable | Required | Default | Description |
|---|---|---|---|
E2E_BASE_URL |
Yes | (none) | Base URL of the Web UI that Playwright navigates. Example: http://localhost:5002. When unset, all E2E tests are skipped cleanly — no browser is launched. |
E2E_API_URL |
No | http://localhost:5001 |
Base URL of the API service. Used by AccountsDataTests and ScreenshotCaptureTests to POST /api/connect and /api/sync for data seeding before assertions. |
E2E_API_KEY |
No | dev-local-key-not-for-production |
API key sent as X-Api-Key in seeding requests. Must match Api__Key on the running API service. In CI this is ci-test-api-key-not-for-production, matching the API__KEY value passed to docker compose. |
E2E_TENANT_ID |
No | 00000000-0000-0000-0000-000000000001 |
Tenant ID sent as X-Tenant-Id in seeding requests. Must match Api__TenantId on the running API service. |
All four variables are supplied explicitly in CI so the seeding requests use the same
credentials as the compose stack. The compose stack is configured separately via
POSTGRES_PASSWORD and API__KEY (see .env.example).
The E2E workflow runs on every push and pull request to main/master:
- Checks out the repo and sets up .NET 10.
- Builds the solution in Release mode.
- Starts the full compose stack in detached mode:
The workflow provides
docker compose --profile full up --build -d
POSTGRES_PASSWORD=ci_test_passwordandAPI__KEY=ci-test-api-key-not-for-productiondirectly to the compose call. - Polls
http://localhost:5001/alive(up to 120 s) andhttp://localhost:5002/(up to 90 s) until both services are healthy. - Installs Chromium via the Playwright install script bundled with the test output.
- Runs the E2E suite:
with the following env vars set for the test runner:
dotnet test tests/FlowLedger.E2E.Tests \ --no-build --configuration Release \ --filter "Category=E2E" \ --logger "trx;LogFileName=e2e-results.trx"
E2E_BASE_URL=http://localhost:5002E2E_API_URL=http://localhost:5001E2E_API_KEY=ci-test-api-key-not-for-production(matchesAPI__KEYsupplied to compose)E2E_TENANT_ID=00000000-0000-0000-0000-000000000001(matchesApi__TenantIdin compose)
- Publishes a
.trxtest report viadorny/test-reporter. - On failure: uploads Playwright traces and screenshots, and dumps the last 100 compose log lines for debugging.
- Always tears down the stack:
docker compose --profile full down -v.
If you must run E2E tests on your workstation:
- Start the full stack:
cp .env.example .env # edit POSTGRES_PASSWORD if desired docker compose --profile full up --build -d - Wait until
http://localhost:5001/alivereturns HTTP 200. - Install Playwright browsers (one-time setup):
dotnet build tests/FlowLedger.E2E.Tests --configuration Release pwsh tests/FlowLedger.E2E.Tests/bin/Release/net10.0/playwright.ps1 install --with-deps chromium
- Run with the URL set:
E2E_BASE_URL=http://localhost:5002 dotnet test tests/FlowLedger.E2E.Tests --filter "Category=E2E"
- Tear down when done:
docker compose --profile full down -v
Run everything except browser tests:
dotnet test FlowLedger.slnx --filter "Category!=E2E" --configuration ReleaseThe standard CI pipeline (ci.yml) runs --filter "Category!=E2E" automatically.
E2E tests run in the separate e2e.yml pipeline with the full Docker Compose stack, as
described above.