@torus-engineering/tas-kit 1.7.0 → 1.8.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 (71) hide show
  1. package/.claude/commands/tas-adr.md +33 -29
  2. package/.claude/commands/tas-api-test.md +95 -0
  3. package/.claude/commands/tas-bug.md +113 -109
  4. package/.claude/commands/tas-design.md +37 -33
  5. package/.claude/commands/tas-dev.md +128 -115
  6. package/.claude/commands/tas-e2e-mobile.md +155 -0
  7. package/.claude/commands/tas-e2e-web.md +163 -0
  8. package/.claude/commands/tas-e2e.md +102 -0
  9. package/.claude/commands/tas-epic.md +35 -31
  10. package/.claude/commands/tas-feature.md +47 -43
  11. package/.claude/commands/tas-fix.md +51 -47
  12. package/.claude/commands/tas-functest-mobile.md +144 -0
  13. package/.claude/commands/tas-functest-web.md +192 -0
  14. package/.claude/commands/tas-functest.md +76 -0
  15. package/.claude/commands/tas-plan.md +200 -184
  16. package/.claude/commands/tas-prd.md +37 -33
  17. package/.claude/commands/tas-review.md +111 -104
  18. package/.claude/commands/tas-sad.md +43 -39
  19. package/.claude/commands/tas-security.md +81 -80
  20. package/.claude/commands/tas-story.md +91 -87
  21. package/.claude/commands/tas-verify.md +51 -41
  22. package/.claude/rules/common/post-review-agent.md +49 -39
  23. package/.claude/rules/common/testing.md +24 -0
  24. package/.claude/rules/common/token-logging.md +27 -0
  25. package/.claude/rules/csharp/api-testing.md +171 -0
  26. package/.claude/rules/csharp/patterns.md +10 -0
  27. package/.claude/rules/python/patterns.md +10 -0
  28. package/.claude/rules/typescript/patterns.md +10 -0
  29. package/.claude/rules/web/performance.md +9 -0
  30. package/.claude/skills/api-design/SKILL.md +3 -1
  31. package/.claude/skills/{backend-patterns → js-backend-patterns}/SKILL.md +2 -1
  32. package/.claude/skills/tas-implementation-complete/SKILL.md +99 -97
  33. package/.claude/skills/tas-tdd/SKILL.md +123 -82
  34. package/.claude/skills/token-logger/SKILL.md +19 -0
  35. package/.tas/templates/E2E-Execution-Report.md +198 -0
  36. package/.tas/templates/E2E-Mobile-Spec.md +130 -0
  37. package/.tas/templates/E2E-Report.md +174 -0
  38. package/.tas/templates/E2E-Scenario.md +180 -0
  39. package/.tas/templates/E2E-Web-Spec.md +164 -0
  40. package/.tas/templates/Feature.md +55 -55
  41. package/.tas/templates/Func-Test-Script.md +254 -0
  42. package/.tas/templates/Func-Test-Spec.md +187 -0
  43. package/.tas/templates/SAD.md +274 -274
  44. package/.tas/templates/Story.md +90 -88
  45. package/bin/cli.js +56 -56
  46. package/lib/deleted-files.json +33 -0
  47. package/lib/install.js +213 -176
  48. package/package.json +34 -34
  49. package/.claude/agents/README.md +0 -83
  50. package/.claude/agents/ado-agent.md +0 -39
  51. package/.claude/agents/code-architect.md +0 -62
  52. package/.claude/agents/code-simplifier.md +0 -53
  53. package/.claude/agents/comment-analyzer.md +0 -59
  54. package/.claude/agents/conversation-analyzer.md +0 -57
  55. package/.claude/agents/docs-lookup.md +0 -55
  56. package/.claude/agents/harness-optimizer.md +0 -62
  57. package/.claude/agents/loop-operator.md +0 -56
  58. package/.claude/agents/performance-optimizer.md +0 -78
  59. package/.claude/agents/pr-test-analyzer.md +0 -68
  60. package/.claude/agents/pytorch-build-resolver.md +0 -76
  61. package/.claude/agents/refactor-cleaner.md +0 -70
  62. package/.claude/agents/seo-specialist.md +0 -75
  63. package/.claude/agents/silent-failure-hunter.md +0 -69
  64. package/.claude/agents/type-design-analyzer.md +0 -75
  65. package/.claude/rules/common/agents.md +0 -65
  66. package/.claude/rules/common/coding-style.md +0 -90
  67. package/.claude/rules/common/development-workflow.md +0 -44
  68. package/.claude/rules/common/git-workflow.md +0 -24
  69. package/.claude/rules/common/performance.md +0 -55
  70. package/.claude/skills/agent-harness-construction/SKILL.md +0 -77
  71. package/.claude/skills/agent-introspection-debugging/SKILL.md +0 -157
@@ -0,0 +1,198 @@
1
+ ---
2
+ created_date:
3
+ executor:
4
+ status: # Pass | Fail | Partial
5
+ test_layer: # functional | e2e
6
+ scenario_id:
7
+ feature_id:
8
+ epic_id:
9
+ platform: # mobile-ios | mobile-android | web-chromium | web-firefox | web-webkit
10
+ environment: # dev | staging | prod
11
+ ---
12
+
13
+ # Test Execution Report: {Scenario/Feature Name}
14
+
15
+ **Layer**: {{test_layer}} (Functional | E2E)
16
+ **Platform**: {{platform}}
17
+ **Environment**: {{environment}}
18
+ **Executor**: @[executor]
19
+ **Date**: [created_date]
20
+ **Status**: [status]
21
+
22
+ ---
23
+
24
+ ## Summary
25
+
26
+ | Metric | Value |
27
+ |--------|-------|
28
+ | Total Tests | {count} |
29
+ | Passed | {count} |
30
+ | Failed | {count} |
31
+ | Skipped | {count} |
32
+ | Flaky | {count} |
33
+ | Pass Rate | {X}% |
34
+ | Execution Time | {duration} |
35
+ | Environment | {{environment}} |
36
+
37
+ ---
38
+
39
+ ## Results by Test ID
40
+
41
+ | Test ID | AC Ref | Description | Result | Duration | Failure Reason |
42
+ |---------|--------|-------------|--------|----------|----------------|
43
+ | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H | AC-1 | {description} | PASS | {Xs} | - |
44
+ | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_002_N | AC-1 | {description} | PASS | {Xs} | - |
45
+ | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_003_E | AC-1 | {description} | FAIL | {Xs} | {brief reason: element not found / assertion mismatch / timeout / ...} |
46
+
47
+ ---
48
+
49
+ ## Failed Tests
50
+
51
+ ### {Test ID}: {Test Description}
52
+
53
+ **AC Reference**: AC-{N}
54
+ **Failure Reason**: {Mô tả ngắn gọn LÝ DO fail — ví dụ: "Button 'Submit' không hiển thị sau khi nhập email hợp lệ", "API trả về 401 thay vì 200", "Timeout sau 5s chờ màn hình Home load"}
55
+ **Error Type**: {Assertion Failure | Timeout | Crash | Element Not Found}
56
+ **Error Message**:
57
+ ```
58
+ {Error stack trace or message}
59
+ ```
60
+
61
+ **Screenshot/Video**: `artifacts/{platform}/{test-id}.png`
62
+
63
+ **Root Cause Analysis**:
64
+ > {Brief analysis of why the test failed}
65
+
66
+ **Severity**: {Critical | Major | Minor}
67
+ **Action Required**: {Fix code | Fix test | Investigate flaky | Skip with reason}
68
+
69
+ ---
70
+
71
+ ## Flaky Tests
72
+
73
+ | Test ID | Flaky Rate | Last 3 Runs | Suspected Cause |
74
+ |---------|------------|-------------|-----------------|
75
+ | {ID} | {X/3} | P/F/P | {Animation timing | Network | Race condition} |
76
+
77
+ ---
78
+
79
+ ## Platform Results
80
+
81
+ {{#if platform.startsWith("mobile")}}
82
+ ### Mobile Platform Details
83
+
84
+ | Detail | Value |
85
+ |--------|-------|
86
+ | Device | {iPhone 17 Pro / Samsung S21} |
87
+ | OS | {iOS 18.x / Android 14} |
88
+ | App Build | {Debug / Release} |
89
+ | Detox Version | {version} |
90
+ | React Native | {version} |
91
+ | Node | {version} |
92
+
93
+ ### Device-Specific Issues
94
+ | Issue | Device | Impact | Resolution |
95
+ |-------|--------|--------|------------|
96
+ | {Issue} | {Device} | {Tests affected} | {Fix/Workaround} |
97
+ {{/if}}
98
+
99
+ {{#if platform.startsWith("web")}}
100
+ ### Web Platform Details
101
+
102
+ | Detail | Value |
103
+ |--------|-------|
104
+ | Browser | {Chromium / Firefox / WebKit} |
105
+ | Browser Version | {version} |
106
+ | Playwright Version | {version} |
107
+ | Viewport | {width}x{height} |
108
+ | Node | {version} |
109
+
110
+ ### Browser-Specific Issues
111
+ | Issue | Browser | Impact | Resolution |
112
+ |-------|---------|--------|------------|
113
+ | {Issue} | {Browser} | {Tests affected} | {Fix/Workaround} |
114
+ {{/if}}
115
+
116
+ ---
117
+
118
+ ## Artifacts
119
+
120
+ | Type | Path | Description |
121
+ |------|------|-------------|
122
+ | Screenshots | `artifacts/{platform}/screenshots/` | Failure screenshots |
123
+ | Videos | `artifacts/{platform}/videos/` | Test execution recordings |
124
+ | Logs | `artifacts/{platform}/logs/` | Debug logs |
125
+ | HTML Report | `reports/{layer}-report.html` | Interactive HTML report |
126
+ | JUnit XML | `reports/{layer}-results.xml` | CI/CD compatible results |
127
+
128
+ ---
129
+
130
+ ## Test Coverage Analysis
131
+
132
+ ### AC Coverage
133
+
134
+ | AC ID | FT Tests | E2E Tests | Covered | Status |
135
+ |-------|----------|-----------|---------|--------|
136
+ | AC-1 | FT_001_H, FT_002_N | E2E_001 (Step 1) | Yes | All Pass |
137
+ | AC-2 | FT_003_H | E2E_001 (Step 3) | Yes | 1 Fail |
138
+ | AC-3 | - | - | No | Not tested |
139
+
140
+ ### Uncovered Areas
141
+ - {List any ACs or scenarios not covered by this test run}
142
+
143
+ ---
144
+
145
+ ## Performance Metrics
146
+
147
+ | Step/Test | Duration | Threshold | Status |
148
+ |-----------|----------|-----------|--------|
149
+ | {Step 1: Login} | {1.2s} | {< 3s} | OK |
150
+ | {Step 2: Navigate} | {0.5s} | {< 2s} | OK |
151
+ | {Step 3: Load Data} | {4.1s} | {< 3s} | SLOW |
152
+ | Total Flow | {8.5s} | {< 15s} | OK |
153
+
154
+ ---
155
+
156
+ ## Blockers & Issues
157
+
158
+ | # | Issue | Severity | Impact | Status | Bug ID |
159
+ |---|-------|----------|--------|--------|--------|
160
+ | 1 | {Issue description} | Critical | {Tests blocked} | {Open / Resolved} | {BUG-XXX} |
161
+ | 2 | {Issue description} | Major | {Tests affected} | {Open / Resolved} | {BUG-XXX} |
162
+
163
+ ---
164
+
165
+ ## Recommendations
166
+
167
+ ### Immediate Actions
168
+ - [ ] {Fix failing test / Fix code bug}
169
+ - [ ] {Create bug ticket for issue X}
170
+
171
+ ### Follow-up
172
+ - [ ] {Investigate flaky test}
173
+ - [ ] {Add missing test coverage for AC-X}
174
+
175
+ ### Maintenance
176
+ - [ ] {Update test data for next sprint}
177
+ - [ ] {Refactor helper function X}
178
+
179
+ ---
180
+
181
+ ## Sign-off
182
+
183
+ | Role | Name | Date | Approved |
184
+ |------|------|------|----------|
185
+ | QA | @[name] | [date] | [ ] |
186
+ | Tech Lead | @[name] | [date] | [ ] |
187
+ | PE (for Verify) | @[name] | [date] | [ ] |
188
+
189
+ **Deployment Readiness**: [ ] Ready [ ] Not Ready
190
+ **Reason (if not ready)**: {explanation}
191
+
192
+ ---
193
+
194
+ ## Changelog
195
+
196
+ | Date | Changes | Author |
197
+ |------|---------|--------|
198
+ | [created_date] | Initial execution report | @[executor] |
@@ -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] |