Existing coverage was one integration test and zero e2e tests. Adds the thin, high-value integration/e2e layer unit tests can't reach (real Postgres wire contract, real browser flows) and wires it as a post-deploy smoke gate. - Seed a deterministic dev/QA admin user and fixed Development env key so HTTP-only tests can authenticate without per-run registration. - Expand the API integration suite: disabled-flag, unauthorized access, environment-document bootstrap, identity-override precedence, and auth login scenarios, reusing the existing black-box HTTP+Npgsql harness. - Add a Playwright suite for the admin SPA: login, nav, project/environment context selection, and feature create/toggle, against the real API. - Bind QA Postgres to 127.0.0.1 for direct seeding, add smoke-qa.sh and an ensure_node() bootstrap (the qa runner has no Node today), and wire a new smoke-qa CI job after deploy-qa.
MicCheck.Api.Tests.Integration
Black-box integration tests. Targets a running MicCheck.Api instance by URL and seeds/cleans data directly in the Postgres database.
Running against an environment
Two settings are required: BaseUrl and DbConnectionString.
Via .runsettings (recommended for local + CI)
dotnet test --settings local.runsettings
Copy local.runsettings to e.g. staging.runsettings and override the values for other environments.
Via command-line
dotnet test -- TestRunParameters.Parameter\(name=\"BaseUrl\",value=\"https://staging.example.com\"\) ^
TestRunParameters.Parameter\(name=\"DbConnectionString\",value=\"Host=...\"\)
Via environment variables (overrides .runsettings)
MICCHECK_API_BASE_URL=...
MICCHECK_DB_CONNECTION_STRING=...
MICCHECK_ACCEPT_ANY_SERVER_CERTIFICATE=true|false
Patterns
- Tests seed their own data directly in the database, never through the API.
- Per-test data is seeded in
[SetUp]. Reusable cross-test data goes in[OneTimeSetUp]. - Cleanup runs in
[TearDown]/[OneTimeTearDown], also directly in the database. - HTTP requests are defined in
HttpFiles/*.httpand executed viaFlagApiHttpClient. - Assertion failure messages include a fresh snapshot of the relevant rows in the database.