Skip to content

feat: add TypeScript Cucumber Playwright BDD example#24

Open
sirockin wants to merge 3 commits into
mainfrom
feature/ts-cucumber-playwright-example
Open

feat: add TypeScript Cucumber Playwright BDD example#24
sirockin wants to merge 3 commits into
mainfrom
feature/ts-cucumber-playwright-example

Conversation

@sirockin
Copy link
Copy Markdown
Owner

Summary

This PR implements issue #23 by adding a comprehensive TypeScript Cucumber Playwright BDD example that demonstrates the same patterns as the existing Go examples.

✅ Requirements Fulfilled

  • New example ts-cucumber-playwright-bdd following contributing guidelines
  • Auto-generated API client from OpenAPI spec using openapi-generator-cli
  • Uses playwright-bdd library (v7.x) for BDD test execution
  • Command-line and Playwright UI execution supported via Makefile and native Playwright runner

🏗️ Architecture

Implements the same four-layer model as existing examples:

  1. Executable Specification: Identical Gherkin feature files copied from Go examples
  2. Domain Specific Language: TypeScript step definitions using playwright-bdd
  3. Protocol Drivers: Three TypeScript drivers (Domain, HTTP, UI)
  4. System Under Test: Same React frontend and Go backend

🧪 Test Results

Domain tests are passing (4/4 scenarios):

  • ✅ Sign up - Successful sign-up
  • ✅ Sign up - Try to sign in without activating account
  • ✅ Create project - Create one project
  • ✅ Create project - Try to see someone else's project

📁 Key Files Added

  • acceptance/ts-cucumber-playwright-bdd/ - Complete TypeScript BDD implementation
  • Protocol drivers in src/drivers/ (domain, HTTP, UI)
  • Step definitions in src/steps/domain-steps.ts
  • Multiple Playwright configurations for different test environments
  • Comprehensive TESTING.md documentation
  • Makefile with targets matching Go examples
  • Updated root README.md to include new TypeScript example

🎯 Test Plan

  • Domain tests pass (verified)
  • Generated TypeScript client compiles
  • Makefile targets work correctly
  • Documentation is comprehensive
  • Follows existing code patterns and conventions
  • Uses identical Gherkin feature files for consistency

🤖 Generated with Claude Code

sirockin and others added 3 commits September 25, 2025 17:20
- Implement ts-cucumber-playwright-bdd following contributing guidelines
- Use playwright-bdd library for BDD test execution
- Auto-generate TypeScript client from OpenAPI specification
- Implement three protocol drivers: Domain, HTTP, and UI
- Copy identical Gherkin feature files for consistency
- Add comprehensive Makefile with same targets as Go examples
- Support both command-line and Playwright UI test execution
- Include detailed documentation in TESTING.md
- Update main README.md with new TypeScript example
- All domain tests passing (4/4 scenarios)

Closes #23

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove domain-driver.ts and related files that reimplemented business logic
- Remove playwright-domain.config.ts and domain test configurations
- Update HTTP driver to test actual Go backend via API
- Update Makefile and package.json to remove domain targets
- Update documentation to reflect HTTP/UI focus on real system testing
- HTTP tests now verify integration with actual backend (2/4 passing)

This approach is more architecturally sound as it tests the real system
instead of duplicating business logic in TypeScript.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant