@esimplicitylabs/katalyst-xspec 0.6.0 → 0.7.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 +7 -3
- package/cli/init.cjs +85 -96
- package/cli/upgrade.cjs +63 -1
- package/dist/{chunk-ACAXOGKZ.js → chunk-UTTKW2SR.js} +106 -165
- package/dist/index.d.ts +6 -3
- package/dist/index.js +3 -4
- package/dist/steps/index.d.ts +0 -9
- package/dist/steps/index.js +1 -1
- package/package.json +1 -1
- package/skills/katalyst-bdd-architecture/SKILL.md +10 -9
- package/skills/katalyst-bdd-architecture/references/custom-steps.md +15 -19
- package/skills/katalyst-bdd-create-test/SKILL.md +34 -29
- package/skills/katalyst-bdd-create-test/references/api-patterns.md +0 -15
- package/skills/katalyst-bdd-create-test/references/hybrid-patterns.md +1 -14
- package/skills/katalyst-bdd-create-test/references/tui-patterns.md +3 -27
- package/skills/katalyst-bdd-create-test/references/ui-patterns.md +0 -19
- package/skills/katalyst-bdd-quickstart/SKILL.md +57 -55
- package/skills/katalyst-bdd-step-reference/SKILL.md +15 -19
- package/skills/katalyst-bdd-step-reference/references/api-steps.md +1 -2
- package/skills/katalyst-bdd-step-reference/references/shared-steps.md +1 -5
- package/skills/katalyst-bdd-step-reference/references/tui-steps.md +7 -5
- package/skills/katalyst-bdd-step-reference/references/ui-steps.md +1 -2
- package/skills/katalyst-bdd-troubleshooting/SKILL.md +23 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Shared Steps Reference
|
|
2
2
|
|
|
3
|
-
Complete reference for shared steps. Available in all scenarios
|
|
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.
|
|
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.
|
|
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
|
-
|
|
|
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:**
|
|
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.
|
|
51
|
-
Steps are
|
|
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
|
-
|
|
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=
|
|
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=
|
|
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=
|
|
424
|
+
DEFAULT_ADMIN_PASSWORD=changeme
|
|
426
425
|
DEFAULT_USER_USERNAME=user@example.com
|
|
427
|
-
DEFAULT_USER_PASSWORD=
|
|
426
|
+
DEFAULT_USER_PASSWORD=changeme
|
|
428
427
|
API_AUTH_LOGIN_PATH=/auth/login
|
|
429
428
|
|
|
430
429
|
# UI Login Customization (optional)
|