@sun-asterisk/sungen 2.6.6 → 2.6.7

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.
package/dist/cli/index.js CHANGED
@@ -20,7 +20,7 @@ async function main() {
20
20
  program
21
21
  .name('sungen')
22
22
  .description('Deterministic E2E Test Compiler — Gherkin + Selectors → Playwright')
23
- .version('2.6.6');
23
+ .version('2.6.7');
24
24
  // Global options
25
25
  program
26
26
  .option('-v, --verbose', 'Enable verbose logging');
@@ -27,7 +27,11 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
27
27
 
28
28
  1. **Flow**: Verify `qa/flows/<name>/` exists. If not → `/sungen:add-flow` first.
29
29
  **Screen**: Verify `qa/screens/<name>/` exists. If not → `/sungen:add-screen` first.
30
- 2. Check if `.feature` file already has scenarios. If yes → use `AskUserQuestion` to ask the update mode (see `sungen-tc-generation` skill for details). If no → fresh creation.
30
+ 2. Check if `.feature` file already has scenarios.
31
+ - If yes → use `AskUserQuestion` to ask the update mode (see `sungen-tc-generation` skill — mode depends on which tiers already exist).
32
+ - If no → fresh creation. Use `AskUserQuestion` to ask generation scope:
33
+ - **Tier 1 — Critical & High priority** — ~10-15 scenarios/section covering happy paths, core validation, security basics **(Recommended)**
34
+ - **Full coverage — All tiers at once** — generates Tier 1 + 2 + 3 in one run. Large output (~40-60 scenarios/section), best for experienced users who want complete coverage immediately
31
35
  3. **Read requirements & resolve visual source** — check `qa/<screens|flows>/<name>/requirements/`:
32
36
  - If `spec.md` exists → read it as PRIMARY source (sections, fields, validation rules, business rules, states).
33
37
  - If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), use `AskUserQuestion` to ask:
@@ -49,11 +53,23 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
49
53
 
50
54
  4. Follow the `sungen-tc-generation` skill for section identification, viewpoint generation, and output format. **For flows**, use the "Flow Test Generation" section in the skill. When requirements exist, use the "Requirements-Driven Generation" strategy.
51
55
  5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **For flows**: use `[Screen:Element]` namespace format, namespace test-data by phase, add `@flow` tag.
52
- 6. Show summary, then use `AskUserQuestion` to offer next steps:
53
-
54
- - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
55
- - **`/sungen:run-test <name>`** — Skip review, generate selectors and run tests now
56
- - **`/sungen:create-test <name>`** — Expand coverage: add @normal + @low scenarios
57
- - **Done for now** I'll come back later
56
+ 6. Show summary, then use `AskUserQuestion` to offer next steps based on which tier was just generated:
57
+
58
+ **After Tier 1 generation:**
59
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
60
+ - **`/sungen:run-test <name>`** — Skip review, generate selectors and run tests now
61
+ - **`/sungen:create-test <name>`**Expand coverage: add @normal + @low scenarios (Tier 2)
62
+ - **Done for now** — I'll come back later
63
+
64
+ **After Tier 2 generation:**
65
+ - **`/sungen:create-test <name>`** — Deep coverage: add BVA combos, cross-field validation, negative inputs, race conditions (Tier 3) (Recommended)
66
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality
67
+ - **`/sungen:run-test <name>`** — Generate selectors and run tests now
68
+ - **Done for now** — I'll come back later
69
+
70
+ **After Tier 3 or Full generation:**
71
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
72
+ - **`/sungen:run-test <name>`** — Generate selectors and run tests now
73
+ - **Done for now** — I'll come back later
58
74
 
59
75
  **No selectors.yaml** — selectors are generated during `/sungen:run-test`.
@@ -14,18 +14,38 @@ Generate **focused test cases per screen section** using a **tier-based approach
14
14
  |---|---|---|---|
15
15
  | **Tier 1** (default) | `@high` | Happy paths, required validation, core business rules, security basics | First run of `create-test` |
16
16
  | **Tier 2** (expand) | `@normal` + `@low` | UI presence, optional validation, edge cases, cosmetic checks | User runs `create-test` again with "Add viewpoints" mode |
17
+ | **Tier 3** (deep) | `@high` + `@normal` | Extra BVA combinations, cross-field validation, negative/destructive inputs, concurrent/race conditions, complex state transitions | Recommended after Tier 2 completes |
18
+ | **Full** (all-at-once) | All | Tier 1 + 2 + 3 combined in one run | Option at first run, **not recommended** — large output |
17
19
 
18
- **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior.
20
+ **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior. A **Full** option is available but not recommended — it generates all tiers at once, producing very large output (~40-60 scenarios/section).
19
21
 
20
- **Round 2 (Tier 2)** expands to full coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
22
+ **Round 2 (Tier 2)** expands coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
23
+
24
+ **Round 3 (Tier 3)** deepens coverage with advanced test design techniques after Tier 2 is complete. This tier focuses on scenarios that Tier 1+2 didn't cover:
25
+ - **Extra BVA combinations**: additional boundary points not covered in Tier 1 (e.g., `min+1`, `max-1`, typical values between boundaries)
26
+ - **Cross-field validation**: field A value affects field B behavior (dependent fields, conditional required, cascading dropdowns)
27
+ - **Negative/destructive inputs**: SQL injection, XSS payloads, special characters, excessively long strings, unicode edge cases
28
+ - **Concurrent/race conditions**: double submit, back button after submit, multiple tabs, session expiry mid-action
29
+ - **Complex state transitions**: multi-step state changes, undo/redo, conflicting state updates, transition from every non-obvious state
21
30
 
22
31
  ## Update Mode
23
32
 
24
- When `.feature` already has scenarios, summarize and ask:
33
+ When `.feature` already has scenarios, summarize existing coverage and ask:
34
+
35
+ **If only Tier 1 exists** (only `@high` scenarios):
25
36
  1. **Add new sections** — append new sections with Tier 2 (`@normal` + `@low`) scenarios, continue numbering
26
37
  2. **Add viewpoints** — expand existing sections with Tier 2 (`@normal` + `@low`) scenarios
27
38
  3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
28
39
 
40
+ **If Tier 1 + 2 exist** (`@high` + `@normal` + `@low` scenarios):
41
+ 1. **Deep coverage (Tier 3)** — add advanced scenarios: extra BVA, cross-field validation, negative inputs, race conditions **(Recommended)**
42
+ 2. **Add new sections** — append new sections with Tier 2 scenarios, continue numbering
43
+ 3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
44
+
45
+ **If Tier 1 + 2 + 3 exist** (full coverage already):
46
+ 1. **Add new sections** — append new sections if screen has changed
47
+ 2. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
48
+
29
49
  For append: read highest `VP-<CAT>-<NNN>`, continue from next number. Never modify existing scenarios.
30
50
 
31
51
  ## Requirements-Driven Generation
@@ -91,6 +111,13 @@ Use `sungen-viewpoint` skill for per-pattern checklists across 4 viewpoints: UI/
91
111
  **Tier-aware gap filling:**
92
112
  - **Tier 1 (first run)**: only add `@high` items from the checklists — core security checks (VP-SEC), required field validation (VP-VAL), key state transitions (VP-LOGIC). Skip `@normal`/`@low` items like hover states, empty states, tooltips.
93
113
  - **Tier 2 (expand run)**: add `@normal` + `@low` scenarios — UI presence, optional validation, edge cases, cosmetic checks, keyboard nav, hover effects.
114
+ - **Tier 3 (deep run)**: do NOT use viewpoint checklists. Instead, re-apply test design techniques with deeper analysis:
115
+ - **BVA**: expand from 4-point to 6-point (`min-1`, `min`, `min+1`, `max-1`, `max`, `max+1`) + typical mid-range value
116
+ - **Decision Table**: enumerate combinations previously capped — cover remaining outcome rows
117
+ - **Cross-field**: identify field dependencies from spec, generate one scenario per dependency
118
+ - **Negative inputs**: add security-oriented inputs (SQL `' OR 1=1`, XSS `<script>`, special chars `<>&"'`, max+100 length)
119
+ - **Race conditions**: double-click submit, browser back after POST, concurrent edit by two users
120
+ - **Full (all-at-once)**: apply Tier 1 + 2 + 3 rules in a single generation pass. Use all techniques at maximum depth.
94
121
 
95
122
  **Validation rule**: capture actual error messages from live page or spec.md. Use `User see {{error_var}}` — never assert just "is visible".
96
123
 
@@ -242,6 +269,8 @@ Feature: <Screen> Screen
242
269
 
243
270
  **Tier 2 (expand run)** adds `@normal` + `@low` scenarios like UI field presence, hover states, tooltips, empty states.
244
271
 
272
+ **Tier 3 (deep run)** adds advanced `@high` + `@normal` scenarios: extra BVA boundaries, cross-field validation, negative/destructive inputs, concurrent/race conditions.
273
+
245
274
  ### When to use DataTable vs Row Scope
246
275
 
247
276
  | Pattern | Use when |
@@ -22,7 +22,11 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
22
22
 
23
23
  1. **Flow**: Verify `qa/flows/${input:name}/` exists. If not → `/sungen-add-flow` first.
24
24
  **Screen**: Verify `qa/screens/${input:name}/` exists. If not → `/sungen-add-screen` first.
25
- 2. Check if `.feature` already has scenarios. If yes → summarize existing coverage and ask: **1) Add new sections**, **2) Add viewpoints to existing sections**, or **3) Replace all**. See `sungen-tc-generation` skill for update mode details.
25
+ 2. Check if `.feature` already has scenarios.
26
+ - If yes → summarize existing coverage and ask update mode (options depend on which tiers already exist — see `sungen-tc-generation` skill for details).
27
+ - If no → fresh creation. Ask generation scope:
28
+ - **1) Tier 1 — Critical & High priority** — ~10-15 scenarios/section covering happy paths, core validation, security basics **(Recommended)**
29
+ - **2) Full coverage — All tiers at once** — generates Tier 1 + 2 + 3 in one run. Large output (~40-60 scenarios/section), best for experienced users who want complete coverage immediately
26
30
  3. **Read requirements & resolve visual source** — check `<base>/${input:name}/requirements/`:
27
31
  - If `spec.md` exists → read it as PRIMARY source (sections, fields, validation rules, business rules, states).
28
32
  - If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), ask:
@@ -44,11 +48,23 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
44
48
 
45
49
  4. Follow the `sungen-tc-generation` skill for section identification, viewpoint generation, and output format. **For flows**, use the "Flow Test Generation" section in the skill. When requirements exist, use the "Requirements-Driven Generation" strategy. Present sections as a numbered list and let user pick.
46
50
  5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **For flows**: use `[Screen:Element]` namespace format, namespace test-data by phase, add `@flow` tag.
47
- 6. Show summary and offer next steps:
51
+ 6. Show summary and offer next steps based on which tier was just generated:
48
52
 
49
- - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
50
- - **`/sungen-run-test ${input:name}`** — Skip review, generate selectors and run tests now
51
- - **`/sungen-create-test ${input:name}`** — Expand coverage: add @normal + @low scenarios
52
- - **Done for now** I'll come back later
53
+ **After Tier 1 generation:**
54
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
55
+ - **`/sungen-run-test ${input:name}`** — Skip review, generate selectors and run tests now
56
+ - **`/sungen-create-test ${input:name}`**Expand coverage: add @normal + @low scenarios (Tier 2)
57
+ - **Done for now** — I'll come back later
58
+
59
+ **After Tier 2 generation:**
60
+ - **`/sungen-create-test ${input:name}`** — Deep coverage: add BVA combos, cross-field validation, negative inputs, race conditions (Tier 3) (Recommended)
61
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality
62
+ - **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now
63
+ - **Done for now** — I'll come back later
64
+
65
+ **After Tier 3 or Full generation:**
66
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
67
+ - **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now
68
+ - **Done for now** — I'll come back later
53
69
 
54
70
  **No selectors.yaml** — selectors are generated during `/sungen-run-test`.
@@ -14,18 +14,38 @@ Generate **focused test cases per screen section** using a **tier-based approach
14
14
  |---|---|---|---|
15
15
  | **Tier 1** (default) | `@high` | Happy paths, required validation, core business rules, security basics | First run of `create-test` |
16
16
  | **Tier 2** (expand) | `@normal` + `@low` | UI presence, optional validation, edge cases, cosmetic checks | User runs `create-test` again with "Add viewpoints" mode |
17
+ | **Tier 3** (deep) | `@high` + `@normal` | Extra BVA combinations, cross-field validation, negative/destructive inputs, concurrent/race conditions, complex state transitions | Recommended after Tier 2 completes |
18
+ | **Full** (all-at-once) | All | Tier 1 + 2 + 3 combined in one run | Option at first run, **not recommended** — large output |
17
19
 
18
- **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior.
20
+ **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior. A **Full** option is available but not recommended — it generates all tiers at once, producing very large output (~40-60 scenarios/section).
19
21
 
20
- **Round 2 (Tier 2)** expands to full coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
22
+ **Round 2 (Tier 2)** expands coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
23
+
24
+ **Round 3 (Tier 3)** deepens coverage with advanced test design techniques after Tier 2 is complete. This tier focuses on scenarios that Tier 1+2 didn't cover:
25
+ - **Extra BVA combinations**: additional boundary points not covered in Tier 1 (e.g., `min+1`, `max-1`, typical values between boundaries)
26
+ - **Cross-field validation**: field A value affects field B behavior (dependent fields, conditional required, cascading dropdowns)
27
+ - **Negative/destructive inputs**: SQL injection, XSS payloads, special characters, excessively long strings, unicode edge cases
28
+ - **Concurrent/race conditions**: double submit, back button after submit, multiple tabs, session expiry mid-action
29
+ - **Complex state transitions**: multi-step state changes, undo/redo, conflicting state updates, transition from every non-obvious state
21
30
 
22
31
  ## Update Mode
23
32
 
24
- When `.feature` already has scenarios, summarize and ask:
33
+ When `.feature` already has scenarios, summarize existing coverage and ask:
34
+
35
+ **If only Tier 1 exists** (only `@high` scenarios):
25
36
  1. **Add new sections** — append new sections with Tier 2 (`@normal` + `@low`) scenarios, continue numbering
26
37
  2. **Add viewpoints** — expand existing sections with Tier 2 (`@normal` + `@low`) scenarios
27
38
  3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
28
39
 
40
+ **If Tier 1 + 2 exist** (`@high` + `@normal` + `@low` scenarios):
41
+ 1. **Deep coverage (Tier 3)** — add advanced scenarios: extra BVA, cross-field validation, negative inputs, race conditions **(Recommended)**
42
+ 2. **Add new sections** — append new sections with Tier 2 scenarios, continue numbering
43
+ 3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
44
+
45
+ **If Tier 1 + 2 + 3 exist** (full coverage already):
46
+ 1. **Add new sections** — append new sections if screen has changed
47
+ 2. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
48
+
29
49
  For append: read highest `VP-<CAT>-<NNN>`, continue from next number. Never modify existing scenarios.
30
50
 
31
51
  ## Requirements-Driven Generation
@@ -104,6 +124,13 @@ Use `sungen-viewpoint` skill for per-pattern checklists across 4 viewpoints: UI/
104
124
  **Tier-aware gap filling:**
105
125
  - **Tier 1 (first run)**: only add `@high` items from the checklists — core security checks (VP-SEC), required field validation (VP-VAL), key state transitions (VP-LOGIC). Skip `@normal`/`@low` items like hover states, empty states, tooltips.
106
126
  - **Tier 2 (expand run)**: add `@normal` + `@low` scenarios — UI presence, optional validation, edge cases, cosmetic checks, keyboard nav, hover effects.
127
+ - **Tier 3 (deep run)**: do NOT use viewpoint checklists. Instead, re-apply test design techniques with deeper analysis:
128
+ - **BVA**: expand from 4-point to 6-point (`min-1`, `min`, `min+1`, `max-1`, `max`, `max+1`) + typical mid-range value
129
+ - **Decision Table**: enumerate combinations previously capped — cover remaining outcome rows
130
+ - **Cross-field**: identify field dependencies from spec, generate one scenario per dependency
131
+ - **Negative inputs**: add security-oriented inputs (SQL `' OR 1=1`, XSS `<script>`, special chars `<>&"'`, max+100 length)
132
+ - **Race conditions**: double-click submit, browser back after POST, concurrent edit by two users
133
+ - **Full (all-at-once)**: apply Tier 1 + 2 + 3 rules in a single generation pass. Use all techniques at maximum depth.
107
134
 
108
135
  **Validation rule**: capture actual error messages from live page or spec.md. Use `User see {{error_var}}` — never assert just "is visible".
109
136
 
@@ -255,6 +282,8 @@ Feature: <Screen> Screen
255
282
 
256
283
  **Tier 2 (expand run)** adds `@normal` + `@low` scenarios like UI field presence, hover states, tooltips, empty states.
257
284
 
285
+ **Tier 3 (deep run)** adds advanced `@high` + `@normal` scenarios: extra BVA boundaries, cross-field validation, negative/destructive inputs, concurrent/race conditions.
286
+
258
287
  ### When to use DataTable vs Row Scope
259
288
 
260
289
  | Pattern | Use when |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sun-asterisk/sungen",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "description": "Deterministic E2E Test Compiler - Gherkin + Selectors → Playwright tests",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/cli/index.ts CHANGED
