901fd659df
- Add NextGraph data layer with @ng-org/orm, SHEX shapes (Event, UserProfile, Participation), session management, and FestipodDataContext with dual-mode operation (connected via NextGraph or local seed data) - Add BrokerBanner and NgStatus components showing connection status - Refactor to feature-based architecture: organize code by business domain (event, user, home, auth, workshop, meeting, notification) instead of technical layer. Modules only import from shared/, never from each other - Collocate BDD features and step definitions with their modules: event-specific steps in event/steps/, user steps in user/steps/, shared generic steps remain in shared/steps/ - Set up multi-layer BDD structure (frontend/backend/e2e steps per module) - Add project documentation (AGENTS.md, .project/knowledge/) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.2 KiB
3.2 KiB
BDD Testing
Cucumber/Gherkin BDD specs in French with multi-layer step definitions.
Overview
- 26 feature files (US-1 to US-26), all in French
- Categories: EVENT, WORKSHOP, USER, MEETING, NOTIF
- Priorities: 0 (Impossible), 1 (Haute), 2 (Moyenne), 3 (Basse)
- Current results: 51 passed, 7 failed, 75 skipped (133 scenarios total)
Multi-Layer BDD
Each module has step directories for three test layers:
src/modules/event/steps/
frontend/ # UI/screen assertions (active)
backend/ # Data layer assertions (planned)
e2e/ # Full integration (planned)
Shared steps (cross-domain) live in src/shared/steps/frontend/.
Feature Files
Collocated with their module:
src/modules/event/features/us-13-creer-evenement.feature
src/modules/user/features/us-23-connexion-utilisateurs.feature
src/modules/workshop/features/us-1-visualiser-atelier-termine.feature
...
Tagged with @CATEGORY @priority-N for filtering.
Step Definitions
Shared Steps (src/shared/steps/frontend/)
| File | Purpose |
|---|---|
navigation.steps.ts |
Screen navigation, authentication, click/select actions, section/button/field assertions |
form.steps.ts |
Form field validation, required fields, import/duplicate detection |
screen.steps.ts |
Screen content assertions (participants, events, profiles, QR codes) |
How Frontend Steps Work
Steps analyze screen source code (not rendered DOM):
world.tsloads screen.tsxfile content vialoadScreenSource()- Steps use regex patterns on JSX source to verify UI elements
screenFileMapinworld.tsmaps screen IDs to file paths (e.g.,'home'→'src/modules/home/screens/HomeScreen.tsx')screenFieldDetectorsdefine per-screen regex patterns for field verificationscreenExpectedContentlists expected text content per screen
Screen Name Resolution
French names in .feature files map to screen IDs via screenNameMap:
"accueil"→home"détail événement"→event-detail"mon profil"→profile"relayer un événement"→create-event
Cucumber Configuration
cucumber.json:
{
"default": {
"import": [
"src/shared/support/**/*.ts",
"src/shared/steps/**/*.ts",
"src/modules/*/steps/**/*.ts"
],
"paths": ["src/modules/*/features/**/*.feature"],
"language": "fr"
}
}
Requires tsx loader: node --import tsx/esm node_modules/.bin/cucumber-js
Auto-Generated Files
Scripts in scripts/ parse features and steps into TypeScript data files consumed by the prototyping tool:
| Script | Input | Output |
|---|---|---|
parse-features.ts |
src/modules/*/features/*.feature |
src/shared/data/features.ts |
parse-test-results.ts |
reports/cucumber-report.json |
src/shared/data/testResults.ts |
extract-step-definitions.ts |
src/shared/steps/frontend/*.ts |
src/shared/data/stepDefinitions.ts |
Run all: bun run test:cucumber
Adding New Steps
- Module-specific: Create in
src/modules/{module}/steps/frontend/ - Cross-domain: Add to
src/shared/steps/frontend/ - Import
FestipodWorldtype from../../support/world(shared) or adjust relative path - Run
bun run steps:extractto regenerate tooltip data