@sun-asterisk/sungen 2.5.2 → 2.6.1
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/commands/add-flow.d.ts +3 -0
- package/dist/cli/commands/add-flow.d.ts.map +1 -0
- package/dist/cli/commands/add-flow.js +27 -0
- package/dist/cli/commands/add-flow.js.map +1 -0
- package/dist/cli/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +95 -60
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +38 -6
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/index.js +3 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts +16 -0
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts +3 -0
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.js.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -2
- package/dist/generators/test-generator/adapters/playwright/templates/scenario.hbs +20 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-accept-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-dismiss-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-fill-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/alert-text-assertion.hbs +2 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/navigation/navigation.hbs +2 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/navigation/route-assertion.hbs +1 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/navigation/wait-timeout.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +84 -4
- package/dist/generators/test-generator/code-generator.d.ts +2 -0
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +105 -17
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.js +22 -3
- package/dist/generators/test-generator/patterns/interaction-patterns.js.map +1 -1
- package/dist/generators/test-generator/patterns/navigation-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/navigation-patterns.js +8 -3
- package/dist/generators/test-generator/patterns/navigation-patterns.js.map +1 -1
- package/dist/generators/test-generator/step-mapper.d.ts +4 -0
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +7 -0
- package/dist/generators/test-generator/step-mapper.js.map +1 -1
- package/dist/generators/test-generator/template-engine.d.ts +14 -0
- package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
- package/dist/generators/test-generator/template-engine.js +1 -1
- package/dist/generators/test-generator/template-engine.js.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.d.ts +3 -20
- package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.js +23 -66
- package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +2 -6
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +18 -80
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
- package/dist/orchestrator/ai-rules-updater.js +4 -0
- package/dist/orchestrator/ai-rules-updater.js.map +1 -1
- package/dist/orchestrator/flow-manager.d.ts +22 -0
- package/dist/orchestrator/flow-manager.d.ts.map +1 -0
- package/dist/orchestrator/flow-manager.js +251 -0
- package/dist/orchestrator/flow-manager.js.map +1 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +1 -0
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/screen-manager.d.ts.map +1 -1
- package/dist/orchestrator/screen-manager.js +3 -1
- package/dist/orchestrator/screen-manager.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +88 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +11 -8
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-review.md +8 -6
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +15 -11
- package/dist/orchestrator/templates/ai-instructions/claude-config.md +41 -10
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +12 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-delivery.md +19 -18
- package/dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +12 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +122 -10
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +31 -3
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +45 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +92 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +30 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +86 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +13 -10
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +16 -15
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +9 -7
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +21 -17
- package/dist/orchestrator/templates/ai-instructions/copilot-config.md +40 -9
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +12 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +19 -18
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +12 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +122 -10
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +31 -3
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +45 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +93 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +30 -0
- package/dist/orchestrator/templates/playwright.config.d.ts.map +1 -1
- package/dist/orchestrator/templates/playwright.config.js +3 -1
- package/dist/orchestrator/templates/playwright.config.js.map +1 -1
- package/dist/orchestrator/templates/playwright.config.ts +4 -1
- package/dist/orchestrator/templates/specs-base.d.ts +3 -4
- package/dist/orchestrator/templates/specs-base.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-base.js +60 -91
- package/dist/orchestrator/templates/specs-base.js.map +1 -1
- package/dist/orchestrator/templates/specs-base.ts +61 -101
- package/dist/orchestrator/templates/specs-test-data.d.ts +3 -1
- package/dist/orchestrator/templates/specs-test-data.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-test-data.js +53 -2
- package/dist/orchestrator/templates/specs-test-data.js.map +1 -1
- package/dist/orchestrator/templates/specs-test-data.ts +56 -2
- package/package.json +1 -1
- package/src/cli/commands/add-flow.ts +25 -0
- package/src/cli/commands/delivery.ts +109 -58
- package/src/cli/commands/generate.ts +43 -6
- package/src/cli/index.ts +3 -1
- package/src/generators/test-generator/adapters/adapter-interface.ts +6 -1
- package/src/generators/test-generator/adapters/playwright/playwright-adapter.ts +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -2
- package/src/generators/test-generator/adapters/playwright/templates/scenario.hbs +20 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-accept-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-dismiss-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-fill-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/alert-text-assertion.hbs +2 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/navigation/navigation.hbs +2 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/navigation/route-assertion.hbs +1 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/navigation/wait-timeout.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +84 -4
- package/src/generators/test-generator/code-generator.ts +119 -20
- package/src/generators/test-generator/patterns/interaction-patterns.ts +25 -3
- package/src/generators/test-generator/patterns/navigation-patterns.ts +8 -3
- package/src/generators/test-generator/step-mapper.ts +8 -0
- package/src/generators/test-generator/template-engine.ts +5 -2
- package/src/generators/test-generator/utils/data-resolver.ts +25 -77
- package/src/generators/test-generator/utils/selector-resolver.ts +23 -109
- package/src/orchestrator/ai-rules-updater.ts +5 -0
- package/src/orchestrator/flow-manager.ts +243 -0
- package/src/orchestrator/project-initializer.ts +1 -0
- package/src/orchestrator/screen-manager.ts +3 -1
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +88 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +11 -8
- package/src/orchestrator/templates/ai-instructions/claude-cmd-review.md +8 -6
- package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +15 -11
- package/src/orchestrator/templates/ai-instructions/claude-config.md +41 -10
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +12 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +19 -18
- package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +12 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +122 -10
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +31 -3
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +45 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +92 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +30 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +86 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +13 -10
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +16 -15
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +9 -7
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +21 -17
- package/src/orchestrator/templates/ai-instructions/copilot-config.md +40 -9
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +12 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +19 -18
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +12 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +122 -10
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +31 -3
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +45 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +93 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +30 -0
- package/src/orchestrator/templates/playwright.config.ts +4 -1
- package/src/orchestrator/templates/specs-base.ts +61 -101
- package/src/orchestrator/templates/specs-test-data.ts +56 -2
- package/dist/utils/feature-finder.d.ts +0 -9
- package/dist/utils/feature-finder.d.ts.map +0 -1
- package/dist/utils/feature-finder.js +0 -67
- package/dist/utils/feature-finder.js.map +0 -1
- package/dist/utils/screen-paths.d.ts +0 -10
- package/dist/utils/screen-paths.d.ts.map +0 -1
- package/dist/utils/screen-paths.js +0 -73
- package/dist/utils/screen-paths.js.map +0 -1
- package/dist/utils/selector-loader.d.ts +0 -6
- package/dist/utils/selector-loader.d.ts.map +0 -1
- package/dist/utils/selector-loader.js +0 -20
- package/dist/utils/selector-loader.js.map +0 -1
- package/dist/utils/test-data-loader.d.ts +0 -6
- package/dist/utils/test-data-loader.d.ts.map +0 -1
- package/dist/utils/test-data-loader.js +0 -20
- package/dist/utils/test-data-loader.js.map +0 -1
- package/src/utils/feature-finder.ts +0 -33
- package/src/utils/screen-paths.ts +0 -37
- package/src/utils/selector-loader.ts +0 -23
- package/src/utils/test-data-loader.ts +0 -23
|
@@ -120,6 +120,32 @@ Most elements auto-infer from `[Label] type` → `getByRole(type, { name: 'Label
|
|
|
120
120
|
- Same label, nth occurrence → add `--N` suffix
|
|
121
121
|
- Target Name > 30 chars → shorten to 1–3 meaningful words
|
|
122
122
|
|
|
123
|
+
## Dynamic Variables (test-data YAML)
|
|
124
|
+
|
|
125
|
+
Use `{{$var}}` in test-data YAML for values that must be unique per test run. Resolved at **runtime** by `TestDataLoader` — the compiler passes them through unchanged.
|
|
126
|
+
|
|
127
|
+
| Variable | Example | Output |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `{{$timestamp}}` | `"User-{{$timestamp}}"` | `"User-1714000000"` |
|
|
130
|
+
| `{{$uuid}}` | `"{{$uuid}}"` | `"a1b2c3d4-..."` |
|
|
131
|
+
| `{{$random:min:max}}` | `"{{$random:1:100}}"` | `"42"` |
|
|
132
|
+
| `{{$date}}` | `"{{$date}}"` | `"2026-04-24"` |
|
|
133
|
+
| `{{$datetime}}` | `"{{$datetime}}"` | `"2026-04-24T10:30:00.000Z"` |
|
|
134
|
+
|
|
135
|
+
**Rules:**
|
|
136
|
+
- `$timestamp` and `$uuid` → same value across all keys in one `load()` call (stable within a test file)
|
|
137
|
+
- `$random` → unique per occurrence (each key gets a different random)
|
|
138
|
+
- Resolved once at load time → every `get()` returns the same resolved value
|
|
139
|
+
- Use for CRUD flows to avoid data collision between parallel runs
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
# test-data/crud-award.yaml
|
|
143
|
+
award:
|
|
144
|
+
name: "Award-{{$timestamp}}"
|
|
145
|
+
email: "test+{{$uuid}}@example.com"
|
|
146
|
+
score: "{{$random:1:100}}"
|
|
147
|
+
```
|
|
148
|
+
|
|
123
149
|
## Selectors (priority order)
|
|
124
150
|
|
|
125
151
|
| type | value | name | use |
|
|
@@ -138,27 +164,112 @@ Options: `nth` `exact` `scope` `match` `variant` `frame` `contenteditable` `colu
|
|
|
138
164
|
|
|
139
165
|
## Tags
|
|
140
166
|
|
|
167
|
+
### Functional tags (affect code generation)
|
|
168
|
+
|
|
141
169
|
| Tag | Effect |
|
|
142
170
|
|---|---|
|
|
143
|
-
| `@auto` | Standard scenario, ready for automation |
|
|
144
171
|
| `@manual` | Skip in generation |
|
|
145
|
-
| `@smoke` / `@regression` | Test suite grouping |
|
|
146
|
-
| `@critical` | Priority: system unusable if fails (login, auth, core CRUD) |
|
|
147
|
-
| `@high` | Priority: major feature broken (required validation, key business rules) |
|
|
148
|
-
| `@normal` | Priority: degraded experience (UI layout, secondary flows) |
|
|
149
|
-
| `@low` | Priority: minor/cosmetic (tooltips, hover states, empty states) |
|
|
150
172
|
| `@auth:role` | Use auth storage state for role |
|
|
151
173
|
| `@no-auth` | Disable inherited auth |
|
|
152
174
|
| `@steps:name` | Define reusable step block (base scenario) |
|
|
153
175
|
| `@extend:name` | Prepend Given→When from @steps block (skip Then) |
|
|
154
|
-
| `@cleanup:overlay` | Auto-cleanup: dismiss dialogs/overlays after each test (
|
|
155
|
-
| `@cleanup:forms` | Auto-cleanup: clear form fields after each test (
|
|
156
|
-
| `@cleanup:scroll` | Auto-cleanup: scroll to top after each test (
|
|
157
|
-
| `@cleanup:storage` | Auto-cleanup: clear sessionStorage after each test (
|
|
176
|
+
| `@cleanup:overlay` | Auto-cleanup: dismiss dialogs/overlays after each test (cleanupPage) |
|
|
177
|
+
| `@cleanup:forms` | Auto-cleanup: clear form fields after each test (cleanupPage) |
|
|
178
|
+
| `@cleanup:scroll` | Auto-cleanup: scroll to top after each test (cleanupPage) |
|
|
179
|
+
| `@cleanup:storage` | Auto-cleanup: clear sessionStorage after each test (cleanupPage) |
|
|
158
180
|
| `@screenshot:on-failure` | Auto-capture screenshot when test fails (base.ts fixture) |
|
|
181
|
+
| `@parallel` | Opt-out: fresh page per test instead of serial default (for independent scenarios) |
|
|
159
182
|
| `@beforeAll` | Hook: runs once before all tests → `test.beforeAll()` |
|
|
160
183
|
| `@afterEach` | Hook: runs after each test → `test.afterEach()` (custom cleanup) |
|
|
161
184
|
| `@afterAll` | Hook: runs once after all tests → `test.afterAll()` |
|
|
185
|
+
| `@flow` | Mark feature as E2E flow (cross-screen testing) |
|
|
186
|
+
|
|
187
|
+
### Pass-through tags (filter at runtime via Playwright --grep)
|
|
188
|
+
|
|
189
|
+
Any tag not listed above passes through to Playwright `{ tag: [...] }`. Feature-level tags inherit to all scenarios.
|
|
190
|
+
|
|
191
|
+
| Tag | Purpose |
|
|
192
|
+
|---|---|
|
|
193
|
+
| `@smoke` | Quick sanity check — run after every deploy |
|
|
194
|
+
| `@regression` | Full test suite — run nightly or before release |
|
|
195
|
+
| `@critical` | Priority: system unusable if fails (login, auth, core CRUD) |
|
|
196
|
+
| `@high` | Priority: major feature broken (required validation, key business rules) |
|
|
197
|
+
| `@normal` | Priority: degraded experience (UI layout, secondary flows) |
|
|
198
|
+
| `@low` | Priority: minor/cosmetic (tooltips, hover states, empty states) |
|
|
199
|
+
| `@auto` | Standard scenario, ready for automation |
|
|
200
|
+
| Any custom | e.g., `@sprint-42`, `@team-payment` — any tag works |
|
|
201
|
+
|
|
202
|
+
**Run filtered:**
|
|
203
|
+
```bash
|
|
204
|
+
npx playwright test --grep "@smoke" # only smoke tests
|
|
205
|
+
npx playwright test --grep "@critical" # only critical priority
|
|
206
|
+
npx playwright test --grep "@smoke|@critical" # smoke OR critical
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Serial vs Parallel (test execution mode)
|
|
210
|
+
|
|
211
|
+
**Default: serial** — `test.describe.serial()` with shared page. Background runs once in `beforeAll`. Fail → skip remaining.
|
|
212
|
+
|
|
213
|
+
**`@parallel` opt-out** — `test.describe()` with fresh page per test. Background runs as `beforeEach`. Use when scenarios are truly independent (validation rules, permission tests).
|
|
214
|
+
|
|
215
|
+
| Mode | Generated | Page | Background | On fail |
|
|
216
|
+
|---|---|---|---|---|
|
|
217
|
+
| Serial (default) | `test.describe.serial()` | Shared | `beforeAll` (1 goto) | Skip remaining |
|
|
218
|
+
| `@parallel` | `test.describe()` | Fresh per test | `beforeEach` (N goto) | Continue |
|
|
219
|
+
|
|
220
|
+
**`@parallel` is required** when a feature has multiple auth groups (e.g., `@auth:user` + `@no-auth` scenarios). Serial mode uses one shared browser context and cannot mix auth roles. The compiler will error if `@parallel` is missing in this case.
|
|
221
|
+
|
|
222
|
+
### `@flow` tag (E2E cross-screen testing)
|
|
223
|
+
|
|
224
|
+
`@flow` marks a feature as a **flow** — an E2E journey spanning multiple screens. Flows live in `qa/flows/<name>/` with their own selectors, test-data, and requirements.
|
|
225
|
+
|
|
226
|
+
**Key differences from screen tests:**
|
|
227
|
+
|
|
228
|
+
| Aspect | Screen (`qa/screens/`) | Flow (`qa/flows/`) |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| Scope | Single page | Multiple pages |
|
|
231
|
+
| Selectors | `[Element]` → own YAML | `[Screen:Element]` → own YAML (namespaced) |
|
|
232
|
+
| Test data | `{{variable}}` | `{{phase.variable}}` (namespaced by phase) |
|
|
233
|
+
| Tag | `@auto` / `@smoke` etc. | `@flow` (required at feature level) |
|
|
234
|
+
| Multi-domain | N/A | Absolute URL in selector `path:` skips baseURL |
|
|
235
|
+
|
|
236
|
+
**Selector namespace format:** `[Screen:Element]` where colon separates screen prefix from element name. The YAML key is `"screen:element"` (quoted, lowercase).
|
|
237
|
+
|
|
238
|
+
```gherkin
|
|
239
|
+
# Feature file
|
|
240
|
+
When User fill [Login:Email] field with {{login.email}}
|
|
241
|
+
And User click [Login:Submit] button
|
|
242
|
+
Then User see [Dashboard] page
|
|
243
|
+
When User click [Dashboard:Awards] link
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
# selectors.yaml — keys are namespaced, quoted due to colon
|
|
248
|
+
"login:email":
|
|
249
|
+
type: 'testid'
|
|
250
|
+
value: 'email-input'
|
|
251
|
+
|
|
252
|
+
"login:submit":
|
|
253
|
+
type: 'role'
|
|
254
|
+
value: 'button'
|
|
255
|
+
name: 'Login'
|
|
256
|
+
|
|
257
|
+
dashboard:
|
|
258
|
+
type: 'page'
|
|
259
|
+
value: '/dashboard'
|
|
260
|
+
|
|
261
|
+
"dashboard:awards":
|
|
262
|
+
type: 'role'
|
|
263
|
+
value: 'link'
|
|
264
|
+
name: 'Awards'
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Flow structure:**
|
|
268
|
+
- `Background:` — set starting page only (e.g., `Given User is on [Login] page`)
|
|
269
|
+
- Each `Scenario:` — one phase/step of the flow (login, navigate, submit, etc.)
|
|
270
|
+
- Page navigation between scenarios uses `[Screen] page` references
|
|
271
|
+
|
|
272
|
+
**CLI:** `sungen add-flow --flow <name>`, `sungen generate --flow <name>`, `sungen generate --all` (includes flows)
|
|
162
273
|
|
|
163
274
|
### @extend behavior
|
|
164
275
|
|
|
@@ -185,6 +296,7 @@ Options: `nth` `exact` `scope` `match` `variant` `frame` `contenteditable` `colu
|
|
|
185
296
|
| Missing target type | `fill [email] with {{v}}` | `fill [email] field with {{v}}` |
|
|
186
297
|
| Background with scope | `Background: ... And User is on [X] dialog` | Use `@steps` + `@extend` for scope-dependent flows |
|
|
187
298
|
| `is on` after When | `When ... And User is on [X] dialog` | `And User see [X] dialog` or separate Given |
|
|
299
|
+
| Literal URL navigate | `User navigate to "/dashboard"` | `User is on [Dashboard] page` (add page selector in `selectors.yaml`) |
|
|
188
300
|
|
|
189
301
|
## Background vs @steps/@extend
|
|
190
302
|
|
|
@@ -24,6 +24,28 @@ Run tests in priority waves — catch fundamental issues early, fix critical pat
|
|
|
24
24
|
|
|
25
25
|
If existing selectors already cover the feature file, **skip Phase 0** and go straight to compile + Phase 1.
|
|
26
26
|
|
|
27
|
+
### Flow Mode: Screen Selector Reference
|
|
28
|
+
|
|
29
|
+
When running Phase 0 for a **flow** (`qa/flows/<name>/`), check existing screen selectors first before snapshotting live pages. Screen selectors are already verified and proven — reuse them to save time and reduce errors.
|
|
30
|
+
|
|
31
|
+
**Steps (before the standard Phase 0 steps):**
|
|
32
|
+
|
|
33
|
+
1. **Parse screen references**: read the `.feature` file for `[Screen:Element]` references. Group by screen name (e.g., `Login`, `Awards`, `Dashboard`).
|
|
34
|
+
2. **For each referenced screen**, check `qa/screens/<screen>/selectors/<screen>.yaml`:
|
|
35
|
+
- **If exists** → copy matching entries to the flow's `selectors.yaml`, remapping keys to namespace format:
|
|
36
|
+
- Screen key `submit` with screen `login` → flow key `"login:submit"`
|
|
37
|
+
- Screen key `email-field` with screen `login` → flow key `"login:email-field"`
|
|
38
|
+
- Preserve the full selector definition (type, value, name, etc.)
|
|
39
|
+
- Mark these entries as **verified** (no `@needs-live-verify` comment needed)
|
|
40
|
+
- **If not found** → add this screen to the "needs live snapshot" list
|
|
41
|
+
3. **Elements not found in any screen selector** → also added to the "needs live snapshot" list
|
|
42
|
+
4. **If "needs live snapshot" list is empty** → Phase 0 screen-reference covered everything, skip to compile
|
|
43
|
+
5. **If "needs live snapshot" list is non-empty** → continue with the standard Phase 0 steps below, but only generate selectors for the missing elements (don't re-snapshot elements already copied from screens)
|
|
44
|
+
|
|
45
|
+
**Merge rule**: screen-referenced entries take priority over provisional (Figma-sourced) entries. If an element was previously generated from Figma with `@needs-live-verify`, the screen-verified entry replaces it.
|
|
46
|
+
|
|
47
|
+
**Important**: flow selectors remain private — they live in the flow's own YAML file. This is just initialization from screen data, not a runtime dependency.
|
|
48
|
+
|
|
27
49
|
### Steps
|
|
28
50
|
|
|
29
51
|
1. **Confirm with the user** via `AskUserQuestion`: *"Generate selectors from the live page via Playwright MCP now?"* — offer **Yes, scan live page** / **Skip (use existing selectors.yaml)** / **Cancel**.
|
|
@@ -39,9 +61,10 @@ If existing selectors already cover the feature file, **skip Phase 0** and go st
|
|
|
39
61
|
- Selector priority: follow the table in **Diagnosis & Fix § Step 3** (`testid` > `role`+name > `placeholder` > `label` > `locator` > `text`).
|
|
40
62
|
- Copy names **character-for-character** from the snapshot. Never infer from the Gherkin label.
|
|
41
63
|
- If an element is auto-inferable per `sungen-selector-keys` § Auto-Infer, **omit it** from YAML — keep the file minimal.
|
|
42
|
-
7. **
|
|
43
|
-
8. **
|
|
44
|
-
9. **
|
|
64
|
+
7. **Substring ambiguity check**: for each `role` + `name` selector, check if any other element in the snapshot has a name that **contains** this name as a substring (e.g., `"Đăng ký"` vs `"Đăng ký bằng Google"`). If yes → add `exact: true` to prevent strict mode violation at runtime.
|
|
65
|
+
8. **Merge, don't overwrite**: preserve the page selector and any user-authored entries in `selectors.yaml`. Only add missing keys.
|
|
66
|
+
9. **Show summary + confirm**: list the keys that will be added, ask the user to approve, then write the file.
|
|
67
|
+
10. **Compile**: **Screen**: `sungen generate --screen <screen>`. **Flow**: `sungen generate --flow <flow>`. Then proceed to Phase 1.
|
|
45
68
|
|
|
46
69
|
### Common Phase 0 pitfalls
|
|
47
70
|
|
|
@@ -204,6 +227,7 @@ Array.from(document.querySelectorAll('[data-testid]'))
|
|
|
204
227
|
Common fixes:
|
|
205
228
|
- Name mismatch → copy exact name from snapshot
|
|
206
229
|
- Multiple matches → add `nth` or `exact: true`
|
|
230
|
+
- Substring ambiguity (e.g., `"Submit"` matches `"Submit"` and `"Submit & Continue"`) → add `exact: true`
|
|
207
231
|
- No accessible name → use `testid` or `locator` (CSS)
|
|
208
232
|
- Element in iframe → add `frame` field
|
|
209
233
|
- Dynamic content → use `testid` or structural `role` + `nth`
|
|
@@ -212,7 +236,11 @@ Common fixes:
|
|
|
212
236
|
|
|
213
237
|
Always recompile before re-running:
|
|
214
238
|
```bash
|
|
239
|
+
# Screen
|
|
215
240
|
sungen generate --screen <screen>
|
|
241
|
+
|
|
242
|
+
# Flow
|
|
243
|
+
sungen generate --flow <flow>
|
|
216
244
|
```
|
|
217
245
|
|
|
218
246
|
Then re-run only the current phase's failing tests, not all tests.
|
|
@@ -27,6 +27,51 @@ Copy the text from `[Reference]` as-is, then lowercase. Unicode characters (Viet
|
|
|
27
27
|
4. **Keep all Unicode characters as-is** (Vietnamese diacritics, Japanese, etc.)
|
|
28
28
|
5. **Keys use spaces** (not dots) as word separators
|
|
29
29
|
|
|
30
|
+
## Flow Namespaced Keys
|
|
31
|
+
|
|
32
|
+
In `@flow` features, selectors are namespaced by screen using colon: `[Screen:Element]` → YAML key `"screen:element"` (quoted).
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
[Login:Email] → "login:email"
|
|
36
|
+
[Login:Submit] → "login:submit"
|
|
37
|
+
[Dashboard:Awards] → "dashboard:awards"
|
|
38
|
+
[Awards:Submit] → "awards:submit"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Rules:**
|
|
42
|
+
1. Same lowercase + Unicode rules as standard keys
|
|
43
|
+
2. Colon separates screen prefix from element name
|
|
44
|
+
3. **YAML keys must be quoted** because of the colon: `"login:email":`
|
|
45
|
+
4. Page references don't need prefix: `[Login]` → `login:` (page type)
|
|
46
|
+
5. Prevents duplicate names across screens (e.g., `"login:submit"` vs `"awards:submit"`)
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
# Flow selectors — each screen section namespaced
|
|
50
|
+
login:
|
|
51
|
+
type: 'page'
|
|
52
|
+
value: '/login'
|
|
53
|
+
|
|
54
|
+
"login:email":
|
|
55
|
+
type: 'testid'
|
|
56
|
+
value: 'email-input'
|
|
57
|
+
|
|
58
|
+
"login:submit":
|
|
59
|
+
type: 'role'
|
|
60
|
+
value: 'button'
|
|
61
|
+
name: 'Login'
|
|
62
|
+
|
|
63
|
+
awards:
|
|
64
|
+
type: 'page'
|
|
65
|
+
value: '/awards'
|
|
66
|
+
|
|
67
|
+
"awards:submit":
|
|
68
|
+
type: 'role'
|
|
69
|
+
value: 'button'
|
|
70
|
+
name: 'Submit Award'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Type and nth suffixes still apply:** `"login:submit--button"`, `"awards:item--3"`
|
|
74
|
+
|
|
30
75
|
## Type-Suffixed Keys
|
|
31
76
|
|
|
32
77
|
When the same label is used for different element types, add `--type` suffix:
|
|
@@ -161,6 +161,29 @@ Scenario: Reset filters to default
|
|
|
161
161
|
|
|
162
162
|
For one-time setup/teardown. Most screens don't need these.
|
|
163
163
|
|
|
164
|
+
### `@parallel` — when tests need independent browser state
|
|
165
|
+
|
|
166
|
+
Add `@parallel` at feature level when:
|
|
167
|
+
|
|
168
|
+
1. **Multiple auth groups** (required) — e.g., `@auth:user` + `@no-auth` scenarios. Serial mode uses one shared context and cannot mix auth roles. Compiler will error without this tag.
|
|
169
|
+
2. **Validation-heavy features** (recommended) — each scenario fills forms with different invalid data and needs a clean form. Serial shared page keeps previous test's input.
|
|
170
|
+
|
|
171
|
+
Serial (default) is best for: CRUD flows, sequential user journeys, UI checks on the same page.
|
|
172
|
+
|
|
173
|
+
```gherkin
|
|
174
|
+
@parallel @auth:user
|
|
175
|
+
@cleanup:forms
|
|
176
|
+
Feature: kudos Screen
|
|
177
|
+
|
|
178
|
+
@critical
|
|
179
|
+
Scenario: Send kudos
|
|
180
|
+
...
|
|
181
|
+
|
|
182
|
+
@critical @no-auth
|
|
183
|
+
Scenario: Unauthenticated user is redirected
|
|
184
|
+
...
|
|
185
|
+
```
|
|
186
|
+
|
|
164
187
|
## Output Format
|
|
165
188
|
|
|
166
189
|
**Feature file** — `qa/screens/<screen>/features/<screen>.feature`
|
|
@@ -237,4 +260,73 @@ valid_email: admin@staging.example.com
|
|
|
237
260
|
valid_password: StagingPass456
|
|
238
261
|
```
|
|
239
262
|
|
|
263
|
+
## Flow Test Generation
|
|
264
|
+
|
|
265
|
+
When generating tests for a **flow** (`qa/flows/<name>/`), adapt the strategy:
|
|
266
|
+
|
|
267
|
+
### Structure
|
|
268
|
+
|
|
269
|
+
- **Background** — starting page only: `Given User is on [Login] page`
|
|
270
|
+
- **Scenarios** — each phase of the E2E journey as a separate scenario
|
|
271
|
+
- **Selector refs** — use `[Screen:Element]` namespace format (see `sungen-gherkin-syntax`)
|
|
272
|
+
- **Test data** — namespace by phase: `login.email`, `submission.nominee`
|
|
273
|
+
- **Feature tag** — `@flow` required at feature level
|
|
274
|
+
|
|
275
|
+
### Flow vs Screen Differences
|
|
276
|
+
|
|
277
|
+
| Aspect | Screen | Flow |
|
|
278
|
+
|---|---|---|
|
|
279
|
+
| Section focus | UI patterns per section | Journey phases across screens |
|
|
280
|
+
| Viewpoints | VP-UI, VP-VAL, VP-LOGIC, VP-SEC per section | VP-LOGIC (flow transitions), VP-SEC (auth persistence), VP-VAL (cross-screen data) |
|
|
281
|
+
| Tier 1 focus | Happy path + required validation per section | Happy path through entire flow + auth + key error recovery |
|
|
282
|
+
| Background | Navigate to screen | Navigate to starting page |
|
|
283
|
+
|
|
284
|
+
### Flow-specific scenarios to generate
|
|
285
|
+
|
|
286
|
+
| Category | Examples |
|
|
287
|
+
|---|---|
|
|
288
|
+
| **Happy path** | Complete flow end-to-end with valid data |
|
|
289
|
+
| **Auth persistence** | Auth state maintained across screen transitions |
|
|
290
|
+
| **Error recovery** | Invalid input mid-flow → fix → continue |
|
|
291
|
+
| **Incomplete flow** | User abandons at each phase → state cleanup |
|
|
292
|
+
| **Cross-screen data** | Data entered on screen A visible on screen B |
|
|
293
|
+
|
|
294
|
+
### Output Format (Flow)
|
|
295
|
+
|
|
296
|
+
```gherkin
|
|
297
|
+
@flow @auth:user
|
|
298
|
+
Feature: Award Submission Flow
|
|
299
|
+
|
|
300
|
+
Background:
|
|
301
|
+
Given User is on [Login] page
|
|
302
|
+
|
|
303
|
+
@critical
|
|
304
|
+
Scenario: User login successfully
|
|
305
|
+
When User fill [Login:Email] field with {{login.email}}
|
|
306
|
+
And User fill [Login:Password] field with {{login.password}}
|
|
307
|
+
And User click [Login:Submit] button
|
|
308
|
+
Then User see [Dashboard] page
|
|
309
|
+
|
|
310
|
+
@critical
|
|
311
|
+
Scenario: User navigates to awards and submits
|
|
312
|
+
When User click [Dashboard:Awards] link
|
|
313
|
+
Then User see [Awards] page
|
|
314
|
+
When User fill [Awards:Nominee] field with {{submission.nominee}}
|
|
315
|
+
And User click [Awards:Submit] button
|
|
316
|
+
Then User see {{success_message}} message
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Test data** — `qa/flows/<name>/test-data/<name>.yaml`, namespaced by phase:
|
|
320
|
+
|
|
321
|
+
```yaml
|
|
322
|
+
login:
|
|
323
|
+
email: "admin@example.com"
|
|
324
|
+
password: "secret123"
|
|
325
|
+
submission:
|
|
326
|
+
nominee: "John Doe"
|
|
327
|
+
success_message: "Award submitted successfully"
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Environment overrides** work the same: `<name>.<env>.yaml` merged at runtime via `SUNGEN_ENV`.
|
|
331
|
+
|
|
240
332
|
**Do NOT generate**: `selectors.yaml` (created during run-test), Playwright code (sungen compiles).
|
|
@@ -89,6 +89,36 @@ Do NOT mark `@manual` when data is visible in snapshot or documented in spec —
|
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
+
## Flow Review Additions
|
|
93
|
+
|
|
94
|
+
When reviewing a `@flow` feature (`qa/flows/<name>/`), apply standard scoring PLUS these flow-specific checks:
|
|
95
|
+
|
|
96
|
+
### Syntax — additional checks
|
|
97
|
+
- `[Screen:Element]` format used consistently (not mixing bare `[Element]` refs)
|
|
98
|
+
- YAML keys quoted with colon: `"login:submit":` not `login:submit:`
|
|
99
|
+
- `@flow` tag present at feature level
|
|
100
|
+
|
|
101
|
+
### Coverage — additional dimensions
|
|
102
|
+
| Dimension | Pts (from existing 40) | What to check |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| Screen transitions | (part of State transitions) | Each screen-to-screen navigation tested |
|
|
105
|
+
| Auth persistence | (part of Happy paths) | Auth state maintained across transitions |
|
|
106
|
+
| Error recovery mid-flow | (part of Negative cases) | Invalid input at each phase → fix → continue |
|
|
107
|
+
| Cross-screen data | (part of Edge cases) | Data entered on screen A asserted on screen B |
|
|
108
|
+
|
|
109
|
+
### Viewpoint — flow-specific classification
|
|
110
|
+
- **VP-LOGIC** — screen transitions, navigation flow, auth persistence
|
|
111
|
+
- **VP-VAL** — cross-screen data consistency, form data carried across pages
|
|
112
|
+
- **VP-SEC** — auth state across redirects, permission changes mid-flow
|
|
113
|
+
- VP-UI is typically minimal in flows (focus on functionality over layout)
|
|
114
|
+
|
|
115
|
+
### Checklist — flow-specific items
|
|
116
|
+
11. **Missing screen transitions** — flow visits 4 screens but only 2 transitions tested? Add missing
|
|
117
|
+
12. **Orphan scenarios** — scenario doesn't connect to previous/next phase? Flag broken flow
|
|
118
|
+
13. **Selector namespace consistency** — mixing `[Submit]` and `[Login:Submit]` in same flow? Standardize
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
92
122
|
## Output Format
|
|
93
123
|
|
|
94
124
|
```markdown
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sungen-add-flow
|
|
3
|
+
description: 'Add a new Sungen flow — scaffolds directories for E2E cross-screen testing, helps fill spec.md, and can capture visuals via the capture skills'
|
|
4
|
+
argument-hint: '[flow-name] [--path <start-url>]'
|
|
5
|
+
agent: 'agent'
|
|
6
|
+
tools: [vscode, execute, read, agent, edit, search, todo]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Input**: Flow name and optional starting URL (e.g., `/sungen-add-flow award-submission --path /login`).
|
|
10
|
+
|
|
11
|
+
You are adding a new Sungen flow for E2E cross-screen test generation.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
- **flow** — ${input:flow:flow name (e.g., award-submission, user-onboarding)}
|
|
16
|
+
- **--path \<url\>** — starting page URL path (default: `/login`)
|
|
17
|
+
- **--description \<text\>** — flow description (optional)
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
### 1. Scaffold the flow
|
|
22
|
+
|
|
23
|
+
Run with #tool:terminal:
|
|
24
|
+
```bash
|
|
25
|
+
sungen add-flow --flow ${input:flow} --path ${input:path}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This creates:
|
|
29
|
+
```
|
|
30
|
+
qa/flows/${input:flow}/
|
|
31
|
+
├── features/${input:flow}.feature # Gherkin with @flow tag, Background, sample scenarios
|
|
32
|
+
├── selectors/${input:flow}.yaml # Namespaced keys: "login:submit", "awards:submit"
|
|
33
|
+
├── test-data/${input:flow}.yaml # Namespaced data: login.email, submission.nominee
|
|
34
|
+
└── requirements/
|
|
35
|
+
├── spec.md # Flow specification
|
|
36
|
+
└── ui/ # Screenshots, mockups
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 1a. Identify the screens in the flow
|
|
40
|
+
|
|
41
|
+
Ask the user: "Which screens does this flow visit, in order? (e.g., login → dashboard → award-form → confirmation)"
|
|
42
|
+
|
|
43
|
+
Record the screen list — you will need it for:
|
|
44
|
+
- Filling `spec.md` (Step 3)
|
|
45
|
+
- Suggesting `[Screen:Element]` namespace prefixes
|
|
46
|
+
- Capturing visuals per screen (Step 2)
|
|
47
|
+
|
|
48
|
+
### 2. Capture visual source
|
|
49
|
+
|
|
50
|
+
Ask: *"Pick a visual source for this flow's screens:"*
|
|
51
|
+
- **Figma designs** (Recommended for pre-launch) — invoke `sungen-capture-figma` skill for each screen
|
|
52
|
+
- **Live page scan** (dev/staging is up) — invoke `sungen-capture-live` skill for each screen URL
|
|
53
|
+
- **Local images** — invoke `sungen-capture-local` skill to load from `requirements/ui/`
|
|
54
|
+
- **Skip** — user will drop images manually into `requirements/ui/` later
|
|
55
|
+
|
|
56
|
+
Each capture skill writes outputs into `qa/flows/${input:flow}/requirements/ui/` and reports back a summary. Do not inline capture logic here — always delegate to the skill.
|
|
57
|
+
|
|
58
|
+
### 3. Fill spec.md
|
|
59
|
+
|
|
60
|
+
Ask: *"Fill `spec.md` now? (You can reference the captured visuals)"* — offer **Yes, fill now (Recommended)** / **Skip, fill later**.
|
|
61
|
+
|
|
62
|
+
If yes → open `qa/flows/${input:flow}/requirements/spec.md` and help the user fill:
|
|
63
|
+
- **Screens list** — ordered list of screens with URL paths
|
|
64
|
+
- **Flow steps** — what the user does at each screen
|
|
65
|
+
- **Transitions** — what triggers navigation between screens
|
|
66
|
+
- **Business rules** — cross-screen validation, state that persists
|
|
67
|
+
- **Test data** — what data is entered at each screen
|
|
68
|
+
|
|
69
|
+
Reference the captured visuals from Step 2 to suggest field names, form elements, and UI states.
|
|
70
|
+
|
|
71
|
+
### 4. Next steps
|
|
72
|
+
|
|
73
|
+
Tell the user what was created and offer next steps:
|
|
74
|
+
|
|
75
|
+
- **`/sungen-create-test ${input:flow}`** — Generate test scenarios for the flow (Recommended)
|
|
76
|
+
- **Done for now** — I'll come back later
|
|
77
|
+
|
|
78
|
+
## Key Rules
|
|
79
|
+
|
|
80
|
+
- Flows are **independent** from screens — own selectors, own test-data
|
|
81
|
+
- Selectors use `[Screen:Element]` namespace format with colon
|
|
82
|
+
- YAML keys must be **quoted** due to colon: `"login:submit":`
|
|
83
|
+
- Test data namespaced by phase: `login.email`, `submission.nominee`
|
|
84
|
+
- `@flow` tag required at feature level
|
|
85
|
+
- `Background:` should only contain the starting page navigation
|
|
86
|
+
- Each scenario = one phase of the journey
|
|
@@ -6,7 +6,7 @@ agent: 'agent'
|
|
|
6
6
|
tools: [vscode, execute, read, agent, edit, search, web, browser, todo, 'playwright/*']
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
**Input**: Screen name (e.g., `/sungen-create-test admin-users`).
|
|
9
|
+
**Input**: Screen or flow name (e.g., `/sungen-create-test admin-users`).
|
|
10
10
|
|
|
11
11
|
## Role
|
|
12
12
|
|
|
@@ -14,13 +14,16 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
17
|
-
- **
|
|
17
|
+
- **name** — ${input:name:screen or flow name (e.g., login, award-submission)}
|
|
18
|
+
|
|
19
|
+
**Auto-detect context**: check if `qa/flows/<name>/` exists → flow mode (base path: `qa/flows/<name>/`). Else check `qa/screens/<name>/` → screen mode (base path: `qa/screens/<name>/`).
|
|
18
20
|
|
|
19
21
|
## Steps
|
|
20
22
|
|
|
21
|
-
1. Verify `qa/
|
|
23
|
+
1. **Flow**: Verify `qa/flows/${input:name}/` exists. If not → `/sungen-add-flow` first.
|
|
24
|
+
**Screen**: Verify `qa/screens/${input:name}/` exists. If not → `/sungen-add-screen` first.
|
|
22
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.
|
|
23
|
-
3. **Read requirements & resolve visual source** — check
|
|
26
|
+
3. **Read requirements & resolve visual source** — check `<base>/${input:name}/requirements/`:
|
|
24
27
|
- If `spec.md` exists → read it as PRIMARY source (sections, fields, validation rules, business rules, states).
|
|
25
28
|
- If `test-viewpoint.md` exists → read it. If it only contains HTML comments (scaffold template), ask:
|
|
26
29
|
- **1) Fill test-viewpoint.md first** — identify edge cases, known issues, and design decisions before generating tests
|
|
@@ -30,7 +33,7 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
30
33
|
1. If `spec_figma.md` exists → read it as Figma supplement (PAT flow already completed during `add-screen`). Do NOT call any `mcp__figma__*` tool.
|
|
31
34
|
2. If `ui/` has images (`.png`, `.jpg`, etc.) → read them for visual context (layout, element positions, states).
|
|
32
35
|
3. If neither exists → ask: *"No visual source found. Pick one:"*
|
|
33
|
-
- **1) Figma PAT** — ask for URL, run `sungen add --screen ${input:
|
|
36
|
+
- **1) Figma PAT** — ask for URL, run `sungen add --screen ${input:name} --figma '<url>'`, then invoke `sungen-figma-source` skill
|
|
34
37
|
- **2) Figma MCP** — invoke `sungen-capture-figma` skill
|
|
35
38
|
- **3) Live page scan** — invoke `sungen-capture-live` skill
|
|
36
39
|
- **4) Skip** — generate from spec.md only
|
|
@@ -39,13 +42,13 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
39
42
|
|
|
40
43
|
Summarize what you found in requirements and present to the user.
|
|
41
44
|
|
|
42
|
-
4.
|
|
43
|
-
5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills.
|
|
45
|
+
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
|
+
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.
|
|
44
47
|
6. Show summary and offer next steps:
|
|
45
48
|
|
|
46
|
-
- **`/sungen-review ${input:
|
|
47
|
-
- **`/sungen-run-test ${input:
|
|
48
|
-
- **`/sungen-create-test ${input:
|
|
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
|
|
49
52
|
- **Done for now** — I'll come back later
|
|
50
53
|
|
|
51
54
|
**No selectors.yaml** — selectors are generated during `/sungen-run-test`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-delivery
|
|
3
3
|
description: 'Export Gherkin scenarios + Playwright results to CSV test case file for QA delivery.'
|
|
4
|
-
argument-hint: "[
|
|
4
|
+
argument-hint: "[name...] (omit for all screens and flows)"
|
|
5
5
|
tools: [read, execute, edit, vscode/askQuestions]
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -11,9 +11,9 @@ You are a **QA Test Delivery Engineer**. Your job is to invoke the deterministic
|
|
|
11
11
|
|
|
12
12
|
## Parameters
|
|
13
13
|
|
|
14
|
-
Parse **
|
|
15
|
-
- If empty → CLI will process **all** screens in `qa/screens/`
|
|
16
|
-
- If provided → pass them through to the CLI
|
|
14
|
+
Parse **names** from `$ARGUMENTS`:
|
|
15
|
+
- If empty → CLI will process **all** screens in `qa/screens/` and flows in `qa/flows/`
|
|
16
|
+
- If provided → pass them through to the CLI (auto-detects screen vs flow per name)
|
|
17
17
|
|
|
18
18
|
## Steps
|
|
19
19
|
|
|
@@ -22,28 +22,29 @@ Parse **screens** from `$ARGUMENTS`:
|
|
|
22
22
|
Run via Bash (single command, no extra parsing):
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npx sungen delivery <
|
|
25
|
+
npx sungen delivery <names>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
- If no
|
|
29
|
-
- If
|
|
28
|
+
- If no args → just run `npx sungen delivery` (exports all screens + flows)
|
|
29
|
+
- If args → pass them as positional arguments (auto-detects screen vs flow)
|
|
30
30
|
|
|
31
31
|
The CLI handles:
|
|
32
|
-
- Scope detection (all screens vs specific)
|
|
32
|
+
- Scope detection (all screens + flows vs specific names)
|
|
33
|
+
- Auto-detect: `qa/flows/<name>/` → flow, `qa/screens/<name>/` → screen
|
|
33
34
|
- Pre-flight source checks with colorful output
|
|
34
35
|
- Parsing `.feature`, `.spec.ts`, `test-data.yaml`, `test-results/results.json`
|
|
35
|
-
- Generating CSV at `qa/deliverables/<
|
|
36
|
+
- Generating CSV at `qa/deliverables/<name>-testcases.csv`
|
|
36
37
|
- Printing summary table
|
|
37
38
|
|
|
38
39
|
### 2. Handle pre-flight failures (if CLI exits non-zero)
|
|
39
40
|
|
|
40
|
-
If the CLI exits with blocking issues, it will have already printed a clear table showing exactly what's missing per
|
|
41
|
+
If the CLI exits with blocking issues, it will have already printed a clear table showing exactly what's missing per target.
|
|
41
42
|
|
|
42
43
|
Use `AskUserQuestion` to offer next steps:
|
|
43
44
|
|
|
44
45
|
**Options:**
|
|
45
46
|
- **Fix missing sources** (Recommended) — Print the suggested commands from CLI output and stop. User will run those commands manually, then re-invoke `/sungen:delivery`.
|
|
46
|
-
- **Continue with available
|
|
47
|
+
- **Continue with available targets** — Re-run as `npx sungen delivery <names> --continue-on-missing` to skip targets with blocking issues.
|
|
47
48
|
- **Cancel** — Exit.
|
|
48
49
|
|
|
49
50
|
### 3. Show summary + offer next steps (on success)
|
|
@@ -51,8 +52,8 @@ Use `AskUserQuestion` to offer next steps:
|
|
|
51
52
|
Forward the CLI's summary table to the user verbatim. Then use `AskUserQuestion`:
|
|
52
53
|
|
|
53
54
|
- **Open a specific CSV** — Help user inspect one of the exported files with Read tool.
|
|
54
|
-
- **Run tests to refresh results** — Suggest `/sungen
|
|
55
|
-
- **Export another
|
|
55
|
+
- **Run tests to refresh results** — Suggest `/sungen-run-test <name>` to update test results, then re-run delivery.
|
|
56
|
+
- **Export another target** — User can run `/sungen-delivery <other-name>`.
|
|
56
57
|
- **Done** — Exit.
|
|
57
58
|
|
|
58
59
|
## Important notes
|
|
@@ -65,7 +66,7 @@ Forward the CLI's summary table to the user verbatim. Then use `AskUserQuestion`
|
|
|
65
66
|
## CLI Reference
|
|
66
67
|
|
|
67
68
|
```
|
|
68
|
-
sungen delivery [
|
|
69
|
+
sungen delivery [names...]
|
|
69
70
|
[--skip-preflight] Skip pre-flight checks (not recommended)
|
|
70
|
-
[--continue-on-missing] Skip
|
|
71
|
+
[--continue-on-missing] Skip targets with blocking misses
|
|
71
72
|
```
|