@@ -21,7 +21,7 @@ async function main() {
21
21
  program
22
22
  .name('sungen')
23
23
  .description('Deterministic E2E Test Compiler — Gherkin + Selectors → Playwright')
24
- .version('2.6.6');
24
+ .version('2.6.7');
25
25
 
26
26
  // Global options
27
27
  program
@@ -27,7 +27,11 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
27
27
 
28
28
  1. **Flow**: Verify `qa/flows/<name>/` exists. If not → `/sungen:add-flow` first.
29
29
  **Screen**: Verify `qa/screens/<name>/` exists. If not → `/sungen:add-screen` first.
30
- 2. Check if `.feature` file already has scenarios. If yes → use `AskUserQuestion` to ask the update mode (see `sungen-tc-generation` skill for details). If no → fresh creation.
30
+ 2. Check if `.feature` file already has scenarios.
31
+ - If yes → use `AskUserQuestion` to ask the update mode (see `sungen-tc-generation` skill — mode depends on which tiers already exist).
32
+ - If no → fresh creation. Use `AskUserQuestion` to ask generation scope:
33
+ - **Tier 1 — Critical & High priority** — ~10-15 scenarios/section covering happy paths, core validation, security basics **(Recommended)**
34
+ - **Full coverage — All tiers at once** — generates Tier 1 + 2 + 3 in one run. Large output (~40-60 scenarios/section), best for experienced users who want complete coverage immediately
31
35
  3. **Read requirements & resolve visual source** — check `qa/<screens|flows>/<name>/requirements/`:
32
36
  - If `spec.md` exists → read it as PRIMARY source (sections, fields, validation rules, business rules, states).
33
37
  - If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), use `AskUserQuestion` to ask:
@@ -49,11 +53,23 @@ Parse **name** from `$ARGUMENTS`. If missing, ask the user.
49
53
 
50
54
  4. Follow the `sungen-tc-generation` skill for section identification, viewpoint generation, and output format. **For flows**, use the "Flow Test Generation" section in the skill. When requirements exist, use the "Requirements-Driven Generation" strategy.
51
55
  5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **For flows**: use `[Screen:Element]` namespace format, namespace test-data by phase, add `@flow` tag.
52
- 6. Show summary, then use `AskUserQuestion` to offer next steps:
53
-
54
- - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
55
- - **`/sungen:run-test <name>`** — Skip review, generate selectors and run tests now
56
- - **`/sungen:create-test <name>`** — Expand coverage: add @normal + @low scenarios
57
- - **Done for now** I'll come back later
56
+ 6. Show summary, then use `AskUserQuestion` to offer next steps based on which tier was just generated:
57
+
58
+ **After Tier 1 generation:**
59
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
60
+ - **`/sungen:run-test <name>`** — Skip review, generate selectors and run tests now
61
+ - **`/sungen:create-test <name>`**Expand coverage: add @normal + @low scenarios (Tier 2)
62
+ - **Done for now** — I'll come back later
63
+
64
+ **After Tier 2 generation:**
65
+ - **`/sungen:create-test <name>`** — Deep coverage: add BVA combos, cross-field validation, negative inputs, race conditions (Tier 3) (Recommended)
66
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality
67
+ - **`/sungen:run-test <name>`** — Generate selectors and run tests now
68
+ - **Done for now** — I'll come back later
69
+
70
+ **After Tier 3 or Full generation:**
71
+ - **`/sungen:review <name>`** — Review syntax, coverage, viewpoint quality (Recommended)
72
+ - **`/sungen:run-test <name>`** — Generate selectors and run tests now
73
+ - **Done for now** — I'll come back later
58
74
 
59
75
  **No selectors.yaml** — selectors are generated during `/sungen:run-test`.
@@ -14,18 +14,38 @@ Generate **focused test cases per screen section** using a **tier-based approach
14
14
  |---|---|---|---|
15
15
  | **Tier 1** (default) | `@high` | Happy paths, required validation, core business rules, security basics | First run of `create-test` |
16
16
  | **Tier 2** (expand) | `@normal` + `@low` | UI presence, optional validation, edge cases, cosmetic checks | User runs `create-test` again with "Add viewpoints" mode |
17
+ | **Tier 3** (deep) | `@high` + `@normal` | Extra BVA combinations, cross-field validation, negative/destructive inputs, concurrent/race conditions, complex state transitions | Recommended after Tier 2 completes |
18
+ | **Full** (all-at-once) | All | Tier 1 + 2 + 3 combined in one run | Option at first run, **not recommended** — large output |
17
19
 
