@torus-engineering/tas-kit 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/.claude/commands/tas-adr.md +33 -29
  2. package/.claude/commands/tas-apitest-plan.md +173 -0
  3. package/.claude/commands/tas-apitest.md +143 -0
  4. package/.claude/commands/tas-bug.md +113 -109
  5. package/.claude/commands/tas-design.md +37 -33
  6. package/.claude/commands/tas-dev.md +128 -115
  7. package/.claude/commands/tas-e2e-mobile.md +155 -0
  8. package/.claude/commands/tas-e2e-web.md +163 -0
  9. package/.claude/commands/tas-e2e.md +102 -0
  10. package/.claude/commands/tas-epic.md +35 -31
  11. package/.claude/commands/tas-feature.md +47 -43
  12. package/.claude/commands/tas-fix.md +51 -47
  13. package/.claude/commands/tas-functest-mobile.md +144 -0
  14. package/.claude/commands/tas-functest-web.md +192 -0
  15. package/.claude/commands/tas-functest.md +76 -0
  16. package/.claude/commands/tas-plan.md +200 -184
  17. package/.claude/commands/tas-prd.md +37 -33
  18. package/.claude/commands/tas-review.md +111 -104
  19. package/.claude/commands/tas-sad.md +43 -39
  20. package/.claude/commands/tas-security.md +81 -80
  21. package/.claude/commands/tas-story.md +91 -87
  22. package/.claude/commands/tas-verify.md +51 -41
  23. package/.claude/rules/common/post-review-agent.md +49 -39
  24. package/.claude/rules/common/testing.md +24 -0
  25. package/.claude/rules/common/token-logging.md +27 -0
  26. package/.claude/rules/csharp/api-testing.md +171 -0
  27. package/.claude/rules/csharp/patterns.md +10 -0
  28. package/.claude/rules/python/patterns.md +10 -0
  29. package/.claude/rules/typescript/patterns.md +10 -0
  30. package/.claude/rules/web/performance.md +9 -0
  31. package/.claude/skills/api-design/SKILL.md +3 -1
  32. package/.claude/skills/{backend-patterns → js-backend-patterns}/SKILL.md +2 -1
  33. package/.claude/skills/tas-implementation-complete/SKILL.md +99 -97
  34. package/.claude/skills/tas-tdd/SKILL.md +123 -82
  35. package/.claude/skills/token-logger/SKILL.md +19 -0
  36. package/.tas/templates/API-Test-Spec.md +400 -0
  37. package/.tas/templates/E2E-Execution-Report.md +198 -0
  38. package/.tas/templates/E2E-Mobile-Spec.md +130 -0
  39. package/.tas/templates/E2E-Report.md +174 -0
  40. package/.tas/templates/E2E-Scenario.md +180 -0
  41. package/.tas/templates/E2E-Web-Spec.md +164 -0
  42. package/.tas/templates/Feature.md +55 -55
  43. package/.tas/templates/Func-Test-Script.md +254 -0
  44. package/.tas/templates/Func-Test-Spec.md +187 -0
  45. package/.tas/templates/SAD.md +274 -274
  46. package/.tas/templates/Story.md +90 -88
  47. package/bin/cli.js +56 -56
  48. package/lib/deleted-files.json +36 -0
  49. package/lib/install.js +213 -176
  50. package/package.json +34 -34
  51. package/.claude/agents/README.md +0 -83
  52. package/.claude/agents/ado-agent.md +0 -39
  53. package/.claude/agents/code-architect.md +0 -62
  54. package/.claude/agents/code-simplifier.md +0 -53
  55. package/.claude/agents/comment-analyzer.md +0 -59
  56. package/.claude/agents/conversation-analyzer.md +0 -57
  57. package/.claude/agents/docs-lookup.md +0 -55
  58. package/.claude/agents/harness-optimizer.md +0 -62
  59. package/.claude/agents/loop-operator.md +0 -56
  60. package/.claude/agents/performance-optimizer.md +0 -78
  61. package/.claude/agents/pr-test-analyzer.md +0 -68
  62. package/.claude/agents/pytorch-build-resolver.md +0 -76
  63. package/.claude/agents/refactor-cleaner.md +0 -70
  64. package/.claude/agents/seo-specialist.md +0 -75
  65. package/.claude/agents/silent-failure-hunter.md +0 -69
  66. package/.claude/agents/type-design-analyzer.md +0 -75
  67. package/.claude/rules/common/agents.md +0 -65
  68. package/.claude/rules/common/coding-style.md +0 -90
  69. package/.claude/rules/common/development-workflow.md +0 -44
  70. package/.claude/rules/common/git-workflow.md +0 -24
  71. package/.claude/rules/common/performance.md +0 -55
  72. package/.claude/skills/agent-harness-construction/SKILL.md +0 -77
  73. package/.claude/skills/agent-introspection-debugging/SKILL.md +0 -157
