This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Install dependencies
pnpm install
# Add a dependency to a specific package
cd packages/[package-name]
pnpm add [dependency-name]# Build all packages
pnpm build
# Build a specific package
cd packages/[package-name]
pnpm build
# Build in watch mode (for development)
pnpm dev
# Build a specific package in watch mode
cd packages/[package-name]
pnpm dev# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests for a specific package
cd packages/[package-name]
pnpm test
# Run tests in watch mode for a specific package
cd packages/[package-name]
pnpm test:watch# Lint all packages
pnpm lint
# Format all packages
pnpm format
# Type check all packages
pnpm typecheck
# Lint a specific package
cd packages/[package-name]
pnpm lint
# Format a specific package
cd packages/[package-name]
pnpm format
# Type check a specific package
cd packages/[package-name]
pnpm typecheck# Create a changeset (for versioning)
pnpm changeset
# Version packages based on changesets
pnpm version
# Publish packages
pnpm releaseThis is a TypeScript monorepo for Playwright testing infrastructure based on annotations. It uses pnpm workspaces, Turborepo for build orchestration, and Changesets for versioning.
The packages follow this dependency hierarchy:
annotations (base - no dependencies)
↓
reporter (depends on: annotations)
↓
adapters (depends on: reporter, annotations)
↓
journey (depends on: annotations)
-
@lytics/playwright-annotations: Base package that provides a framework for annotating Playwright tests with metadata.
- Defines annotation schema and types
- Provides validation rules
- Contains helper functions for working with annotations
- Includes ESLint integration
-
@lytics/playwright-reporter: Reporter framework that processes test results with annotations.
- Builds on top of annotations package
- Provides a pluggable architecture for different storage backends via adapters
- Collects and processes test results
-
@lytics/playwright-adapters: Storage adapters for the reporter.
- Filesystem adapter for storing results locally
- Slack adapter for notifications
- Firestore adapter for Google Cloud Firestore
- Implements common interfaces for storage backends
-
@lytics/playwright-journey: Journey-driven test generation.
- Higher-level abstractions for journey-based testing
- Connects tests to user journeys and business requirements
- Turborepo: Used for task orchestration and caching across packages
- TypeScript: All packages are written in TypeScript with strict typing
- Biome: Used for linting and formatting
- Vitest: Used for unit testing
- Changesets: Used for versioning and changelogs
- Uses strict TypeScript with explicit typing
- Single quotes for strings
- 2-space indentation
- Line width of 100 characters
- Follows a modular design pattern with clear separation of concerns
- Uses Conventional Commits for commit messages
This codebase implements an annotation-driven testing approach:
- Test Suite: Organizational grouping for product or feature area
- Journey: User flow being validated
- Test Case: Specific scenario (valid, invalid, edge case)
Tests are annotated with metadata using the provided helpers:
// Set suite annotation in test.describe block
pushSuiteAnnotation(testInfo, "MY-PRODUCT");
// Set test annotations in test block
pushTestAnnotations(testInfo, {
journeyId: "MY-PRODUCT_FEATURE-CREATE",
testCaseId: "MY-PRODUCT_FEATURE-CREATE_VALID",
});The reporter processes these annotations and sends them to configured adapters for storage and analysis.