summaryrefslogtreecommitdiffhomepage
path: root/packages/app/e2e/AGENTS.md
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2026-03-13 12:21:50 +1000
committerGitHub <[email protected]>2026-03-13 12:21:50 +1000
commit96b1d8f639991e896bc8d31afe64d6309bf3ccd2 (patch)
treed51a398a9e13046b634a5cbe517f5ecbe72db765 /packages/app/e2e/AGENTS.md
parentdcb17c6a678918ce0786640729fcc8cd8adb1746 (diff)
downloadopencode-96b1d8f639991e896bc8d31afe64d6309bf3ccd2.tar.gz
opencode-96b1d8f639991e896bc8d31afe64d6309bf3ccd2.zip
fix(app): stabilize todo dock e2e with composer probe (#17267)
Diffstat (limited to 'packages/app/e2e/AGENTS.md')
-rw-r--r--packages/app/e2e/AGENTS.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/app/e2e/AGENTS.md b/packages/app/e2e/AGENTS.md
index cb8080fb2..4b62634f0 100644
--- a/packages/app/e2e/AGENTS.md
+++ b/packages/app/e2e/AGENTS.md
@@ -176,6 +176,25 @@ await page.keyboard.press(`${modKey}+Comma`) // Open settings
- These helpers use the fixture-enabled test-only terminal driver and wait for output after the terminal writer settles.
- Avoid `waitForTimeout` and custom DOM or `data-*` readiness checks.
+### Wait on state
+
+- Never use wall-clock waits like `page.waitForTimeout(...)` to make a test pass
+- Avoid race-prone flows that assume work is finished after an action
+- Wait or poll on observable state with `expect(...)`, `expect.poll(...)`, or existing helpers
+- Prefer locator assertions like `toBeVisible()`, `toHaveCount(0)`, and `toHaveAttribute(...)` for normal UI state, and reserve `expect.poll(...)` for probe, mock, or backend state
+
+### Add hooks
+
+- If required state is not observable from the UI, add a small test-only driver or probe in app code instead of sleeps or fragile DOM checks
+- Keep these hooks minimal and purpose-built, following the style of `packages/app/src/testing/terminal.ts`
+- Test-only hooks must be inert unless explicitly enabled; do not add normal-runtime listeners, reactive subscriptions, or per-update allocations for e2e ceremony
+- When mocking routes or APIs, expose explicit mock state and wait on that before asserting post-action UI
+
+### Prefer helpers
+
+- Prefer fluent helpers and drivers when they make intent obvious and reduce locator-heavy noise
+- Use direct locators when the interaction is simple and a helper would not add clarity
+
## Writing New Tests
1. Choose appropriate folder or create new one