e2elisted
Install: claude install-skill madarasz/always-be-running
# E2E Test Conventions
## Setup Notes
- **Separate `tests/package.json`**: Root package.json uses Node 10/npm 6 for Gulp builds. Tests live in `tests/` with their own `package.json` (Node 20 / modern npm). Run tests from inside `tests/` with `npm test`.
- **BrowserManager import**: `import { BrowserManager } from 'agent-browser/dist/browser.js'` (no exports map in the package, so the direct path import is required)
- **System Chrome**: `executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'` — no need to install Playwright browsers separately
- **Credentials**: Copy `tests/e2e/.env.template` to `tests/e2e/.env` and fill in NetrunnerDB usernames/passwords. The `.env` file is gitignored.
## Rules — always apply these
1. **Run tests after every change**: `cd tests && npm test`. Never leave the session with failing tests.
2. **Playwright strict mode** — throws if a locator matches more than one element:
- Use `.first()` when the same text appears in navbar and body
- Use `#id` selectors when `text=` would be ambiguous
- Examples: `.locator('text=Login via NetrunnerDB').first()`, `#created-title` not `text=Tournaments created by me`
3. **Each test navigates fresh** — don't use `beforeAll` to navigate once. Each `it()` should call `page.open()` to ensure clean state and prevent test pollution.
4. **Don't expect specific data values** — test data changes. Use flexible assertions:
- `expect(count).toBeGreaterThan(0)` not `expect(count).toBe(