18
- **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior.
20
+ **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior. A **Full** option is available but not recommended — it generates all tiers at once, producing very large output (~40-60 scenarios/section).
19
21
 
20
- **Round 2 (Tier 2)** expands to full coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
22
+ **Round 2 (Tier 2)** expands coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
23
+
24
+ **Round 3 (Tier 3)** deepens coverage with advanced test design techniques after Tier 2 is complete. This tier focuses on scenarios that Tier 1+2 didn't cover:
25
+ - **Extra BVA combinations**: additional boundary points not covered in Tier 1 (e.g., `min+1`, `max-1`, typical values between boundaries)
26
+ - **Cross-field validation**: field A value affects field B behavior (dependent fields, conditional required, cascading dropdowns)
27
+ - **Negative/destructive inputs**: SQL injection, XSS payloads, special characters, excessively long strings, unicode edge cases
28
+ - **Concurrent/race conditions**: double submit, back button after submit, multiple tabs, session expiry mid-action
29
+ - **Complex state transitions**: multi-step state changes, undo/redo, conflicting state updates, transition from every non-obvious state
21
30
 
22
31
  ## Update Mode
23
32
 
24
- When `.feature` already has scenarios, summarize and ask:
33
+ When `.feature` already has scenarios, summarize existing coverage and ask:
34
+
35
+ **If only Tier 1 exists** (only `@high` scenarios):
25
36
  1. **Add new sections** — append new sections with Tier 2 (`@normal` + `@low`) scenarios, continue numbering
26
37
  2. **Add viewpoints** — expand existing sections with Tier 2 (`@normal` + `@low`) scenarios
27
38
  3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
28
39
 
40
+ **If Tier 1 + 2 exist** (`@high` + `@normal` + `@low` scenarios):
41
+ 1. **Deep coverage (Tier 3)** — add advanced scenarios: extra BVA, cross-field validation, negative inputs, race conditions **(Recommended)**
42
+ 2. **Add new sections** — append new sections with Tier 2 scenarios, continue numbering
43
+ 3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
44
+
45
+ **If Tier 1 + 2 + 3 exist** (full coverage already):
46
+ 1. **Add new sections** — append new sections if screen has changed
47
+ 2. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
48
+
29
49
  For append: read highest `VP-<CAT>-<NNN>`, continue from next number. Never modify existing scenarios.
30
50
 
31
51
  ## Requirements-Driven Generation
@@ -91,6 +111,13 @@ Use `sungen-viewpoint` skill for per-pattern checklists across 4 viewpoints: UI/
91
111
  **Tier-aware gap filling:**
92
112
  - **Tier 1 (first run)**: only add `@high` items from the checklists — core security checks (VP-SEC), required field validation (VP-VAL), key state transitions (VP-LOGIC). Skip `@normal`/`@low` items like hover states, empty states, tooltips.
93
113
  - **Tier 2 (expand run)**: add `@normal` + `@low` scenarios — UI presence, optional validation, edge cases, cosmetic checks, keyboard nav, hover effects.
114
+ - **Tier 3 (deep run)**: do NOT use viewpoint checklists. Instead, re-apply test design techniques with deeper analysis:
115
+ - **BVA**: expand from 4-point to 6-point (`min-1`, `min`, `min+1`, `max-1`, `max`, `max+1`) + typical mid-range value
116
+ - **Decision Table**: enumerate combinations previously capped — cover remaining outcome rows
117
+ - **Cross-field**: identify field dependencies from spec, generate one scenario per dependency
118
+ - **Negative inputs**: add security-oriented inputs (SQL `' OR 1=1`, XSS `<script>`, special chars `<>&"'`, max+100 length)
119
+ - **Race conditions**: double-click submit, browser back after POST, concurrent edit by two users
120
+ - **Full (all-at-once)**: apply Tier 1 + 2 + 3 rules in a single generation pass. Use all techniques at maximum depth.
94
121
 
95
122
  **Validation rule**: capture actual error messages from live page or spec.md. Use `User see {{error_var}}` — never assert just "is visible".
96
123
 
@@ -242,6 +269,8 @@ Feature: <Screen> Screen
242
269
 
243
270
  **Tier 2 (expand run)** adds `@normal` + `@low` scenarios like UI field presence, hover states, tooltips, empty states.
244
271
 
272
+ **Tier 3 (deep run)** adds advanced `@high` + `@normal` scenarios: extra BVA boundaries, cross-field validation, negative/destructive inputs, concurrent/race conditions.
273
+
245
274
  ### When to use DataTable vs Row Scope
246
275
 
247
276
  | Pattern | Use when |
@@ -22,7 +22,11 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
22
22
 
23
23
  1. **Flow**: Verify `qa/flows/${input:name}/` exists. If not → `/sungen-add-flow` first.
24
24
  **Screen**: Verify `qa/screens/${input:name}/` exists. If not → `/sungen-add-screen` first.
25
- 2. Check if `.feature` already has scenarios. If yes → summarize existing coverage and ask: **1) Add new sections**, **2) Add viewpoints to existing sections**, or **3) Replace all**. See `sungen-tc-generation` skill for update mode details.
25
+ 2. Check if `.feature` already has scenarios.
26
+ - If yes → summarize existing coverage and ask update mode (options depend on which tiers already exist — see `sungen-tc-generation` skill for details).
27
+ - If no → fresh creation. Ask generation scope:
28
+ - **1) Tier 1 — Critical & High priority** — ~10-15 scenarios/section covering happy paths, core validation, security basics **(Recommended)**
29
+ - **2) Full coverage — All tiers at once** — generates Tier 1 + 2 + 3 in one run. Large output (~40-60 scenarios/section), best for experienced users who want complete coverage immediately
26
30
  3. **Read requirements & resolve visual source** — check `<base>/${input:name}/requirements/`:
27
31
  - If `spec.md` exists → read it as PRIMARY source (sections, fields, validation rules, business rules, states).
28
32
  - If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), ask:
@@ -44,11 +48,23 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
44
48
 
45
49
  4. Follow the `sungen-tc-generation` skill for section identification, viewpoint generation, and output format. **For flows**, use the "Flow Test Generation" section in the skill. When requirements exist, use the "Requirements-Driven Generation" strategy. Present sections as a numbered list and let user pick.
46
50
  5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **For flows**: use `[Screen:Element]` namespace format, namespace test-data by phase, add `@flow` tag.
47
- 6. Show summary and offer next steps:
51
+ 6. Show summary and offer next steps based on which tier was just generated:
48
52
 
49
- - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
50
- - **`/sungen-run-test ${input:name}`** — Skip review, generate selectors and run tests now
51
- - **`/sungen-create-test ${input:name}`** — Expand coverage: add @normal + @low scenarios
52
- - **Done for now** I'll come back later
53
+ **After Tier 1 generation:**
54
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
55
+ - **`/sungen-run-test ${input:name}`** — Skip review, generate selectors and run tests now
56
+ - **`/sungen-create-test ${input:name}`**Expand coverage: add @normal + @low scenarios (Tier 2)
57
+ - **Done for now** — I'll come back later
58
+
59
+ **After Tier 2 generation:**
60
+ - **`/sungen-create-test ${input:name}`** — Deep coverage: add BVA combos, cross-field validation, negative inputs, race conditions (Tier 3) (Recommended)
61
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality
62
+ - **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now
63
+ - **Done for now** — I'll come back later
64
+
65
+ **After Tier 3 or Full generation:**
66
+ - **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality (Recommended)
67
+ - **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now
68
+ - **Done for now** — I'll come back later
53
69
 
54
70
  **No selectors.yaml** — selectors are generated during `/sungen-run-test`.
@@ -14,18 +14,38 @@ Generate **focused test cases per screen section** using a **tier-based approach
14
14
  |---|---|---|---|
15
15
  | **Tier 1** (default) | `@high` | Happy paths, required validation, core business rules, security basics | First run of `create-test` |
16
16
  | **Tier 2** (expand) | `@normal` + `@low` | UI presence, optional validation, edge cases, cosmetic checks | User runs `create-test` again with "Add viewpoints" mode |
17
+ | **Tier 3** (deep) | `@high` + `@normal` | Extra BVA combinations, cross-field validation, negative/destructive inputs, concurrent/race conditions, complex state transitions | Recommended after Tier 2 completes |
18
+ | **Full** (all-at-once) | All | Tier 1 + 2 + 3 combined in one run | Option at first run, **not recommended** — large output |
17
19
 
18
- **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior.
20
+ **Round 1 (Tier 1)** targets **~10-15 scenarios per section** — enough to cover critical flows and catch real bugs. This is the default behavior. A **Full** option is available but not recommended — it generates all tiers at once, producing very large output (~40-60 scenarios/section).
19
21
 
