frontend-testing-strategy
Frontend testing strategy
Write tests for Grafana frontend code that pass review on the first pass. Goals:
assert concrete behavior, not existence; keep test descriptions honest; verify the test
actually exercises the target code path; and stabilize the known flake classes. Several codeowner
paths are opted into the gating check-frontend-test-coverage.yml check, so coverage that drops
fails CI.
Running Playwright E2E tests
Use yarn e2e:playwright <spec> with GRAFANA_URL unset by default. The harness starts
its own lightweight Grafana server on port 3001; this is more efficient than starting a
separate development instance. Do not start make run or another Grafana server just to
run E2E tests.
Only set GRAFANA_URL to use a custom server when the task specifically needs one, such as
debugging a particular running instance or testing a deployment. State that reason before
using the override. Setting GRAFANA_URL disables the harness-managed server, so the target
instance must already be running and accessible.