@@ -0,0 +1,130 @@
1
+ ---
2
+ created_date:
3
+ executor:
4
+ status: Draft
5
+ story_id:
6
+ feature_id:
7
+ epic_id:
8
+ ---
9
+
10
+ # E2E Mobile Test Specification
11
+
12
+ **Epic**: [EPIC_LINK]
13
+ **Feature**: [FEATURE_LINK]
14
+ **Story**: [STORY_LINK]
15
+ **Author**: @[executor]
16
+ **Created**: [created_date]
17
+ **Status**: [status]
18
+
19
+ ---
20
+
21
+ ## 📋 Test Objective
22
+ > Brief description of what this e2e test suite validates
23
+
24
+ **Scope**: Mobile only (Detox)
25
+ **Target Audience**: [Clinical / Organic / Both]
26
+
27
+ ---
28
+
29
+ ## 🧪 Test Cases
30
+
31
+ Use table format for QA verification:
32
+
33
+ | ID | Test Type | Test Scenario | Preconditions | Test Data | Test Steps | Expected Result | Priority |
34
+ |---|---|---|---|---|---|---|---|
35
+ | TC_[FEATURE]_001 | Functional | [Scenario Title] | - Precondition 1<br>- Precondition 2 | Key data values | 1. Action 1<br>2. Action 2<br>3. Action 3 | - Expected result 1<br>- Expected result 2 | P0 |
36
+ | TC_[FEATURE]_002 | Validation | [Validation Scenario] | - Precondition | Test data | 1. Action<br>2. Submit | - Validation error<br>- Stay on screen | P0 |
37
+ | TC_[FEATURE]_003 | Error Handling | [Error Scenario] | - Error condition | N/A | 1. Trigger error<br>2. Observe handling | - Error message shown<br>- Recovery option provided | P1 |
38
+
39
+ **Format Notes**:
40
+ - **ID**: TC_[FEATURE]_###
41
+ - **Test Type**: Functional / Validation / Navigation / Error Handling / Edge Case
42
+ - **Test Scenario**: Brief description (use gerund/action verb)
43
+ - **Preconditions**: Use bullet list with <br> for line breaks
44
+ - **Test Data**: Concrete values or N/A
45
+ - **Test Steps**: Numbered list with <br> separators
46
+ - **Expected Result**: Bullet list with <br> separators
47
+ - **Priority**: P0 (Critical) / P1 (Important) / P2 (Nice-to-have)
48
+
49
+ ---
50
+
51
+ ## 🎯 Test Coverage
52
+
53
+ | Feature/Screen | Functional | Validation | Error Handling | Edge Cases | Total |
54
+ |---|---|---|---|---|---|
55
+ | [Feature 1] | 2 | 2 | 1 | 1 | 6 |
56
+ | [Feature 2] | 3 | 3 | 2 | 0 | 8 |
57
+ | **TOTAL** | **#** | **#** | **#** | **#** | **##** |
58
+
59
+ ---
60
+
61
+ ## 🔄 Test Environment & Prerequisites
62
+
63
+ **Device Setup**:
64
+ - [ ] iOS Simulator / Physical Device
65
+ - [ ] Android Emulator / Physical Device
66
+ - [ ] Min OS versions: iOS 14+, Android 9+
67
+
68
+ **Test Data**:
69
+ - [ ] Mock data fixtures prepared
70
+ - [ ] User accounts ready
71
+ - [ ] External service stubs configured
72
+
73
+ **Tools**:
74
+ - Detox (v[version])
75
+ - Node/Yarn
76
+ - [Other tools]
77
+
78
+ ---
79
+
80
+ ## ⚠️ Edge Cases & Error Scenarios
81
+
82
+ | Scenario | Expected Behavior |
83
+ |---|---|
84
+ | Network failure during test | Graceful error handling |
85
+ | [Other edge case] | [Expected behavior] |
86
+
87
+ ---
88
+
89
+ ## 📊 Success Criteria
90
+
91
+ - [ ] All test cases pass on iOS
92
+ - [ ] All test cases pass on Android
93
+ - [ ] Test execution time < [X] seconds
94
+ - [ ] Zero flaky tests (100% pass rate on 3 consecutive runs)
95
+ - [ ] Code coverage meets [X]%
96
+
97
+ ---
98
+
99
+ ## Implementation Notes
100
+
101
+ > Any special setup, mocking, or gotchas for implementing these tests
102
+
103
+ ---
104
+
105
+ ## ✅ QA Verification Checklist
106
+
107
+ - [ ] TC_[FEATURE]_001: [Test scenario] verified on iOS
108
+ - [ ] TC_[FEATURE]_001: [Test scenario] verified on Android
109
+ - [ ] TC_[FEATURE]_002: [Test scenario] verified
110
+ - [ ] All preconditions met before testing
111
+ - [ ] All test data available and valid
112
+ - [ ] All navigation flows working
113
+ - [ ] All error messages displaying
114
+ - [ ] No crashes or unhandled exceptions
115
+ - [ ] Performance acceptable (< X seconds)
116
+ - [ ] Device orientation changes handled
117
+ - [ ] Network conditions tested (if applicable)
118
+
119
+ **QA Sign-off**:
120
+ - [ ] QA Tester: [Name] - Date: ____
121
+ - [ ] QA Lead: [Name] - Date: ____
122
+ - [ ] Ready for Production: [ ] Yes [ ] No
123
+
124
+ ---
125
+
126
+ ## Review & Approval
127
+
128
+ - [ ] QA: [Name/ADO_ID]
129
+ - [ ] Tech Lead: [Name/ADO_ID]
130
+ - [ ] Product: [Name/ADO_ID]
@@ -0,0 +1,174 @@
1
+ ---
2
+ created_date:
3
+ executed_date:
4
+ executor:
5
+ status: Draft
6
+ story_id:
7
+ feature_id:
8
+ environment: Local
9
+ ---
10
+
11
+ # E2E Test Execution Report
12
+
13
+ **Feature**: [FEATURE_NAME]
14
+ **Test Suite**: [e2e-mobile-test-suite]
15
+ **Created**: [created_date]
16
+ **Executed**: [executed_date]
17
+ **Duration**: [X min Y sec]
18
+ **Executor**: @[executor]
19
+ **Environment**: [environment]
20
+ **Status**: [status]
21
+
22
+ ---
23
+
24
+ ## 📊 Summary
25
+
26
+ | Metric | Value |
27
+ |---|---|
28
+ | **Total Tests** | [N] |
29
+ | **Passed** ✅ | [N] |
30
+ | **Failed** ❌ | [N] |
31
+ | **Skipped** ⊘ | [N] |
32
+ | **Flaky** ⚠️ | [N] |
33
+ | **Pass Rate** | [X]% |
34
+ | **Execution Time** | [X min Y sec] |
35
+
36
+ ---
37
+
38
+ ## 🎯 Results by Platform
39
+
40
+ ### iOS
41
+ - **Status**: ✅ PASS / ❌ FAIL
42
+ - **Tests Run**: [N]
43
+ - **Pass Rate**: [X]%
44
+ - **Device**: [Simulator / Physical - model]
45
+ - **OS Version**: iOS [version]
46
+
47
+ ### Android
48
+ - **Status**: ✅ PASS / ❌ FAIL
49
+ - **Tests Run**: [N]
50
+ - **Pass Rate**: [X]%
51
+ - **Device**: [Emulator / Physical - model]
52
+ - **OS Version**: Android [version]
53
+
54
+ ---
55
+
56
+ ## ✅ Passed Tests
57
+
58
+ ```
59
+ ✓ TC-1: [Test Case Name]
60
+ ✓ TC-2: [Test Case Name]
61
+ ✓ TC-3: [Test Case Name]
62
+ ```
63
+
64
+ ---
65
+
66
+ ## ❌ Failed Tests
67
+
68
+ ### Failed: TC-X [Test Case Name]
69
+
70
+ **Platform**: iOS / Android
71
+ **Error Message**:
72
+ ```
73
+ [Actual error output]
74
+ ```
75
+
76
+ **Root Cause**:
77
+ - [Analysis of why it failed]
78
+
79
+ **Reproduction Steps**:
80
+ 1. [Step 1]
81
+ 2. [Step 2]
82
+
83
+ **Action Items**:
84
+ - [ ] Fix issue [JIRA/ADO link]
85
+ - [ ] Update test data
86
+ - [ ] Investigate environment issue
87
+
88
+ ---
89
+
90
+ ## ⚠️ Flaky Tests (Pass/Fail Intermittently)
91
+
92
+ | Test Case | Flake Rate | Notes |
93
+ |---|---|---|
94
+ | [TC Name] | [X%] | Possible timing issue with [component] |
95
+
96
+ ---
97
+
98
+ ## 🔍 Detailed Logs & Artifacts
99
+
100
+ **Video Recordings**:
101
+ - [iOS recording link / artifact path]
102
+ - [Android recording link / artifact path]
103
+
104
+ **Screenshots**:
105
+ - [Failed state screenshots]
106
+
107
+ **Debug Logs**:
108
+ - [Log file path or link]
109
+
110
+ **Performance Metrics**:
111
+ - Average screen load time: [X] ms
112
+ - Average gesture response time: [X] ms
113
+ - Memory usage: [X] MB
114
+ - Frame rate (FPS): [X]
115
+
116
+ ---
117
+
118
+ ## 🎓 Test Coverage Analysis
119
+
120
+ | Screen/Flow | Coverage | Pass/Fail |
121
+ |---|---|---|
122
+ | Authentication Flow | Happy + Error cases | ✅ PASS |
123
+ | [Feature Screen] | [Coverage details] | ✅/❌ |
124
+
125
+ ---
126
+
127
+ ## 🚀 Blockers & Issues
128
+
129
+ | Issue | Severity | Impact | Owner | ETA |
130
+ |---|---|---|---|---|
131
+ | [Issue description] | Critical / High / Medium | Blocks deployment | @[person] | [date] |
132
+
133
+ ---
134
+
135
+ ## ✅ Recommendations
136
+
137
+ 1. **Immediate Actions** (before merge):
138
+ - [ ] [Action item]
139
+
140
+ 2. **Follow-up Actions** (post-deployment):
141
+ - [ ] [Action item]
142
+ - [ ] Investigate flaky tests in TC-X
143
+
144
+ 3. **Test Maintenance**:
145
+ - [ ] Update fixtures for API v2
146
+ - [ ] Add test cases for new scenarios
147
+
148
+ ---
149
+
150
+ ## 📝 Sign-off
151
+
152
+ - [ ] QA Approved: [Name] — [Date/Time]
153
+ - [ ] Tech Lead Review: [Name] — [Date/Time]
154
+ - [ ] Ready for Deployment: Yes / No
155
+
156
+ **Comments**:
157
+ > Any additional notes from reviewers
158
+
159
+ ---
160
+
161
+ ## 📎 Appendix: Environment Details
162
+
163
+ **Detox Version**: [version]
164
+ **Node Version**: [version]
165
+ **Yarn Version**: [version]
166
+ **React Native**: [version]
167
+ **Device Info**: [Simulator/Emulator specs]
168
+ **Network**: [Mock / Real / Hybrid]
169
+ **Time Zone**: [TZ]
170
+
171
+ ---
172
+
173
+ **Report Generated By**: Claude e2e Mobile Agent
174
+ **Next Test Run Scheduled**: [Date/Time if recurring]
@@ -0,0 +1,180 @@
1
+ ---
2
+ created_date:
3
+ updated_date:
4
+ executor:
5
+ status: Draft
6
+ epic_id: # Single epic ID, or "XEPIC" for cross-epic
7
+ scenario_type: # single-epic | cross-epic
8
+ platform: # mobile | web | both
9
+ ---
10
+
11
+ # E2E Scenario: {Scenario Name}
12
+
13
+ **Epic(s)**: [{Epic_ID}]({link}) {{#if cross-epic}} + [{Epic_ID_2}]({link2}) {{/if}}
14
+ **Scenario Type**: {{scenario_type}} (single-epic | cross-epic)
15
+ **Platform**: {{platform}}
16
+ **Author**: @[executor]
17
+ **Created**: [created_date]
18
+ **Status**: [status] (Draft | Ready | Implemented | Verified)
19
+
20
+ ---
21
+
22
+ ## Scenario Naming Convention
23
+
24
+ ### Single-Epic E2E
25
+ ```
26
+ {PROJECT}_E{EPIC}_E2E_{NUMBER}_{MODIFIER}
27
+ ```
28
+ Example: `AL_E002_E2E_001_H` - Full auth flow happy path
29
+
30
+ ### Cross-Epic E2E
31
+ ```
32
+ {PROJECT}_XEPIC_E2E_{NUMBER}_{MODIFIER}
33
+ ```
34
+ Example: `AL_XEPIC_E2E_001_H` - Registration through first scan journey
35
+
36
+ ---
37
+
38
+ ## Flow Overview
39
+
40
+ > Narrative description of the end-to-end user journey.
41
+ > This scenario tests {what} by simulating {user type} performing {complete flow}.
42
+
43
+ **User Persona**: {Clinical / Organic / New User / Returning User}
44
+ **Starting Point**: {Screen/Page where flow begins}
45
+ **End Point**: {Screen/Page where flow ends}
46
+ **Estimated Duration**: {X minutes}
47
+
48
+ ---
49
+
50
+ ## Scenario Steps
51
+
52
+ | Step | Screen/Page | Action | Expected Result | Builds on FT IDs | Priority |
53
+ |------|-------------|--------|-----------------|-------------------|----------|
54
+ | 1 | {Start Screen} | {User action} | {Expected outcome} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H | P0 |
55
+ | 2 | {Next Screen} | {User action} | {Expected outcome} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_002_H | P0 |
56
+ | 3 | {Next Screen} | {User action} | {Expected outcome} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_003_H | P0 |
57
+ | 4 | {Next Screen} | {User action} | {Expected outcome} | - (new step, no FT reference) | P1 |
58
+ | 5 | {End Screen} | {Verify final state} | {Final expected state} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_005_H | P0 |
59
+
60
+ ### Step Details
61
+
62
+ #### Step 1: {Action Title}
63
+ - **Screen**: {Screen name}
64
+ - **Preconditions**: {What must be true before this step}
65
+ - **Action**: {Detailed user action}
66
+ - **Expected Result**: {What should happen}
67
+ - **FT Reference**: Reuses logic from `{FT_ID}` in `features/{epic}/{feature}/helpers.ts`
68
+ - **Timeout**: {Expected max time for this step}
69
+
70
+ #### Step 2: {Action Title}
71
+ - **Screen**: {Screen name}
72
+ - **Preconditions**: Step 1 completed successfully
73
+ - **Action**: {Detailed user action}
74
+ - **Expected Result**: {What should happen}
75
+ - **FT Reference**: Reuses logic from `{FT_ID}`
76
+
77
+ _(Continue for each step)_
78
+
79
+ ---
80
+
81
+ ## Alternate Flows
82
+
83
+ ### Alternate Flow 1: {Description}
84
+ > What happens when {condition} differs from the main flow
85
+
86
+ | Step | Diverges At | Action | Expected Result |
87
+ |------|-------------|--------|-----------------|
88
+ | 1a | Step {N} | {Alternative action} | {Different outcome} |
89
+ | 1b | Step {N+1} | {Continue} | {Rejoins main flow or ends} |
90
+
91
+ ### Error Flow 1: {Description}
92
+ > What happens when {error condition}
93
+
94
+ | Step | Diverges At | Error Condition | Expected Recovery |
95
+ |------|-------------|-----------------|-------------------|
96
+ | E1 | Step {N} | {Error trigger} | {Error message + recovery} |
97
+
98
+ ---
99
+
100
+ ## Test Data (per Environment)
101
+
102
+ | Data Item | Dev | Staging | Prod (Smoke) | Notes |
103
+ |-----------|-----|---------|--------------|-------|
104
+ | User Email | {dev-email} | {stag-email} | {prod-email} | From test-data.{env}.json |
105
+ | User Password | (from .env) | (from .env) | (from .env) | NEVER hardcode |
106
+ | {Entity} ID | {dev-id} | {stag-id} | {prod-id} | Pre-seeded data |
107
+ | Base URL | {dev-url} | {stag-url} | {prod-url} | From test-data.{env}.json |
108
+
109
+ ### Data Files
110
+ - `apps/{platform}/e2e/data/test-data.dev.json`
111
+ - `apps/{platform}/e2e/data/test-data.staging.json`
112
+ - `apps/{platform}/e2e/data/test-data.prod.json`
113
+
114
+ ---
115
+
116
+ ## Prerequisites
117
+
118
+ - [ ] User account exists in target environment
119
+ - [ ] Required test data seeded (products, allergens, etc.)
120
+ - [ ] Backend services running and accessible
121
+ - [ ] External service stubs/mocks configured (if applicable)
122
+ - [ ] Device/browser configured and ready
123
+ - [ ] Environment variables set (.env)
124
+
125
+ ---
126
+
127
+ ## Success Criteria
128
+
129
+ - [ ] All main flow steps pass sequentially
130
+ - [ ] All alternate flows pass (if applicable)
131
+ - [ ] No screen transitions take > 3 seconds
132
+ - [ ] No crashes or unhandled exceptions
133
+ - [ ] No memory leaks detected during flow
134
+ - [ ] Flow completes within {X} minutes total
135
+ - [ ] Pass on target platforms:
136
+ {{#if platform === "mobile"}}
137
+ - [ ] iOS Simulator
138
+ - [ ] Android Emulator
139
+ {{/if}}
140
+ {{#if platform === "web"}}
141
+ - [ ] Chromium
142
+ - [ ] Firefox
143
+ - [ ] WebKit
144
+ {{/if}}
145
+
146
+ ---
147
+
148
+ ## Script Generation
149
+
150
+ > This scenario will be used by `/tas-e2e-mobile` or `/tas-e2e-web` to generate executable scripts.
151
+
152
+ ### Mobile Script Output
153
+ - **File**: `apps/mobile/e2e/flows/{scenario-slug}.e2e.ts`
154
+ - **Reuses**: Helper functions from `apps/mobile/e2e/features/{epic}/{feature}/helpers.ts`
155
+ - **Run**: `yarn e2e:flow:{scenario-slug}`
156
+
157
+ ### Web Script Output
158
+ - **File**: `apps/web/e2e/flows/{scenario-slug}.spec.ts`
159
+ - **Reuses**: Page objects + helpers from `apps/web/e2e/features/{epic}/{feature}/`
160
+ - **Run**: `yarn e2e:flow:{scenario-slug}`
161
+
162
+ ---
163
+
164
+ ## FT Reuse Map
165
+
166
+ > Maps scenario steps to existing functional test helpers for code reuse
167
+
168
+ | Step | FT ID | Source File | Helper Function |
169
+ |------|-------|-------------|-----------------|
170
+ | 1 | {FT_ID_1} | `features/{epic}/{feature}/helpers.ts` | `{functionName}()` |
171
+ | 2 | {FT_ID_2} | `features/{epic}/{feature}/helpers.ts` | `{functionName}()` |
172
+ | 3 | - | (new logic) | N/A - write new code |
173
+
174
+ ---
175
+
176
+ ## Changelog
177
+
178
+ | Date | Changes | Author |
179
+ |------|---------|--------|
180
+ | [created_date] | Initial E2E scenario created | @[executor] |
@@ -0,0 +1,164 @@
1
+ ---
2
+ created_date:
3
+ updated_date:
4
+ executor:
5
+ status: Draft
6
+ epic_id:
7
+ scenario_id:
8
+ ---
9
+
10
+ # E2E Web Test Specification: {Scenario Name}
11
+
12
+ **Scenario**: [{Scenario_ID}]({SCENARIO_LINK})
13
+ **Epic(s)**: [{Epic_ID}]({Epic_LINK})
14
+ **Author**: @[executor]
15
+ **Created**: [created_date]
16
+ **Status**: [status] (Draft | Ready | Implemented | Verified)
17
+
18
+ ---
19
+
20
+ ## Test Framework
21
+
22
+ - **Framework**: Playwright
23
+ - **Config**: `apps/web/playwright.config.ts`
24
+ - **Script Location**: `apps/web/e2e/flows/{scenario-slug}.spec.ts`
25
+ - **Run Command**: `yarn e2e:flow:{scenario-slug}`
26
+
27
+ ---
28
+
29
+ ## Browser Matrix
30
+
31
+ | Browser | Engine | Version | Required |
32
+ |---------|--------|---------|----------|
33
+ | Chrome | Chromium | Latest | Yes |
34
+ | Firefox | Gecko | Latest | Yes |
35
+ | Safari | WebKit | Latest | Yes (via Playwright) |
36
+ | Edge | Chromium | Latest | No (covered by Chromium) |
37
+
38
+ ---
39
+
40
+ ## Viewport Testing
41
+
42
+ | Viewport | Width | Height | Test Required |
43
+ |----------|-------|--------|---------------|
44
+ | Mobile | 375px | 812px | Yes |
45
+ | Tablet | 768px | 1024px | Yes |
46
+ | Desktop | 1280px | 720px | Yes |
47
+ | Large Desktop | 1920px | 1080px | Optional |
48
+
49
+ ---
50
+
51
+ ## Test Cases
52
+
53
+ ### Main Flow
54
+
55
+ | Test ID | Step | Page | Action | Expected | Browser | Viewport |
56
+ |---------|------|------|--------|----------|---------|----------|
57
+ | {PROJECT}_E{EPIC}_E2E_001_H | 1 | {Page} | {Action} | {Expected} | All | All |
58
+ | {PROJECT}_E{EPIC}_E2E_001_H | 2 | {Page} | {Action} | {Expected} | All | All |
59
+
60
+ ### Cross-Browser Specific
61
+
62
+ | Test ID | Browser | Issue | Test Action | Expected |
63
+ |---------|---------|-------|-------------|----------|
64
+ | {ID}_BROWSER_001 | Firefox | {Known issue} | {Action} | {Expected} |
65
+ | {ID}_BROWSER_002 | WebKit | {Known issue} | {Action} | {Expected} |
66
+
67
+ ### Responsive Specific
68
+
69
+ | Test ID | Viewport | Component | Test Action | Expected |
70
+ |---------|----------|-----------|-------------|----------|
71
+ | {ID}_RESP_001 | Mobile | {Nav menu} | {Hamburger menu test} | {Expected} |
72
+ | {ID}_RESP_002 | Tablet | {Layout} | {Grid layout test} | {Expected} |
73
+
74
+ ---
75
+
76
+ ## Playwright Configuration
77
+
78
+ ```typescript
79
+ // playwright.config.ts additions for this scenario
80
+ import { defineConfig, devices } from '@playwright/test';
81
+
82
+ export default defineConfig({
83
+ testDir: './e2e',
84
+ timeout: 30000,
85
+ retries: 1,
86
+ projects: [
87
+ { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
88
+ { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
89
+ { name: 'webkit', use: { ...devices['Desktop Safari'] } },
90
+ { name: 'mobile-chrome', use: { ...devices['Pixel 5'] } },
91
+ { name: 'mobile-safari', use: { ...devices['iPhone 13'] } },
92
+ ],
93
+ reporter: [
94
+ ['html', { outputFolder: 'reports/e2e' }],
95
+ ['junit', { outputFile: 'reports/e2e-results.xml' }],
96
+ ],
97
+ });
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Selectors Strategy
103
+
104
+ | Element Type | Selector Pattern | Example |
105
+ |-------------|-----------------|---------|
106
+ | Interactive | `data-testid` | `page.getByTestId('login-submit')` |
107
+ | Text | `getByText` | `page.getByText('Welcome')` |
108
+ | Role | `getByRole` | `page.getByRole('button', { name: 'Submit' })` |
109
+ | Label | `getByLabel` | `page.getByLabel('Email')` |
110
+
111
+ > Prefer `data-testid` for stability. Use semantic selectors (role, label) for accessibility validation.
112
+
113
+ ---
114
+
115
+ ## Network Handling
116
+
117
+ | Scenario | Mock/Real | Handler |
118
+ |----------|-----------|---------|
119
+ | API calls | Mock (route intercept) | `page.route('/api/**', handler)` |
120
+ | Auth token | From .env | `process.env.TEST_AUTH_TOKEN` |
121
+ | Slow network | Simulated | `page.route('**', route => setTimeout(() => route.continue(), 3000))` |
122
+ | Offline | Simulated | `context.setOffline(true)` |
123
+
124
+ ---
125
+
126
+ ## Accessibility Checks
127
+
128
+ - [ ] All interactive elements are keyboard accessible
129
+ - [ ] ARIA labels present on custom components
130
+ - [ ] Color contrast meets WCAG AA
131
+ - [ ] Screen reader navigation works for main flow
132
+ - [ ] Focus management correct during navigation
133
+
134
+ ---
135
+
136
+ ## Performance Budgets
137
+
138
+ | Metric | Target | Measurement |
139
+ |--------|--------|-------------|
140
+ | Page Load (LCP) | < 2.5s | Playwright metrics |
141
+ | Interaction (INP) | < 200ms | Playwright metrics |
142
+ | Layout Shift (CLS) | < 0.1 | Playwright metrics |
143
+ | JS Bundle | < 300KB | Build output |
144
+
145
+ ---
146
+
147
+ ## Success Criteria
148
+
149
+ - [ ] All test cases pass on Chromium
150
+ - [ ] All test cases pass on Firefox
151
+ - [ ] All test cases pass on WebKit
152
+ - [ ] All viewport tests pass (mobile, tablet, desktop)
153
+ - [ ] No flaky tests (100% pass on 3 runs)
154
+ - [ ] Total execution time < {X} minutes
155
+ - [ ] Accessibility checks pass
156
+ - [ ] Performance budgets met
157
+
158
+ ---
159
+
160
+ ## Changelog
161
+
162
+ | Date | Changes | Author |
163
+ |------|---------|--------|
164
+ | [created_date] | Initial web E2E spec created | @[executor] |