20
- **Round 2 (Tier 2)** expands to full coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
22
+ **Round 2 (Tier 2)** expands coverage when the user explicitly chooses "Add viewpoints" or "Add new sections" update mode. Only then generate `@normal` + `@low` scenarios to fill coverage gaps.
23
+
24
+ **Round 3 (Tier 3)** deepens coverage with advanced test design techniques after Tier 2 is complete. This tier focuses on scenarios that Tier 1+2 didn't cover:
25
+ - **Extra BVA combinations**: additional boundary points not covered in Tier 1 (e.g., `min+1`, `max-1`, typical values between boundaries)
26
+ - **Cross-field validation**: field A value affects field B behavior (dependent fields, conditional required, cascading dropdowns)
27
+ - **Negative/destructive inputs**: SQL injection, XSS payloads, special characters, excessively long strings, unicode edge cases
28
+ - **Concurrent/race conditions**: double submit, back button after submit, multiple tabs, session expiry mid-action
29
+ - **Complex state transitions**: multi-step state changes, undo/redo, conflicting state updates, transition from every non-obvious state
21
30
 
22
31
  ## Update Mode
23
32
 
24
- When `.feature` already has scenarios, summarize and ask:
33
+ When `.feature` already has scenarios, summarize existing coverage and ask:
34
+
35
+ **If only Tier 1 exists** (only `@high` scenarios):
25
36
  1. **Add new sections** — append new sections with Tier 2 (`@normal` + `@low`) scenarios, continue numbering
26
37
  2. **Add viewpoints** — expand existing sections with Tier 2 (`@normal` + `@low`) scenarios
27
38
  3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
28
39
 
40
+ **If Tier 1 + 2 exist** (`@high` + `@normal` + `@low` scenarios):
41
+ 1. **Deep coverage (Tier 3)** — add advanced scenarios: extra BVA, cross-field validation, negative inputs, race conditions **(Recommended)**
42
+ 2. **Add new sections** — append new sections with Tier 2 scenarios, continue numbering
43
+ 3. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
44
+
45
+ **If Tier 1 + 2 + 3 exist** (full coverage already):
46
+ 1. **Add new sections** — append new sections if screen has changed
47
+ 2. **Replace all** — overwrite with fresh Tier 1 (`@high`) generation
48
+
29
49
  For append: read highest `VP-<CAT>-<NNN>`, continue from next number. Never modify existing scenarios.
30
50
 
31
51
  ## Requirements-Driven Generation
@@ -104,6 +124,13 @@ Use `sungen-viewpoint` skill for per-pattern checklists across 4 viewpoints: UI/
104
124
  **Tier-aware gap filling:**
105
125
  - **Tier 1 (first run)**: only add `@high` items from the checklists — core security checks (VP-SEC), required field validation (VP-VAL), key state transitions (VP-LOGIC). Skip `@normal`/`@low` items like hover states, empty states, tooltips.
106
126
  - **Tier 2 (expand run)**: add `@normal` + `@low` scenarios — UI presence, optional validation, edge cases, cosmetic checks, keyboard nav, hover effects.
127
+ - **Tier 3 (deep run)**: do NOT use viewpoint checklists. Instead, re-apply test design techniques with deeper analysis:
128
+ - **BVA**: expand from 4-point to 6-point (`min-1`, `min`, `min+1`, `max-1`, `max`, `max+1`) + typical mid-range value
129
+ - **Decision Table**: enumerate combinations previously capped — cover remaining outcome rows
130
+ - **Cross-field**: identify field dependencies from spec, generate one scenario per dependency
131
+ - **Negative inputs**: add security-oriented inputs (SQL `' OR 1=1`, XSS `<script>`, special chars `<>&"'`, max+100 length)
132
+ - **Race conditions**: double-click submit, browser back after POST, concurrent edit by two users
133
+ - **Full (all-at-once)**: apply Tier 1 + 2 + 3 rules in a single generation pass. Use all techniques at maximum depth.
107
134
 
108
135
  **Validation rule**: capture actual error messages from live page or spec.md. Use `User see {{error_var}}` — never assert just "is visible".
109
136
 
@@ -255,6 +282,8 @@ Feature: <Screen> Screen
255
282
 
256
283
  **Tier 2 (expand run)** adds `@normal` + `@low` scenarios like UI field presence, hover states, tooltips, empty states.
257
284
 
285
+ **Tier 3 (deep run)** adds advanced `@high` + `@normal` scenarios: extra BVA boundaries, cross-field validation, negative/destructive inputs, concurrent/race conditions.
286
+
258
287
  ### When to use DataTable vs Row Scope
259
288
 
260
289
  | Pattern | Use when |