.agents/commands/comet/add-e2e-test.md
Add a working, locally-verified Playwright end-to-end test for an Opik feature in tests_end_to_end/e2e/. The command runs the full loop — analyze the feature and frontend code, explore the live UI, write the Page Object Model + spec, and run it locally until it passes.
localhost:5173/default/projects/<id>/experiments).The default target is local OSS (http://localhost:5173). The Python SDK behind the bridge reads ~/.opik.config; if it points at a cloud environment, seeding would create real data there.
cat ~/.opik.config
If url_override is anything other than http://localhost:5173/api, back it up and point it local, then restore it when done:
cp ~/.opik.config ~/.opik.config.bak 2>/dev/null || true
cat > ~/.opik.config << 'EOF'
[opik]
url_override = http://localhost:5173/api
workspace = default
EOF
Restore afterward: cp ~/.opik.config.bak ~/.opik.config. If it already points local, skip this.
Invoke the writing-e2e-tests skill and follow it exactly. It carries the full procedure — scope, analyze the feature + frontend code, explore the live UI with the Playwright MCP (delegating selector discovery to playwright-pom-discovery), write the POM + spec, and run until green — plus the suite's conventions.
pom/*.page.ts) and spec (tests/<feature>/<name>.spec.ts) added under tests_end_to_end/e2e/.test.step() wrapping in the spec and POM methods.data-testid added to the frontend component in the same change.