@sun-asterisk/sungen 2.2.2 → 2.3.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.
- package/README.md +66 -37
- package/dist/cli/commands/update.d.ts +3 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +21 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/index.js +3 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/gherkin-parser/index.d.ts +2 -0
- package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
- package/dist/generators/gherkin-parser/index.js +17 -3
- package/dist/generators/gherkin-parser/index.js.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-accept-action.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-dismiss-action.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/alert-fill-action.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/alert-text-assertion.hbs +8 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/attribute-assertion.hbs +3 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/have-value-assertion.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +12 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +12 -1
- package/dist/generators/test-generator/patterns/assertion-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/assertion-patterns.js +95 -57
- package/dist/generators/test-generator/patterns/assertion-patterns.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts +9 -0
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +32 -0
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.d.ts +1 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.js +56 -1
- package/dist/generators/test-generator/patterns/interaction-patterns.js.map +1 -1
- package/dist/generators/test-generator/patterns/table-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/table-patterns.js +8 -5
- package/dist/generators/test-generator/patterns/table-patterns.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +16 -0
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/orchestrator/ai-rules-updater.d.ts +13 -0
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -0
- package/dist/orchestrator/ai-rules-updater.js +157 -0
- package/dist/orchestrator/ai-rules-updater.js.map +1 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +2 -27
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/screen-manager.d.ts +1 -0
- package/dist/orchestrator/screen-manager.d.ts.map +1 -1
- package/dist/orchestrator/screen-manager.js +70 -3
- package/dist/orchestrator/screen-manager.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +18 -9
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-make-tc.md +11 -4
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-make-test.md +11 -6
- package/dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +22 -9
- package/dist/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +170 -24
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +118 -12
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +16 -2
- package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +124 -71
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -5
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-make-tc.md +12 -4
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-make-test.md +11 -6
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +22 -9
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +170 -24
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +93 -12
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +16 -2
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +124 -72
- package/dist/orchestrator/templates/readme.md +13 -8
- package/package.json +1 -1
- package/src/cli/commands/update.ts +18 -0
- package/src/cli/index.ts +3 -1
- package/src/generators/gherkin-parser/index.ts +20 -3
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-accept-action.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-dismiss-action.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/alert-fill-action.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/alert-text-assertion.hbs +8 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/attribute-assertion.hbs +3 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/have-value-assertion.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +12 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +12 -1
- package/src/generators/test-generator/patterns/assertion-patterns.ts +106 -65
- package/src/generators/test-generator/patterns/index.ts +41 -0
- package/src/generators/test-generator/patterns/interaction-patterns.ts +58 -1
- package/src/generators/test-generator/patterns/table-patterns.ts +8 -5
- package/src/generators/test-generator/utils/selector-resolver.ts +16 -0
- package/src/orchestrator/ai-rules-updater.ts +139 -0
- package/src/orchestrator/project-initializer.ts +2 -32
- package/src/orchestrator/screen-manager.ts +72 -3
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +18 -9
- package/src/orchestrator/templates/ai-instructions/claude-cmd-make-tc.md +11 -4
- package/src/orchestrator/templates/ai-instructions/claude-cmd-make-test.md +11 -6
- package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +22 -9
- package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +170 -24
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +118 -12
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +16 -2
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +124 -71
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -5
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-make-tc.md +12 -4
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-make-test.md +11 -6
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +22 -9
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +170 -24
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +93 -12
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +16 -2
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +124 -72
- package/src/orchestrator/templates/readme.md +13 -8
- package/docs/gherkin standards/gherkin-core-standard.md +0 -428
- package/docs/gherkin standards/gherkin-core-standard.vi.md +0 -513
- package/docs/gherkin-dictionary.md +0 -1071
- package/docs/makeauth.md +0 -225
|
@@ -33,6 +33,46 @@ For options 1 and 2:
|
|
|
33
33
|
For option 3:
|
|
34
34
|
- Overwrite both `.feature` and `test-data.yaml` completely
|
|
35
35
|
|
|
36
|
+
### Requirements-Driven Generation
|
|
37
|
+
|
|
38
|
+
When `qa/screens/<screen>/requirements/` exists, use it as the **primary source** for test case generation. This produces higher quality tests because requirements contain exact validation messages, field constraints, business rules, and states.
|
|
39
|
+
|
|
40
|
+
#### Reading Requirements
|
|
41
|
+
|
|
42
|
+
1. **`spec.md`** (primary) — structured screen specification:
|
|
43
|
+
- **Sections** → map directly to test case sections
|
|
44
|
+
- **Fields table** → generate boundary value tests (min/max constraints), required field tests, format tests
|
|
45
|
+
- **Validation Rules table** → generate exact assertion tests using the error messages as `{{test_data}}` values
|
|
46
|
+
- **Actions table** → generate interaction tests (click, submit, navigate)
|
|
47
|
+
- **States table** → generate state transition tests (loading, error, success, disabled)
|
|
48
|
+
- **Business Rules** → generate logic tests (limits, permissions, conditional behavior)
|
|
49
|
+
- **Accessibility** → generate tab-order and aria tests
|
|
50
|
+
|
|
51
|
+
2. **`ui/`** (supplementary) — screenshots, mockups, design images:
|
|
52
|
+
- Read images to understand layout, element positions, visual states
|
|
53
|
+
- Cross-reference with spec.md — identify elements visible in UI but missing from spec
|
|
54
|
+
- Use for UI/UX viewpoint tests (element visibility, placement, responsive)
|
|
55
|
+
|
|
56
|
+
3. **`notes.md`** (supplementary) — free-form edge cases, decisions, known issues:
|
|
57
|
+
- Extract edge cases → add to test coverage
|
|
58
|
+
- Flag known issues → add TODO scenarios
|
|
59
|
+
|
|
60
|
+
#### How Requirements Improve Each Viewpoint
|
|
61
|
+
|
|
62
|
+
| Viewpoint | Without Requirements | With Requirements |
|
|
63
|
+
|-----------|---------------------|-------------------|
|
|
64
|
+
| **UI/UX** | "see [Field] is visible" (generic) | "see [Field] field" + verify label, placeholder, default from spec |
|
|
65
|
+
| **Validation** | "submit empty → see error" (vague) | "submit empty email → see {{email_required_error}}" with exact message from spec |
|
|
66
|
+
| **Logic** | Based on observed page behavior | Business rules drive specific tests (lockout after N attempts, session expiry) |
|
|
67
|
+
| **Security** | Generic injection tests | Role-based tests from auth requirements, permission-specific scenarios |
|
|
68
|
+
|
|
69
|
+
#### Merging Requirements + Live Page
|
|
70
|
+
|
|
71
|
+
If the user also explores the live page:
|
|
72
|
+
- **Verify** spec.md against actual page — flag mismatches (e.g., field in spec but not on page)
|
|
73
|
+
- **Supplement** — discover elements on page not in spec (e.g., footer links, tooltips)
|
|
74
|
+
- **Exact text** — capture actual placeholder text, button labels, error messages from live page and update test-data accordingly
|
|
75
|
+
|
|
36
76
|
### Page Exploration & Auth
|
|
37
77
|
|
|
38
78
|
Use Playwright MCP to explore the live page. If the page requires authentication:
|
|
@@ -55,26 +95,7 @@ Use Playwright MCP to explore the live page. If the page requires authentication
|
|
|
55
95
|
|
|
56
96
|
#### Detail screens with dynamic IDs
|
|
57
97
|
|
|
58
|
-
For screens like `/admin/users/:id` or `/products/:slug
|
|
59
|
-
1. Navigate to the **list page** first via MCP browser to find a real record ID
|
|
60
|
-
2. Use that ID in the page selector value
|
|
61
|
-
3. Use `User is on [X] page` — sungen resolves the path from the selector
|
|
62
|
-
|
|
63
|
-
```yaml
|
|
64
|
-
# selectors.yaml — full path with real ID (generated during make-test)
|
|
65
|
-
user detail:
|
|
66
|
-
type: 'page'
|
|
67
|
-
value: '/admin/users/de42d800-0f5a-490e-9dcf-344fedbd34a5'
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
```gherkin
|
|
71
|
-
Scenario: VP-UI-001 User detail displays name
|
|
72
|
-
Given User is on [User Detail] page
|
|
73
|
-
And User wait for [User Name] heading is visible
|
|
74
|
-
Then User see [User Name] heading with {{user_name}}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Note: the selector uses a hardcoded ID from the live page. If the record is deleted, update the ID in `selectors.yaml`.
|
|
98
|
+
For screens like `/admin/users/:id` or `/products/:slug`, write Gherkin normally (`User is on [User Detail] page`). The real ID will be resolved during `/sungen-make-test` when selectors are generated from the live page. See `sungen-selector-fix` skill for details.
|
|
78
99
|
|
|
79
100
|
### Section-Focused Approach
|
|
80
101
|
|
|
@@ -113,72 +134,90 @@ For each selected section, generate **20+ scenarios per applicable viewpoint**.
|
|
|
113
134
|
|
|
114
135
|
Present a test plan summary and wait for user confirmation before generating files.
|
|
115
136
|
|
|
137
|
+
### Assertion Quality Rules
|
|
138
|
+
|
|
139
|
+
**CRITICAL** — these rules prevent shallow, low-value test cases:
|
|
140
|
+
|
|
141
|
+
1. **NEVER use `is visible`** — `User see [T] type` already asserts visibility. Writing `is visible` is redundant noise. Only use `is hidden` to assert something is NOT shown.
|
|
142
|
+
2. **Group related assertions** — one scenario can have 3-7 `Then/And` steps. Don't waste a whole scenario on one element. Group elements that verify the same concern.
|
|
143
|
+
3. **Assert content, not just existence** — verify values, text, states, not just "it's there":
|
|
144
|
+
- `User see [Title] heading with {{page_title}}` — verify text
|
|
145
|
+
- `User see [Email] field with {{default_email}}` — verify default value
|
|
146
|
+
- `User see [Submit] button is disabled` — verify state
|
|
147
|
+
- `User see [Error] message with {{error_text}}` — verify exact error
|
|
148
|
+
4. **Every assertion must have test value** — if you write `User see [T] type`, ask: what EXACTLY should the user see? Add `with {{value}}` or `is state` whenever the expected content/state is known.
|
|
149
|
+
|
|
150
|
+
**Bad** (shallow — just checks existence):
|
|
151
|
+
```gherkin
|
|
152
|
+
Scenario: VP-UI-001 Email field is visible
|
|
153
|
+
Given User is on [Login] page
|
|
154
|
+
Then User see [Email] field is visible
|
|
155
|
+
|
|
156
|
+
Scenario: VP-UI-002 Password field is visible
|
|
157
|
+
Given User is on [Login] page
|
|
158
|
+
Then User see [Password] field is visible
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Good** (rich — verifies content, states, groups related checks):
|
|
162
|
+
```gherkin
|
|
163
|
+
Scenario: VP-UI-001 Login form displays all fields with correct defaults
|
|
164
|
+
Given User is on [Login] page
|
|
165
|
+
Then User see [Login] heading with {{login_title}}
|
|
166
|
+
And User see [Email] field
|
|
167
|
+
And User see [Password] field
|
|
168
|
+
And User see [Remember me] checkbox is unchecked
|
|
169
|
+
And User see [Submit] button is enabled
|
|
170
|
+
And User see [Forgot password] link
|
|
171
|
+
```
|
|
172
|
+
|
|
116
173
|
### Viewpoint Categories
|
|
117
174
|
|
|
118
175
|
| VP Category | Description |
|
|
119
176
|
|---|---|
|
|
120
|
-
| **UI/UX** | Default appearance,
|
|
121
|
-
| **Validation** | Input validation, error messages, edge cases. **
|
|
177
|
+
| **UI/UX** | Default appearance, default values/text, default states. Group related elements per scenario. |
|
|
178
|
+
| **Validation** | Input validation, error messages, edge cases. **Assert exact error messages via `User see [T] with {{error_var}}`** — store texts in test-data.yaml. |
|
|
122
179
|
| **Logic** | Business logic, interactions, state changes |
|
|
123
180
|
| **Security** | Auth guards, injection, permission checks |
|
|
124
181
|
|
|
125
182
|
### Coverage Checklist per Section Pattern
|
|
126
183
|
|
|
127
|
-
Apply the relevant checklist based on the section pattern:
|
|
128
|
-
|
|
129
184
|
#### Form sections
|
|
130
|
-
- **UI/UX**: All fields
|
|
131
|
-
- **Validation**: Empty submit
|
|
132
|
-
- **
|
|
133
|
-
- **
|
|
134
|
-
- **Security**: CSRF protection, unauthorized submit, role-based field visibility, input sanitization
|
|
185
|
+
- **UI/UX**: All fields + labels + default values in 1-2 grouped scenarios. Default states (button enabled/disabled, checkbox unchecked). Placeholder text via `with {{placeholder}}`.
|
|
186
|
+
- **Validation**: Empty submit → verify all error messages. Each required field empty individually → verify specific error. Invalid formats → verify specific error. Boundary values (min/max length). Special chars, unicode, XSS, SQL injection.
|
|
187
|
+
- **Logic**: Successful submit → verify success state/redirect. Edit existing → verify pre-filled values. Cancel → verify form resets. Field dependencies (show/hide).
|
|
188
|
+
- **Security**: Unauthorized submit, role-based field visibility, input sanitization
|
|
135
189
|
|
|
136
190
|
#### Data Table sections
|
|
137
|
-
- **UI/UX**: All
|
|
138
|
-
- **
|
|
139
|
-
- **
|
|
140
|
-
- **Security**: Cannot access other users' data, action permissions per role, data not exposed in DOM
|
|
191
|
+
- **UI/UX**: All column headers in one scenario (`User see [Col] column in [Table] table`). Row data displays with correct values. Empty state message. Action buttons per row.
|
|
192
|
+
- **Logic**: Sort ascending/descending. Filter by column. Search. Row actions (edit/delete/view). Bulk select + action.
|
|
193
|
+
- **Security**: Action permissions per role
|
|
141
194
|
|
|
142
195
|
#### Search & Filter sections
|
|
143
|
-
- **UI/UX**: Search field
|
|
144
|
-
- **Validation**: Empty search, special chars,
|
|
145
|
-
- **Logic**: Apply single filter, combine
|
|
146
|
-
- **Security**: Injection via search
|
|
196
|
+
- **UI/UX**: Search field + filter buttons + clear button states in one scenario
|
|
197
|
+
- **Validation**: Empty search, special chars, injection, long text, unicode
|
|
198
|
+
- **Logic**: Apply/clear single filter, combine filters, no results state with message
|
|
199
|
+
- **Security**: Injection via search/filter params
|
|
147
200
|
|
|
148
201
|
#### Pagination sections
|
|
149
|
-
- **UI/UX**: Page indicator
|
|
150
|
-
- **Logic**:
|
|
151
|
-
- **Security**: Filters persist across pages, search persists, cannot access page beyond max
|
|
202
|
+
- **UI/UX**: Page indicator + button states (previous disabled on page 1, next enabled)
|
|
203
|
+
- **Logic**: Navigate pages, boundary behavior, indicator updates
|
|
152
204
|
|
|
153
205
|
#### Modal / Dialog sections
|
|
154
|
-
- **UI/UX**: Modal
|
|
155
|
-
- **Validation**:
|
|
156
|
-
- **Logic**: Open
|
|
157
|
-
- **Security**: Cannot open unauthorized modals, CSRF on modal submit
|
|
158
|
-
|
|
159
|
-
#### Card Grid / List sections
|
|
160
|
-
- **UI/UX**: Cards display all expected fields (title, image, description, metadata), empty state, loading state
|
|
161
|
-
- **Logic**: Click card navigates to detail, load more / infinite scroll, card action buttons (like, share, delete), responsive layout
|
|
162
|
-
- **Security**: User-generated content sanitized, cannot access other users' cards
|
|
163
|
-
|
|
164
|
-
#### Carousel / Slider sections
|
|
165
|
-
- **UI/UX**: Arrows visible, indicators visible, current slide highlighted
|
|
166
|
-
- **Logic**: Next slide, previous slide, wrap at end, auto-play, indicator click navigates, swipe gesture
|
|
167
|
-
- **Security**: N/A
|
|
206
|
+
- **UI/UX**: Modal content + all fields + close button in one scenario
|
|
207
|
+
- **Validation**: Field validation inside modal with exact errors
|
|
208
|
+
- **Logic**: Open/close methods (X, Escape, overlay), submit success/error behavior
|
|
168
209
|
|
|
169
210
|
#### Tabs / Accordion sections
|
|
170
|
-
- **UI/UX**: All
|
|
171
|
-
- **Logic**: Switch tabs
|
|
172
|
-
- **Security**: Tab content respects permissions
|
|
211
|
+
- **UI/UX**: All tab labels + active tab highlighted + default tab content
|
|
212
|
+
- **Logic**: Switch tabs → verify content changes, accordion expand/collapse
|
|
173
213
|
|
|
174
214
|
### General Coverage Dimensions (aim for 20+ total per viewpoint)
|
|
175
215
|
|
|
176
|
-
**Happy paths (3-5):** Standard flow
|
|
177
|
-
**Edge cases (5-8):** Empty, max length, special chars, unicode
|
|
178
|
-
**
|
|
179
|
-
**
|
|
180
|
-
**
|
|
181
|
-
**Combinatorial (2-4):** Multiple invalid fields, valid+invalid combos, different roles
|
|
216
|
+
**Happy paths (3-5):** Standard flow with full assertion of result state
|
|
217
|
+
**Edge cases (5-8):** Empty, max length, special chars, unicode, whitespace, boundary values
|
|
218
|
+
**Negative cases (3-5):** Invalid format, missing required, wrong type, exact error messages
|
|
219
|
+
**State transitions (2-4):** Before/after action, verify both old and new state
|
|
220
|
+
**Combinatorial (2-4):** Multiple invalid fields, valid+invalid combos
|
|
182
221
|
|
|
183
222
|
### SPA Wait-For Steps
|
|
184
223
|
|
|
@@ -209,24 +248,37 @@ Feature: <Screen> Screen
|
|
|
209
248
|
# Section: Create User Form
|
|
210
249
|
# ============================================================
|
|
211
250
|
|
|
212
|
-
# --- UI/UX
|
|
251
|
+
# --- UI/UX ---
|
|
213
252
|
|
|
214
|
-
Scenario: VP-UI-001
|
|
215
|
-
|
|
253
|
+
Scenario: VP-UI-001 Form displays all fields with correct defaults
|
|
254
|
+
Given User is on [Create User] page
|
|
255
|
+
Then User see [Create User] heading with {{form_title}}
|
|
256
|
+
And User see [Name] field
|
|
257
|
+
And User see [Email] field
|
|
258
|
+
And User see [Role] dropdown with {{default_role}}
|
|
259
|
+
And User see [Submit] button is disabled
|
|
260
|
+
And User see [Cancel] button is enabled
|
|
216
261
|
|
|
217
|
-
# --- Validation
|
|
262
|
+
# --- Validation ---
|
|
218
263
|
|
|
219
|
-
Scenario: VP-VAL-001 Submit with empty
|
|
220
|
-
|
|
264
|
+
Scenario: VP-VAL-001 Submit with all empty fields shows errors
|
|
265
|
+
Given User is on [Create User] page
|
|
266
|
+
When User click [Submit] button
|
|
267
|
+
Then User see [Name error] message with {{name_required_error}}
|
|
268
|
+
And User see [Email error] message with {{email_required_error}}
|
|
221
269
|
|
|
222
270
|
# ============================================================
|
|
223
271
|
# Section: User Table
|
|
224
272
|
# ============================================================
|
|
225
273
|
|
|
226
|
-
# --- UI/UX
|
|
274
|
+
# --- UI/UX ---
|
|
227
275
|
|
|
228
|
-
Scenario: VP-UI-
|
|
229
|
-
|
|
276
|
+
Scenario: VP-UI-010 Table displays all columns
|
|
277
|
+
Given User is on [Users] page
|
|
278
|
+
Then User see [Name] column in [Users] table
|
|
279
|
+
And User see [Email] column in [Users] table
|
|
280
|
+
And User see [Status] column in [Users] table
|
|
281
|
+
And User see [Actions] column in [Users] table
|
|
230
282
|
```
|
|
231
283
|
|
|
232
284
|
**Naming convention:** `VP-<CATEGORY>-<NNN>` prefix in Scenario name.
|
|
@@ -15,7 +15,11 @@ sungen generate → compiles Gherkin + selectors + data → Playwright .spec.ts
|
|
|
15
15
|
├── qa/screens/<name>/
|
|
16
16
|
│ ├── features/ # .feature files (Gherkin)
|
|
17
17
|
│ ├── selectors/ # Element locator YAML mappings
|
|
18
|
-
│
|
|
18
|
+
│ ├── test-data/ # Test data YAML values
|
|
19
|
+
│ └── requirements/ # Screen specs, UI designs, notes
|
|
20
|
+
│ ├── spec.md # Structured screen specification
|
|
21
|
+
│ ├── ui/ # Screenshots, mockups, design images
|
|
22
|
+
│ └── notes.md # Edge cases, decisions (optional)
|
|
19
23
|
├── specs/
|
|
20
24
|
│ └── generated/ # Auto-generated Playwright tests
|
|
21
25
|
├── .claude/
|
|
@@ -53,7 +57,7 @@ Use AI commands (Claude Code or GitHub Copilot) to drive the workflow:
|
|
|
53
57
|
|---|---|
|
|
54
58
|
| `/sungen:add-screen` | `/sungen-add-screen` |
|
|
55
59
|
|
|
56
|
-
Scaffolds `qa/screens/<name>/` with empty feature, selectors,
|
|
60
|
+
Scaffolds `qa/screens/<name>/` with empty feature, selectors, test-data, and requirements files. Fill `requirements/spec.md` with screen specs before creating test cases for higher quality output.
|
|
57
61
|
|
|
58
62
|
### Step 2: Create test cases
|
|
59
63
|
|
|
@@ -62,10 +66,11 @@ Scaffolds `qa/screens/<name>/` with empty feature, selectors, and test-data file
|
|
|
62
66
|
| `/sungen:make-tc login` | `/sungen-make-tc login` |
|
|
63
67
|
|
|
64
68
|
AI acts as a **Senior QA Engineer**:
|
|
65
|
-
1.
|
|
66
|
-
2.
|
|
67
|
-
3.
|
|
68
|
-
4.
|
|
69
|
+
1. Reads `requirements/spec.md` for screen specs (fields, validation, business rules, states)
|
|
70
|
+
2. Optionally explores the live page via Playwright MCP to verify and supplement
|
|
71
|
+
3. Identifies screen sections → asks user which to focus on
|
|
72
|
+
4. Generates **20+ scenarios per viewpoint** (UI/UX, Validation, Logic, Security) for each section
|
|
73
|
+
5. Confirms test plan before generating `.feature` + `test-data.yaml`
|
|
69
74
|
|
|
70
75
|
### Step 3: Compile & run tests
|
|
71
76
|
|
|
@@ -136,8 +141,8 @@ User <action> [<Target>] <type> with {{<Value>}}
|
|
|
136
141
|
| Assert text | `User see [Title] heading with {{title}}` |
|
|
137
142
|
| Assert state | `User see [Submit] button is disabled` |
|
|
138
143
|
| Wait for | `User wait for [Modal] dialog is visible` |
|
|
139
|
-
| Table row | `User see [Users] table
|
|
140
|
-
| Table column | `User see [
|
|
144
|
+
| Table row | `User see [Users] table row with {{name}}` |
|
|
145
|
+
| Table column | `User see [Email] column in [Users] table` |
|
|
141
146
|
|
|
142
147
|
States: `hidden` `visible` `disabled` `enabled` `checked` `unchecked` `focused` `empty` `loading` `selected`
|
|
143
148
|
|