writing-e2e-tests
Installation
SKILL.md
Writing E2E Tests
This skill is how we add an end-to-end test to the Opik E2E suite. You give it a feature, page, or branch; it runs a proven loop end-to-end and leaves you with a working, locally-verified Playwright test.
Announce at start: "I'm using the writing-e2e-tests skill to add an E2E test for X."
Where tests live
The suite is at tests_end_to_end/e2e/. Inside it:
- Specs:
tests/<feature>/<name>.spec.ts— one feature directory per page family (datasets,trace-explore,experiments,test-suites,online-evaluation, …). - Page Object Models:
pom/<name>.page.ts— one class per page, methods for the interactions a test needs. - Fixtures:
fixtures/<name>.fixture.ts— seed entities (project, dataset, trace, experiment, testSuite) and tear them down. Composed in a chain; re-exported fromfixtures/index.ts. - SDK clients:
core/sdk/—sdkClient.python(HTTP wrapper over the bridge) andsdkClient.typescript(directnew Opik({...})) for seeding.core/backend/holds the typed REST client for inspection + teardown. - Bridge:
services/opik-sdk-driver/— a FastAPI app (run withuv) wrapping the Python SDK, exposing routes the TS clients call. Playwright'swebServerdirective auto-spawns it during a test run; you don't start it by hand.
Specs and POMs import through path aliases: import { test, expect } from '@e2e/fixtures' and import { LogsPage } from '@e2e/pom/logs.page'.