a1d754a5fb
- Add FEATURE_SUMMARY.md with coverage overview - Fix TypeScript error in World class - Document all feature files and scenarios
5.1 KiB
5.1 KiB
Gherkin-Style E2E Tests - Feature Summary
Overview
This directory contains Gherkin-style acceptance tests for the EuchreCamp application, written in Cucumber syntax and executed via Playwright.
Coverage Summary
Feature Files (6 files, 16 scenarios)
| Feature File | Issue | Scenarios | Status |
|---|---|---|---|
| authentication.feature | - | 5 | ✅ Complete |
| password-reset.feature | #10 | 4 | ⚠️ @wip (needs UI) |
| player-schedule.feature | #9 | 3 | ⚠️ @wip (needs data) |
| tournament-schedule.feature | #7 | 4 | ⚠️ @wip (needs data) |
| user-registration.feature | - | 3 | ✅ Complete |
| wordmark-navigation.feature | #24 | 3 | ✅ Complete |
Step Definitions
- Total steps defined: 75
- Common steps: Navigation, forms, assertions
- Auth steps: Registration, login, logout, schedule navigation
- All steps verified: ✅ Dry-run passes with no undefined steps
Issues Covered
Issue #24: Wordmark Navigation ✅
Scenario: Clicking EuchreCamp wordmark navigates to appropriate page
- Unauthenticated users → Public homepage
- Players → Their profile page
- Admins → Admin dashboard
Issue #10: Password Reset ⚠️
Scenarios:
- Access password reset page
- Request reset with valid email
- Request reset with invalid email
- Submit empty email field
Status: Marked @wip because password reset UI is not yet implemented
Issue #9: Player Schedule ⚠️
Scenarios:
- View empty schedule (no matches)
- View schedule with upcoming matches
- Navigate to match details
Status: Marked @wip because data setup requires tournament creation
Issue #7: Tournament Schedule Tab ⚠️
Scenarios:
- View schedule page for tournament
- Generate round-robin schedule
- View schedule with bye rounds
- Click matchup to enter results
Status: Marked @wip because data setup requires tournament creation
Running Tests
Command Line
# Run all Cucumber tests
bun run test:acceptance:cucumber
# Run with pretty output
bun run test:acceptance:cucumber:pretty
# Run specific feature
bun cucumber-js e2e/cucumber/features/user-registration.feature
# Dry run (verify all steps defined)
bun cucumber-js --config e2e/cucumber/cucumber.config.ts --dry-run
Tags
Filter tests by tag:
# Run only @happy-path tests
bun cucumber-js --tags "@happy-path"
# Skip @wip tests
bun cucumber-js --tags "not @wip"
# Run specific issue tests
bun cucumber-js --tags "@issue-24"
Feature Examples
Wordmark Navigation (Issue #24)
Scenario: Authenticated player clicks wordmark goes to their profile
Given I am logged in as a player
When I click the "EuchreCamp" wordmark
Then I should be redirected to my profile page
And I should see "Welcome"
User Registration
Scenario: Successful registration with valid data
Given I am on the registration page
When I fill in "name" with "Test User"
And I fill in "email" with "test@example.com"
And I fill in "password" with "TestPassword123!"
And I click the "Create Account" button
Then I should be redirected to my profile page
And my user account should exist
Tournament Schedule (Issue #7)
Scenario: Tournament admin generates round-robin schedule
Given I am logged in as a tournament admin
And a tournament exists with 4 teams
When I go to the tournament schedule page
And I click the "Generate Schedule" button
Then I should see "Schedule generated successfully"
And I should see round 1 matchups
Key Principles
- Browser-only interactions - Tests interact with UI only, no database access
- Gherkin syntax - Plain English Given-When-Then format
- Happy path focus - Tests common user workflows
- Issue tracking - Each feature file linked to specific GitHub issues
- @wip markers - New/incomplete features marked for development
Next Steps
Immediate
- Run tests against dev server:
bun run test:acceptance:cucumber - Review @wip scenarios and implement missing UI
- Set up test data creation via API or fixtures
Short-term
-
Add more feature files for other issues:
- Issue #8: Tournament bracket visualization
- Issue #11: Club admin dashboard
- Issue #15: Admin view-as-user functionality
- Issue #22: Team configuration options
-
Add more step definitions for:
- Tournament creation
- Team management
- Match result entry
- Calendar view
Long-term
- Integrate with CI/CD pipeline
- Generate HTML reports
- Add visual regression testing
- Create test data factory for complex scenarios
Useful Commands
# List all feature files
ls e2e/cucumber/features/
# Count scenarios
grep -c "Scenario:" e2e/cucumber/features/*.feature
# List all step definitions
grep -r "Given\|When\|Then" e2e/cucumber/step-definitions/ | wc -l
# Check for @wip scenarios
grep -n "@wip" e2e/cucumber/features/*.feature