From 16834d007c78ec06bd82211da932607d332843be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Flor=C3=AAncio?= Date: Thu, 2 Apr 2026 00:08:55 +0100 Subject: [PATCH] fix: enforce headless mode for E2E tests in agent skills (#526) --- .agents/skills/e2e/SKILL.md | 4 ++-- .agents/skills/fix/SKILL.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.agents/skills/e2e/SKILL.md b/.agents/skills/e2e/SKILL.md index d3eda54778..1ab71a200c 100644 --- a/.agents/skills/e2e/SKILL.md +++ b/.agents/skills/e2e/SKILL.md @@ -42,10 +42,10 @@ Each worker gets an isolated backend, frontend, database, and mock agent — no ## Run commands +**Always run headless** (`make test-e2e`). Never use `--headed`, `e2e:headed`, or `test-e2e-headed` — headed mode requires a display and will fail in agent environments. + ```bash make test-e2e # all tests, headless -make test-e2e-headed # with visible browser -make test-e2e-ui # Playwright UI mode cd apps && pnpm --filter @kandev/web e2e -- tests/task/my-test.spec.ts # single file cd apps && pnpm --filter @kandev/web e2e -- --grep "task creation" # by name ``` diff --git a/.agents/skills/fix/SKILL.md b/.agents/skills/fix/SKILL.md index 3871c2577a..d7eeb9eb25 100644 --- a/.agents/skills/fix/SKILL.md +++ b/.agents/skills/fix/SKILL.md @@ -35,7 +35,7 @@ Mark task 1 as in_progress. Before anything else, reproduce the bug reliably. Pick the right method based on where the bug lives: - **Backend** (API, logic, data): write a Go test that calls the function/endpoint and asserts the wrong behavior. Run with `go test -v -run TestName ./path/...` -- **Frontend** (UI, state, interaction): write a Playwright E2E test using `/e2e` that navigates to the page and triggers the bug. Run with `make test-e2e-headed` to see it visually. +- **Frontend** (UI, state, interaction): write a Playwright E2E test using `/e2e` that navigates to the page and triggers the bug. Run with `make test-e2e` to verify. - **Full-stack** (user flow breaks end-to-end): Playwright E2E test that exercises the full path from UI through API to DB and back. - **Unclear where it lives**: start by reading the code path from the reported symptom (a page, an error message, a wrong value) back to its source. Then write the test at the appropriate level.