Annotation-driven Playwright testing infrastructure for Lytics and Contentstack
A comprehensive monorepo of Playwright testing tools built around annotation-driven testing - linking tests to user journeys and business requirements for better observability and traceability.
Open-source, generic infrastructure for any Playwright project:
| Package | Description | Version |
|---|---|---|
@lytics/playwright-annotations | Annotation framework with validation & ESLint | |
@lytics/playwright-reporter | Adapter-based reporter with pluggable storage | |
@lytics/playwright-adapters | Storage adapters (filesystem, Slack, Firestore) |
| Package | Description | Version |
|---|---|---|
@lytics/playwright-journey | Journey-driven test generation |
# Public packages (anyone can install)
npm install @lytics/playwright-annotations @lytics/playwright-reporter
# For Lytics/Contentstack teams (requires GitHub auth)
npm install @lytics/playwright-journeyStep 1: Create a reporter file
// reporter.tsimport{CoreReporter}from"@lytics/playwright-reporter";import{FilesystemAdapter}from"@lytics/playwright-adapters/filesystem";classCustomReporterextendsCoreReporter{constructor(){super({adapters: [newFilesystemAdapter({outputDir: './test-results'})]});}}exportdefaultCustomReporter;Step 2: Configure Playwright
// playwright.config.tsexportdefault{reporter: [['list'],['./reporter.ts']]};Step 3: Write annotated tests
// tests/my-feature.spec.tsimport{test}from"@playwright/test";import{pushSuiteAnnotation,pushTestAnnotations}from"@lytics/playwright-annotations";test.describe("My Feature @smoke",()=>{test.beforeEach(async({},testInfo)=>{pushSuiteAnnotation(testInfo,"MY-PRODUCT");});test("validates user can perform action",async({},testInfo)=>{pushTestAnnotations(testInfo,{journeyId: "MY-PRODUCT_FEATURE-CREATE",testCaseId: "MY-PRODUCT_FEATURE-CREATE_VALID",});// Your test implementation...});});Annotation-Driven Testing: Every test is annotated with metadata linking it to:
- Test Suite - Product/feature area
- Journey - User flow being validated
- Test Case - Specific scenario (valid, invalid, edge case)
Benefits:
- ✅ Traceability (test → journey → requirement)
- ✅ Observability (centralized dashboards)
- ✅ Coverage tracking (which journeys are tested?)
- ✅ Trend analysis (per journey, per suite)
annotations (base - no dependencies)
↓
reporter (depends on: annotations)
↓
adapters (depends on: reporter, annotations)
↓
journey (depends on: annotations)
- Node.js (v22 LTS or higher)
- pnpm (v8 or higher)
# Clone repo
git clone https://github.com/lytics/playwright-core.git
cd playwright-core
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test# Lint & format
pnpm lint
pnpm format# Watch mode for a specific packagecd packages/annotations
pnpm dev
# Run tests in watch mode
pnpm test:watch
# Type check
pnpm typecheckThis monorepo uses Changesets for version management. See RELEASE_PROCESS.md for details.
Quick overview:
- Make your changes
- Create a changeset:
pnpm changeset - Commit and push
- CI creates a release PR
- Merge the PR to publish
Public packages publish to npm, internal packages publish to GitHub Packages automatically.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Use Conventional Commits
- Add tests for new features
- Update documentation
- Run
pnpm lintandpnpm formatbefore committing
MIT
Built by the Lytics team for better Playwright testing at scale.
Inspired by lessons learned from: