@esimplicitylabs/katalyst-xspec 0.6.0 → 0.7.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.
@@ -1,24 +1,19 @@
1
1
  ---
2
2
  name: katalyst-bdd-step-reference
3
- description: Complete reference of all available BDD step definitions in the Katalyst framework. Use when writing feature files, looking up step syntax, understanding what steps are available for a tag, or finding the right step for a specific action like clicking, filling forms, making API calls, or terminal interactions.
3
+ description: Complete reference of all available BDD step definitions in the Katalyst framework. Use when writing feature files, looking up step syntax, checking exact step wording, or finding the right step for a specific action like clicking, filling forms, making API calls, or terminal interactions.
4
4
  ---
5
5
 
6
6
  # Katalyst BDD Step Reference
7
7
 
8
8
  This skill provides a complete reference of all step definitions available in @esimplicitylabs/katalyst-xspec.
9
9
 
10
- ## Tag System
10
+ ## Where Steps Work
11
11
 
12
- Steps are enabled based on the feature/scenario tag:
12
+ Built-in steps are untagged. Once registered (`registerApiSteps`, `registerUiSteps`, `registerSharedSteps`, `registerTuiSteps`, ...), **any step works in any scenario**, so a single scenario can mix API, UI and shared steps.
13
13
 
14
- | Tag | Available Steps | Use Case |
15
- |-----|-----------------|----------|
16
- | `@api` | API + Shared | HTTP API testing only |
17
- | `@ui` | UI + Shared | Browser UI testing only |
18
- | `@tui` | TUI + Shared | Terminal UI testing only |
19
- | `@hybrid` | API + UI + Shared | Combined API and UI testing |
20
-
21
- **Important:** Always tag your feature or scenario. Without a tag, steps may not be available.
14
+ - Do not add `{ tags: ... }` to steps or type tags to scenarios; they are not needed.
15
+ - Playwright projects pick feature files by folder (`features/api/`, `features/ui/`).
16
+ - Tags like `@smoke` or `@wip` are optional, for the user's own filtering (`TEST_TAGS`).
22
17
 
23
18
  ## Variable Interpolation
24
19
 
@@ -31,7 +26,7 @@ When I GET "/users/{userId}" # Becomes /users/123
31
26
 
32
27
  ## Quick Reference - Most Common Steps
33
28
 
34
- ### API Steps (`@api` or `@hybrid`)
29
+ ### API Steps
35
30
 
36
31
  | Step | Example |
37
32
  |------|---------|
@@ -49,7 +44,7 @@ When I GET "/users/{userId}" # Becomes /users/123
49
44
  | `Given I am authenticated as a user via API` | User API authentication |
50
45
  | `Given I set header {string} to {string}` | `Given I set header "X-Custom" to "value"` |
51
46
 
52
- ### UI Steps (`@ui` or `@hybrid`)
47
+ ### UI Steps
53
48
 
54
49
  | Step | Example |
55
50
  |------|---------|
@@ -64,7 +59,7 @@ When I GET "/users/{userId}" # Becomes /users/123
64
59
  | `Then the element {string} should be visible` | `Then the element "#modal" should be visible` |
65
60
  | `When I pause for debugging` | Opens Playwright Inspector |
66
61
 
67
- ### TUI Steps (`@tui`)
62
+ ### TUI Steps
68
63
 
69
64
  | Step | Example |
70
65
  |------|---------|
@@ -73,9 +68,13 @@ When I GET "/users/{userId}" # Becomes /users/123
73
68
  | `When I press {string}` | `When I press "Enter"` |
74
69
  | `When I press enter` | Press Enter key |
75
70
  | `Then I should see {string}` | `Then I should see "Welcome"` |
71
+ | `Then I should see {string} in the terminal` | `Then I should see "Ready" in the terminal` |
76
72
  | `Then the screen should contain {string}` | Assert screen has text |
73
+ | `When I fill the TUI form:` | Data table of `field`/`value` |
74
+
75
+ TUI has no `I should see text {string}` (that's the UI step), and the TUI form step is `I fill the TUI form:` (UI uses `I fill the form:`).
77
76
 
78
- ### Shared Steps (All Tags)
77
+ ### Shared Steps
79
78
 
80
79
  | Step | Example |
81
80
  |------|---------|
@@ -106,7 +105,6 @@ For complete step definitions with all parameters and examples:
106
105
  ### API CRUD Test
107
106
 
108
107
  ```gherkin
109
- @api
110
108
  Scenario: Create and fetch user
111
109
  Given I am authenticated as an admin via API
112
110
  When I POST "/users" with JSON body:
@@ -122,7 +120,6 @@ Scenario: Create and fetch user
122
120
  ### UI Login Test
123
121
 
124
122
  ```gherkin
125
- @ui
126
123
  Scenario: User login
127
124
  Given I navigate to "/login"
128
125
  When I fill in "Email" with "user@example.com"
@@ -131,10 +128,9 @@ Scenario: User login
131
128
  Then I should see text "Dashboard"
132
129
  ```
133
130
 
134
- ### Hybrid Test (API + UI)
131
+ ### Mixed API + UI Test (no tag needed)
135
132
 
136
133
  ```gherkin
137
- @hybrid
138
134
  Scenario: Create via API, verify in UI
139
135
  Given I am authenticated as an admin via API
140
136
  When I POST "/users" with JSON body:
@@ -1,6 +1,6 @@
1
1
  # API Steps Reference
2
2
 
3
- Complete reference for API steps. Available in `@api` and `@hybrid` scenarios.
3
+ Complete reference for API steps. Steps are untagged and work in any scenario (including alongside UI steps).
4
4
 
5
5
  ## HTTP Method Steps
6
6
 
@@ -207,7 +207,6 @@ And I store the value at "items[0].id" as "firstItemId"
207
207
  ## Complete API Example
208
208
 
209
209
  ```gherkin
210
- @api
211
210
  Feature: User Management API
212
211
 
213
212
  Background:
@@ -1,6 +1,6 @@
1
1
  # Shared Steps Reference
2
2
 
3
- Complete reference for shared steps. Available in all scenarios regardless of tag (`@api`, `@ui`, `@tui`, `@hybrid`).
3
+ Complete reference for shared steps. Available in all scenarios; like every built-in step, they need no tag.
4
4
 
5
5
  ## Variable Steps
6
6
 
@@ -247,7 +247,6 @@ type World = {
247
247
  ### API Test with Variables and Cleanup
248
248
 
249
249
  ```gherkin
250
- @api
251
250
  Feature: User Management
252
251
 
253
252
  Background:
@@ -276,7 +275,6 @@ Feature: User Management
276
275
  ### UI Test with Variables
277
276
 
278
277
  ```gherkin
279
- @ui
280
278
  Feature: Search
281
279
 
282
280
  Scenario: Search with generated term
@@ -291,7 +289,6 @@ Feature: Search
291
289
  ### Hybrid Test with Shared State
292
290
 
293
291
  ```gherkin
294
- @hybrid
295
292
  Feature: User Onboarding
296
293
 
297
294
  Scenario: Create user via API, verify in UI
@@ -322,7 +319,6 @@ Feature: User Onboarding
322
319
  ### Feature Flags Example
323
320
 
324
321
  ```gherkin
325
- @ui
326
322
  Feature: Feature Flag Testing
327
323
 
328
324
  Scenario: Test with feature enabled
@@ -1,6 +1,6 @@
1
1
  # TUI Steps Reference
2
2
 
3
- Complete reference for TUI (Terminal User Interface) steps. Available only in `@tui` scenarios.
3
+ Complete reference for TUI (Terminal User Interface) steps. Steps are untagged and work in any scenario once `registerTuiSteps(test)` is enabled and a TUI adapter is configured.
4
4
 
5
5
  **Prerequisites:** TUI testing requires `tmux` installed on the system and `tui-tester` configured.
6
6
 
@@ -202,8 +202,10 @@ When I select from dropdown "Theme" value "Dark"
202
202
 
203
203
  ### Fill Form
204
204
 
205
+ The TUI form step is `I fill the TUI form:` (the UI step keeps `I fill the form:`).
206
+
205
207
  ```gherkin
206
- When I fill the form:
208
+ When I fill the TUI form:
207
209
  | Field | Value |
208
210
  | Username | admin |
209
211
  | Password | secret123 |
@@ -223,7 +225,6 @@ When I submit the form with ctrl+s
223
225
  ```gherkin
224
226
  Then I should see {string}
225
227
  Then I should see {string} in the terminal
226
- Then I should see text {string}
227
228
  Then the screen should contain {string}
228
229
  ```
229
230
 
@@ -234,6 +235,8 @@ Then I should see "Login successful" in the terminal
234
235
  Then the screen should contain "Press Enter to continue"
235
236
  ```
236
237
 
238
+ Note: there is no TUI `I should see text {string}` step; that wording belongs to the UI steps.
239
+
237
240
  ### Assert Text Not Visible
238
241
 
239
242
  ```gherkin
@@ -417,7 +420,6 @@ When I force quit the application
417
420
  ## Complete TUI Example
418
421
 
419
422
  ```gherkin
420
- @tui
421
423
  Feature: CLI Application
422
424
 
423
425
  Background:
@@ -438,7 +440,7 @@ Feature: CLI Application
438
440
 
439
441
  Scenario: Fill login form
440
442
  When I wait for "Login"
441
- When I fill the form:
443
+ When I fill the TUI form:
442
444
  | Field | Value |
443
445
  | Username | admin |
444
446
  | Password | secret123 |
@@ -1,6 +1,6 @@
1
1
  # UI Steps Reference
2
2
 
3
- Complete reference for UI steps. Available in `@ui` and `@hybrid` scenarios.
3
+ Complete reference for UI steps. Steps are untagged and work in any scenario (including alongside API steps). UI tests need a browser: `npx playwright install chromium`.
4
4
 
5
5
  ## Navigation Steps
6
6
 
@@ -496,7 +496,6 @@ Then I zoom to "150" in the browser
496
496
  ## Complete UI Example
497
497
 
498
498
  ```gherkin
499
- @ui
500
499
  Feature: User Login
501
500
 
502
501
  Scenario: Successful login flow
@@ -11,8 +11,10 @@ This skill helps diagnose and fix common issues with the Katalyst BDD testing fr
11
11
 
12
12
  | Symptom | Likely Cause | Solution |
13
13
  |---------|--------------|----------|
14
- | "No tests found" | Forgot to generate | Run `npm run gen` |
15
- | Step is undefined | Wrong tag or typo | Check tag matches step availability |
14
+ | "No tests found" | Forgot to generate | Run `npm run gen` (or just `npm test`) |
15
+ | "Executable doesn't exist" | Browser not downloaded | Run `npx playwright install chromium` |
16
+ | Step is undefined | Typo, renamed step, or not registered | Check exact wording in the step reference |
17
+ | Scenario never runs | Feature outside a project's folder, `@Skip`, or old tag filter | See Issue 2b |
16
18
  | Auth fails (401/403) | Bad credentials | Check `.env` variables |
17
19
  | Element not found | Selector wrong or timing | Add waits or use debugging |
18
20
  | Cleanup not running | Not registered | Add `Given I register cleanup DELETE...` |
@@ -36,7 +38,7 @@ npm run gen
36
38
  npm test
37
39
  ```
38
40
 
39
- **Prevention:** Add to your workflow - always run `npm run gen` before `npm test`.
41
+ **Prevention:** `npm test` already runs `bddgen && playwright test`. If you call `npx playwright test` directly, run `npm run gen` first.
40
42
 
41
43
  ## Issue 2: Step Not Defined
42
44
 
@@ -47,24 +49,11 @@ Step "When I click the button Submit" is not defined
47
49
 
48
50
  **Possible Causes:**
49
51
 
50
- ### 1. Wrong Tag
51
- Steps are only available with the correct tag:
52
+ ### 1. Renamed or Removed Step (0.7.0)
53
+ Steps are untagged and work in any scenario, so a tag is never the cause. Check for these 0.7.0 changes:
52
54
 
53
- | Step Type | Required Tag |
54
- |-----------|--------------|
55
- | API steps | `@api` or `@hybrid` |
56
- | UI steps | `@ui` or `@hybrid` |
57
- | TUI steps | `@tui` |
58
- | Shared steps | Any tag |
59
-
60
- **Fix:** Add the correct tag to your feature or scenario:
61
- ```gherkin
62
- @ui # <-- Required for UI steps
63
- Feature: Login Page
64
-
65
- Scenario: Click button
66
- When I click the button "Submit"
67
- ```
55
+ - TUI `When I fill the form:` is now `When I fill the TUI form:` (UI keeps `I fill the form:`).
56
+ - TUI `Then I should see text {string}` was removed; use `Then I should see {string}` or `Then I should see {string} in the terminal`.
68
57
 
69
58
  ### 2. Typo in Step
70
59
  Steps must match exactly. Check:
@@ -99,6 +88,16 @@ registerAllSteps(test); // Registers all step types
99
88
  export { test };
100
89
  ```
101
90
 
91
+ ## Issue 2b: Scenario Never Runs
92
+
93
+ Untagged scenarios are not skipped. If a scenario is missing:
94
+
95
+ 1. Check the feature file is in the folder its project reads (e.g. `features/ui/**/*.feature` for the `ui` project).
96
+ 2. Check it isn't tagged `@Skip`/`@ignore`, and that `TEST_TAGS` isn't filtering it out.
97
+ 3. If `playwright.config.*` still has old filters like `tags: '@ui'` (pre-0.7), run `npx katalyst-xspec upgrade --migrate`.
98
+
99
+ Old `@api`/`@ui` tags left in feature files are harmless.
100
+
102
101
  ## Issue 3: Authentication Failures
103
102
 
104
103
  ### API Auth Fails (401)
@@ -107,11 +106,11 @@ export { test };
107
106
  ```bash
108
107
  # Required for admin auth
109
108
  DEFAULT_ADMIN_USERNAME=admin@example.com
110
- DEFAULT_ADMIN_PASSWORD=admin123
109
+ DEFAULT_ADMIN_PASSWORD=changeme
111
110
 
112
111
  # Required for user auth
113
112
  DEFAULT_USER_USERNAME=user@example.com
114
- DEFAULT_USER_PASSWORD=user123
113
+ DEFAULT_USER_PASSWORD=changeme
115
114
 
116
115
  # Auth endpoint path
117
116
  API_AUTH_LOGIN_PATH=/auth/login
@@ -422,9 +421,9 @@ HEADLESS=true
422
421
 
423
422
  # Authentication (required -- no hardcoded defaults)
424
423
  DEFAULT_ADMIN_USERNAME=admin@example.com
425
- DEFAULT_ADMIN_PASSWORD=admin123
424
+ DEFAULT_ADMIN_PASSWORD=changeme
426
425
  DEFAULT_USER_USERNAME=user@example.com
427
- DEFAULT_USER_PASSWORD=user123
426
+ DEFAULT_USER_PASSWORD=changeme
428
427
  API_AUTH_LOGIN_PATH=/auth/login
429
428
 
430
429
  # UI Login Customization (optional)