@sun-asterisk/sungen 2.2.3 β†’ 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.
Files changed (78) hide show
  1. package/README.md +4 -4
  2. package/dist/cli/commands/update.d.ts +3 -0
  3. package/dist/cli/commands/update.d.ts.map +1 -0
  4. package/dist/cli/commands/update.js +21 -0
  5. package/dist/cli/commands/update.js.map +1 -0
  6. package/dist/cli/index.js +3 -1
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/generators/gherkin-parser/index.d.ts +2 -0
  9. package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
  10. package/dist/generators/gherkin-parser/index.js +16 -2
  11. package/dist/generators/gherkin-parser/index.js.map +1 -1
  12. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/attribute-assertion.hbs +3 -0
  13. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +12 -1
  14. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +12 -1
  15. package/dist/generators/test-generator/patterns/assertion-patterns.d.ts.map +1 -1
  16. package/dist/generators/test-generator/patterns/assertion-patterns.js +12 -0
  17. package/dist/generators/test-generator/patterns/assertion-patterns.js.map +1 -1
  18. package/dist/generators/test-generator/patterns/index.d.ts +9 -0
  19. package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
  20. package/dist/generators/test-generator/patterns/index.js +32 -0
  21. package/dist/generators/test-generator/patterns/index.js.map +1 -1
  22. package/dist/generators/test-generator/patterns/table-patterns.d.ts.map +1 -1
  23. package/dist/generators/test-generator/patterns/table-patterns.js +8 -5
  24. package/dist/generators/test-generator/patterns/table-patterns.js.map +1 -1
  25. package/dist/orchestrator/ai-rules-updater.d.ts +13 -0
  26. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -0
  27. package/dist/orchestrator/ai-rules-updater.js +157 -0
  28. package/dist/orchestrator/ai-rules-updater.js.map +1 -0
  29. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  30. package/dist/orchestrator/project-initializer.js +2 -27
  31. package/dist/orchestrator/project-initializer.js.map +1 -1
  32. package/dist/orchestrator/screen-manager.d.ts +1 -0
  33. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  34. package/dist/orchestrator/screen-manager.js +70 -3
  35. package/dist/orchestrator/screen-manager.js.map +1 -1
  36. package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +18 -9
  37. package/dist/orchestrator/templates/ai-instructions/claude-cmd-make-tc.md +11 -4
  38. package/dist/orchestrator/templates/ai-instructions/claude-cmd-make-test.md +9 -11
  39. package/dist/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +27 -8
  40. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +91 -25
  41. package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +124 -71
  42. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -5
  43. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-make-tc.md +12 -4
  44. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-make-test.md +9 -11
  45. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +27 -8
  46. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +72 -31
  47. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +124 -72
  48. package/dist/orchestrator/templates/readme.md +13 -8
  49. package/package.json +1 -1
  50. package/src/cli/commands/update.ts +18 -0
  51. package/src/cli/index.ts +3 -1
  52. package/src/generators/gherkin-parser/index.ts +19 -2
  53. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/attribute-assertion.hbs +3 -0
  54. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +12 -1
  55. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +12 -1
  56. package/src/generators/test-generator/patterns/assertion-patterns.ts +13 -0
  57. package/src/generators/test-generator/patterns/index.ts +41 -0
  58. package/src/generators/test-generator/patterns/table-patterns.ts +8 -5
  59. package/src/orchestrator/ai-rules-updater.ts +139 -0
  60. package/src/orchestrator/project-initializer.ts +2 -32
  61. package/src/orchestrator/screen-manager.ts +72 -3
  62. package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +18 -9
  63. package/src/orchestrator/templates/ai-instructions/claude-cmd-make-tc.md +11 -4
  64. package/src/orchestrator/templates/ai-instructions/claude-cmd-make-test.md +9 -11
  65. package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +27 -8
  66. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +91 -25
  67. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +124 -71
  68. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -5
  69. package/src/orchestrator/templates/ai-instructions/copilot-cmd-make-tc.md +12 -4
  70. package/src/orchestrator/templates/ai-instructions/copilot-cmd-make-test.md +9 -11
  71. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +27 -8
  72. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +72 -31
  73. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +124 -72
  74. package/src/orchestrator/templates/readme.md +13 -8
  75. package/docs/gherkin standards/gherkin-core-standard.md +0 -431
  76. package/docs/gherkin standards/gherkin-core-standard.vi.md +0 -399
  77. package/docs/gherkin-dictionary.md +0 -1126
  78. package/docs/makeauth.md +0 -225
@@ -1,431 +0,0 @@
1
- # Gherkin Standard - Core (v2.1)
2
-
3
- **Applies to: Manual Testing & Automation Testing**
4
-
5
- ---
6
-
7
- ## 1️⃣ Scenario Format (Flow Level)
8
-
9
- ### Format
10
- ```gherkin
11
- Scenario: <Who> <Does What> <For What Result>
12
- Given ...
13
- When ...
14
- Then ...
15
- ```
16
-
17
- ### Principles
18
- - **Independent**: 1 Scenario = 1 complete business behavior (no shared data between scenarios)
19
- - **Behavioral**: Describe "User does what" and "sees what" β€” focus on user behavior
20
- - **Objective**: Describe business outcomes. No technical details (CSS, XPath)
21
-
22
- ### Flow
23
- **Past (Setup) β†’ Present (Interaction) β†’ Future (Result)**
24
-
25
- ```gherkin
26
- Scenario: User logs in successfully with valid credentials
27
- # 1. Setup
28
- Given User is on [Login] page
29
- # 2. Interaction
30
- When User fill [Email] field with {{valid_email}}
31
- And User fill [Password] field with {{valid_password}}
32
- And User click [Submit] button
33
- # 3. Result
34
- Then User see [Dashboard] page
35
- And User see [Welcome] heading with {{username}}
36
- And User see [Logout] button is enabled
37
- ```
38
-
39
- ### Keyword Rules
40
- - **Given** β†’ `is on` only (setup context)
41
- - **When / And** β†’ `click`, `fill`, `select`, `press`, `clear`, `check`, `uncheck`, `hover`, `wait for`
42
- - **Then / And** β†’ `see` only (assertions)
43
- - **And** β†’ inherits from preceding keyword
44
-
45
- > Max 5–7 `Then/And` assertions per scenario. Split into separate scenarios if more needed.
46
-
47
- ---
48
-
49
- ## 2️⃣ Grammar (Step Level)
50
-
51
- ### Format
52
- ```
53
- [Keyword] User <Action> [Target Name] <Target Type> <with {{Value}}> <is State>
54
- ```
55
-
56
- ### Rules
57
- - βœ… `Actor` + `Action` are **mandatory**
58
- - βœ… `Target` is **required** for most actions (except `wait for N seconds`)
59
- - βœ… `with {{Value}}` only used when action requires data
60
- - βœ… `is State` only used for assertions and wait conditions
61
- - ❌ No free-text variations
62
- - ❌ No synonyms
63
-
64
- ### Structure Breakdown
65
-
66
- | Component | Required | Example |
67
- |-----------|----------|---------|
68
- | Actor | βœ… Always | `User` |
69
- | Action | βœ… Always | `click`, `fill`, `see` |
70
- | Target | βœ… Most cases | `[Login] button` |
71
- | Value | ⚠️ When needed | `{{valid_email}}` |
72
- | State | ⚠️ Assertions only | `is disabled` |
73
-
74
- ---
75
-
76
- ## 3️⃣ Actor
77
-
78
- ### Allowed Actor
79
- - βœ… **`User`** (only)
80
-
81
- ### Rules
82
- - **Only use**: `User`
83
- - **Do NOT use**: `System`, `Backend`, `API`, `App`
84
- - System behavior is verified using `Then`, not as an Actor
85
-
86
- ### Examples
87
- ```gherkin
88
- βœ… User is on [Login] page
89
- βœ… User click [Submit] button
90
- ❌ System sends verification email
91
- ❌ Backend validates password
92
- ```
93
-
94
- ---
95
-
96
- ## 4️⃣ Action
97
-
98
- ### Action Matrix
99
-
100
- | Group | Action | `with {{Value}}` | `is State` | Target Types |
101
- |-------|--------|:-:|:-:|---|
102
- | **Setup** | `is on` | ❌ | ❌ | `page`, `dialog`, `modal`, `tab` |
103
- | **Interaction** | `click` | Only dynamic lists ✱ | ❌ | All interactive elements |
104
- | **Interaction** | `double click` | ❌ | ❌ | Any element |
105
- | **Interaction** | `hover` | ❌ | ❌ | `icon`, `image`, `row`, `card`, `menuitem` |
106
- | **Interaction** | `drag` | ❌ | ❌ | Any to any |
107
- | **Interaction** | `expand` / `collapse` | ❌ | ❌ | `row`, `section` |
108
- | **Form** | `fill` | βœ… | ❌ | `field`, `textarea`, `search`, `uploader`, `slider`, `date-picker` |
109
- | **Form** | `select` | βœ… | ❌ | `dropdown`, `select`, `option` |
110
- | **Form** | `clear` | ❌ | ❌ | `field`, `textarea` |
111
- | **Form** | `check` | ❌ | ❌ | `checkbox`, `toggle`, `radio` |
112
- | **Form** | `uncheck` | ❌ | ❌ | `checkbox`, `toggle` (NOT radio) |
113
- | **Keyboard** | `press` | ❌ | ❌ | `key` (mandatory) |
114
- | **Scroll** | `scroll to` | ❌ | ❌ | `section`, any element |
115
- | **Frame** | `switch to` | ❌ | ❌ | `frame` |
116
- | **Wait** | `wait for` | ⚠️ Optional | ⚠️ Optional | `page`, `dialog`, `modal`, `message`, any element |
117
- | **Assertion** | `see` | βœ… | βœ… | All types |
118
- | **Alert** | `click` | ❌ | ❌ | `alert` (OK/Cancel) |
119
- | **Alert** | `fill` | βœ… | ❌ | `alert` (prompt) |
120
-
121
- > ✱ **`click` + `with {{Value}}`**: Only for dynamic lists (`row`, `item`, `card`, `option`). Never for static elements (`button`, `link`, `icon`, `tab`).
122
-
123
- ### Rules
124
- - βœ… Use **exact verbs** from the list above
125
- - ❌ No synonyms: `type`, `enter`, `input`, `verify`, `expect`, `open`, etc.
126
- - ❌ No compound actions: `click and wait`, `fill and submit`
127
-
128
- ### Anti-patterns
129
- ```gherkin
130
- ❌ User types {{password}} into [Password] field β†’ use "fill"
131
- ❌ User opens [Home] page β†’ use "is on"
132
- ❌ User checks [Terms] checkbox β†’ use "check" (no "s")
133
- ❌ User verifies [Success] message appears β†’ use "see"
134
- ❌ User click [Terms] checkbox β†’ use "check", not "click"
135
- ❌ User uncheck [Male] radio β†’ radio cannot uncheck, use "check [Female] radio"
136
- ```
137
-
138
- ---
139
-
140
- ## 5️⃣ Target
141
-
142
- ### Format
143
- ```
144
- [name] <element type>
145
- ```
146
-
147
- ### Element Types
148
-
149
- | Group | Types | Example |
150
- |---|---|---|
151
- | **Context** | `page` `dialog` `modal` `drawer` `tab` `alert` `overlay` `step` | `[Login] page`, `[Confirm] dialog` |
152
- | **Input** | `field` `textarea` `search` `dropdown` `option` `checkbox` `radio` `toggle` `uploader` `slider` `date-picker` | `[Email] field`, `[Global] search` |
153
- | **Trigger** | `button` `link` `icon` `menuitem` `tag` | `[Submit] button`, `[Close] icon` |
154
- | **Data** | `table` `row` `column` `cell` `list` `item` `card` `section` | `[Users] table`, `[Order] row` |
155
- | **Feedback** | `message` `header` `label` `text` `tooltip` `badge` `breadcrumb` `image` | `[Error] message`, `[Total] label` |
156
- | **System** | `key` `frame` `spinner` `progressbar` | `[Enter] key`, `[Payment] frame` |
157
-
158
- ### Naming Rules
159
- - βœ… Use **business/UI meaningful names**, not technical selectors
160
- - βœ… Visible text β†’ use exact UI label: `[Đăng nhαΊ­p] button`
161
- - βœ… No visible text β†’ short descriptive noun: `[close] icon`
162
- - βœ… Name > 30 chars β†’ shorten to 1–3 meaningful words
163
- - ❌ No CSS selectors: `#email`, `.btn-primary`
164
- - ❌ No XPath: `//input[@id='email']`
165
- - ❌ No element type in brackets: `[login button]` β†’ `[login] button`
166
-
167
- ### Examples
168
- ```gherkin
169
- βœ… User click [Login] button
170
- βœ… User fill [Email address] field with {{email}}
171
- βœ… User select [Country] dropdown with {{country}}
172
- βœ… User see [Welcome back] heading
173
-
174
- ❌ User click [#submit-btn] button
175
- ❌ User fill [input.email-field] field
176
- ❌ User see [div.alert-success] message
177
- ```
178
-
179
- ---
180
-
181
- ## 6️⃣ Value
182
-
183
- ### Format
184
- ```
185
- {{value}}
186
- ```
187
-
188
- ### Naming Convention
189
- - **snake_case** (lowercase with underscores)
190
- - Descriptive and context-aware
191
-
192
- ### Rules
193
- - βœ… Use `{{variable}}` syntax
194
- - βœ… Name reflects **data purpose**, not data content
195
- - ❌ No hard-coded data in steps
196
- - ❌ No real data (emails, passwords, tokens)
197
-
198
- ### Examples
199
-
200
- | βœ… Good | ❌ Bad |
201
- |--------|-------|
202
- | `{{valid_email}}` | `{{user@example.com}}` |
203
- | `{{invalid_password}}` | `{{123456}}` |
204
- | `{{expired_otp}}` | `{{999999}}` |
205
- | `{{product_name}}` | `{{iPhone 15 Pro}}` |
206
-
207
- ---
208
-
209
- ## 7️⃣ Assertion
210
-
211
- ### Verb
212
- - **Only**: `see`
213
-
214
- ### 7 Verify Patterns
215
-
216
- | # | Pattern | Assertion | Example |
217
- |---|---------|-----------|---------|
218
- | 1 | **Visibility** | `toBeVisible()` / `toBeHidden()` | `see [Success] message` / `see [Ads] modal is hidden` |
219
- | 2 | **Text Content** | `toHaveText()` (exact match) | `see [Error] message with {{err_msg}}` |
220
- | 3 | **Partial Text** | `toContainText()` | `see [Title] heading contains {{text}}` |
221
- | 4 | **Input Value** | `toHaveValue()` | `see [Email] field with {{user_email}}` |
222
- | 5 | **Component State** | `toBeDisabled()` / `toBeChecked()` etc. | `see [Submit] button is disabled` |
223
- | 6 | **Count** | `toHaveCount()` | `see [Result] row with {{result_count}}` |
224
- | 7 | **Page Context** | `toHaveURL()` | `see [Dashboard] page` |
225
-
226
- > **Key distinction**: `see [T] <input type> with {{v}}` β†’ `toHaveValue()` for inputs (field, textarea, search, dropdown, slider, date-picker). `see [T] <other type> with {{v}}` β†’ `toHaveText()` for everything else.
227
-
228
- ### State Modifiers
229
-
230
- | State | Assertion |
231
- |-------|-----------|
232
- | `hidden` | Element is not visible |
233
- | `visible` | Element is visible |
234
- | `disabled` | Element is disabled |
235
- | `enabled` | Element is enabled |
236
- | `checked` | Checkbox/radio/toggle is checked |
237
- | `unchecked` | Checkbox/radio/toggle is unchecked |
238
- | `focused` | Element has focus |
239
- | `empty` | Element has no text/value |
240
- | `loading` | Loading indicator is visible |
241
- | `selected` | Element is selected |
242
- | `sorted ascending` | Column sorted ascending |
243
- | `sorted descending` | Column sorted descending |
244
-
245
- ### Combined Value + State
246
- ```gherkin
247
- # Value and state can be combined:
248
- Then User see [Ads] modal with {{promo_title}} is hidden
249
- ```
250
-
251
- ### Table Assertions
252
-
253
- | Pattern | Example |
254
- |---------|---------|
255
- | Row exists | `User see [Users] table has row with {{name}}` |
256
- | No row | `User see [Users] table has no row with {{name}}` |
257
- | Row count | `User see [Users] table has {{count}} rows` |
258
- | Column exists | `User see [Users] table has [Email] column` |
259
- | Empty table | `User see [Users] table is empty` |
260
- | Cell by filter | `User see [Users] table row with {{filter}} has [Status] with {{status}}` |
261
- | Cell by index | `User see [Users] table row 1 [Name] cell with {{name}}` |
262
- | Action in row | `User click [Edit] in [Users] table row with {{name}}` |
263
-
264
- ### Rules
265
- - βœ… Assertions **only appear in `Then`** steps
266
- - βœ… Verify **system state / output**
267
- - βœ… Each step = **1 assertion**
268
- - ❌ No synonyms: `verify`, `expect`, `check`, `observe`, `validate`
269
-
270
- ---
271
-
272
- ## 8️⃣ Browser Alert (System Dialog)
273
-
274
- For native browser dialogs (`window.alert`, `window.confirm`, `window.prompt`):
275
-
276
- ```gherkin
277
- # Alert steps must appear BEFORE the action that triggers the dialog
278
- When User click [OK] alert # accept (OK/Accept/Yes/Confirm)
279
- And User click [Delete] button # this triggers the alert
280
-
281
- When User click [Cancel] alert # dismiss (Cancel/Dismiss/No)
282
- And User click [Delete] button
283
-
284
- When User fill [Name] alert with {{v}} # fill prompt + accept
285
- And User click [Rename] button
286
- ```
287
-
288
- > **Important**: Register the dialog handler BEFORE the triggering action. Sungen generates `page.once('dialog', ...)` for these steps.
289
-
290
- ---
291
-
292
- ## 🏷️ Tags
293
-
294
- ### Classification Tags
295
-
296
- | Tag | Description |
297
- |-----|-------------|
298
- | `@auto` | Standard scenario, ready for automation |
299
- | `@manual` | Skip scenario from generation |
300
- | `@smoke` | Smoke test suite |
301
- | `@regression` | Regression test suite |
302
-
303
- ### Authentication Tags
304
-
305
- | Tag | Description |
306
- |-----|-------------|
307
- | `@auth:<role>` | Use Playwright auth storage state for the given role |
308
- | `@no-auth` | Disable inherited authentication |
309
-
310
- Tags can be applied at **feature level** (inherited by all scenarios) or **scenario level** (overrides feature).
311
-
312
- **Auth precedence**: Extending scenario `@auth` > Base scenario `@auth` > Feature `@auth`
313
-
314
- ### Inheritance Tags (@steps / @extend)
315
-
316
- Use `@steps:<name>` to define a reusable block and `@extend:<name>` to inherit those steps:
317
-
318
- ```gherkin
319
- @auto @auth:user @steps:kudos__open_modal
320
- Scenario: Setup for opening Kudos modal
321
- Given User is on [Home] page
322
- When User click [Today you want...] button
323
- Then User see [Send thanks] dialog # ← skipped when @extend calls
324
-
325
- @auto @auth:user @extend:kudos__open_modal
326
- Scenario: User successfully sends a thank you message
327
- Given User is on [Send thanks] dialog # ← required: verify state after extend
328
- When User fill [Search teammate] field with {{teammate_name}}
329
- And User click [Send] button
330
- Then User see [Success] message with {{msg_success}}
331
- ```
332
-
333
- **Behavior:**
334
- - `@extend` executes **only Given→When** of `@steps` scenario (skips Then)
335
- - The `Given` in `@extend` scenario is the **entry assertion** β€” confirms state after base steps ran
336
- - If `@steps` scenario **fails**, `@extend` scenario is **automatically skipped**
337
- - Name format: `snake_case` or `kebab-case` with module prefix: `@steps:kudos__open_modal`, `@steps:cart__add_item`
338
-
339
- ### Step-Level Annotations (comment syntax)
340
-
341
- | Annotation | Effect |
342
- |-----------|--------|
343
- | `# @ignore` | Skip this step in generation |
344
- | `# @ignore-testcase` | Skip entire scenario in generation |
345
-
346
- ---
347
-
348
- ## πŸ“‹ Complete Example
349
-
350
- ```gherkin
351
- @feature_auth
352
- Feature: User Authentication
353
- Path: /auth/login
354
-
355
- # Happy Path
356
- @auto @smoke @regression
357
- Scenario: User logs in successfully with valid credentials
358
- Given User is on [Login] page
359
- When User fill [Email] field with {{valid_email}}
360
- And User fill [Password] field with {{valid_password}}
361
- And User check [Remember me] checkbox
362
- And User click [Submit] button
363
- Then User see [Dashboard] page
364
- And User see [Welcome] heading with {{username}}
365
- And User see [Logout] button is enabled
366
-
367
- # Error Path
368
- @auto @regression
369
- Scenario: Login fails with invalid credentials
370
- Given User is on [Login] page
371
- When User fill [Email] field with {{invalid_email}}
372
- And User fill [Password] field with {{invalid_password}}
373
- And User click [Submit] button
374
- Then User see [Login] page
375
- And User see [Login error] message with {{err_invalid_credentials}}
376
- And User see [Submit] button is enabled
377
-
378
- # Registration with form controls
379
- @auto @regression
380
- Scenario: User registers with preferred language
381
- Given User is on [Registration] page
382
- When User fill [Email] field with {{new_email}}
383
- And User fill [Password] field with {{new_password}}
384
- And User select [Language] dropdown with {{preferred_language}}
385
- And User check [Terms] checkbox
386
- And User click [Sign up] button
387
- Then User see [Verification] page
388
- ```
389
-
390
- ---
391
-
392
- ## βœ… Quick Reference
393
-
394
- ### Do's βœ…
395
- - Use **standard actions** from the action matrix
396
- - Use **`User`** as the only actor
397
- - Use **`[Target] <element type>`** format
398
- - Use **`{{snake_case}}`** for values
399
- - Use **`is <state>`** for state assertions
400
- - Use **tags** (`@auth`, `@steps`, `@extend`) for scenario management
401
- - **1 Scenario = 1 business flow**
402
- - **1 Step = 1 action or assertion**
403
-
404
- ### Don'ts ❌
405
- - No synonyms or free-text variations
406
- - No system/backend/API as actors
407
- - No technical selectors (CSS/XPath/ID)
408
- - No hard-coded data in steps
409
- - No compound actions
410
- - No `verify`/`check`/`expect` (use `see`)
411
- - No `open` (use `is on`)
412
- - No `click` on checkbox/toggle (use `check`/`uncheck`)
413
- - No `uncheck` on radio (use `check` on another option)
414
-
415
- ### Common Errors
416
-
417
- | ❌ Wrong | βœ… Correct | Reason |
418
- |---|---|---|
419
- | `Given User click [Login] button` | `When User click [Login] button` | `click` belongs to WHEN |
420
- | `When User click [Terms] checkbox` | `When User check [Terms] checkbox` | Use `check` for checkbox |
421
- | `When User press [Submit] button` | `When User press [Enter] key` | `press` only with `key` |
422
- | `When User uncheck [Male] radio` | `When User check [Female] radio` | Radio cannot uncheck |
423
- | `fill [email] with {{admin@mail}}` | `fill [email] field with {{admin_email}}` | No hardcode + missing type |
424
- | `see [msg] with {{text}} hidden` | `see [msg] with {{text}} is hidden` | Missing `is` keyword |
425
- | `see [btn] button with {{disabled}}` | `see [btn] button is disabled` | State uses `is`, not `{{}}` |
426
-
427
- ---
428
-
429
- **Version**: 2.1
430
- **Status**: Final
431
- **Last Updated**: March 31, 2026