@esimplicitylabs/katalyst-xspec 0.6.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/LICENSE +7 -0
- package/README.md +69 -0
- package/bin/katalyst-xspec.cjs +54 -0
- package/cli/init.cjs +679 -0
- package/cli/stubs.cjs +365 -0
- package/cli/upgrade.cjs +1014 -0
- package/dist/chunk-ACAXOGKZ.js +1611 -0
- package/dist/index.d.ts +881 -0
- package/dist/index.js +1091 -0
- package/dist/steps/index.d.ts +151 -0
- package/dist/steps/index.js +50 -0
- package/package.json +80 -0
- package/scripts/postinstall.cjs +85 -0
- package/skills/katalyst-bdd-architecture/SKILL.md +517 -0
- package/skills/katalyst-bdd-architecture/references/adapters.md +310 -0
- package/skills/katalyst-bdd-architecture/references/custom-steps.md +360 -0
- package/skills/katalyst-bdd-architecture/references/ports.md +256 -0
- package/skills/katalyst-bdd-create-test/SKILL.md +366 -0
- package/skills/katalyst-bdd-create-test/references/api-patterns.md +371 -0
- package/skills/katalyst-bdd-create-test/references/hybrid-patterns.md +420 -0
- package/skills/katalyst-bdd-create-test/references/tui-patterns.md +458 -0
- package/skills/katalyst-bdd-create-test/references/ui-patterns.md +415 -0
- package/skills/katalyst-bdd-quickstart/SKILL.md +292 -0
- package/skills/katalyst-bdd-step-reference/SKILL.md +147 -0
- package/skills/katalyst-bdd-step-reference/references/api-steps.md +247 -0
- package/skills/katalyst-bdd-step-reference/references/shared-steps.md +340 -0
- package/skills/katalyst-bdd-step-reference/references/tui-steps.md +483 -0
- package/skills/katalyst-bdd-step-reference/references/ui-steps.md +521 -0
- package/skills/katalyst-bdd-troubleshooting/SKILL.md +449 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Katalyst BDD Step Reference
|
|
7
|
+
|
|
8
|
+
This skill provides a complete reference of all step definitions available in @esimplicitylabs/katalyst-xspec.
|
|
9
|
+
|
|
10
|
+
## Tag System
|
|
11
|
+
|
|
12
|
+
Steps are enabled based on the feature/scenario tag:
|
|
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.
|
|
22
|
+
|
|
23
|
+
## Variable Interpolation
|
|
24
|
+
|
|
25
|
+
All steps support variable interpolation using `{varName}` syntax:
|
|
26
|
+
|
|
27
|
+
```gherkin
|
|
28
|
+
Given I set variable "userId" to "123"
|
|
29
|
+
When I GET "/users/{userId}" # Becomes /users/123
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Reference - Most Common Steps
|
|
33
|
+
|
|
34
|
+
### API Steps (`@api` or `@hybrid`)
|
|
35
|
+
|
|
36
|
+
| Step | Example |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `When I GET {string}` | `When I GET "/users"` |
|
|
39
|
+
| `When I POST {string} with JSON body:` | `When I POST "/users" with JSON body:` + docstring |
|
|
40
|
+
| `When I PUT {string} with JSON body:` | `When I PUT "/users/1" with JSON body:` + docstring |
|
|
41
|
+
| `When I PATCH {string} with JSON body:` | `When I PATCH "/users/1" with JSON body:` + docstring |
|
|
42
|
+
| `When I DELETE {string}` | `When I DELETE "/users/1"` |
|
|
43
|
+
| `Then the response status should be {int}` | `Then the response status should be 200` |
|
|
44
|
+
| `Then the response should be a JSON array` | Asserts response is an array |
|
|
45
|
+
| `Then the response should be a JSON object` | Asserts response is an object |
|
|
46
|
+
| `Then the value at {string} should equal {string}` | `Then the value at "name" should equal "John"` |
|
|
47
|
+
| `And I store the value at {string} as {string}` | `And I store the value at "id" as "userId"` |
|
|
48
|
+
| `Given I am authenticated as an admin via API` | Admin API authentication |
|
|
49
|
+
| `Given I am authenticated as a user via API` | User API authentication |
|
|
50
|
+
| `Given I set header {string} to {string}` | `Given I set header "X-Custom" to "value"` |
|
|
51
|
+
|
|
52
|
+
### UI Steps (`@ui` or `@hybrid`)
|
|
53
|
+
|
|
54
|
+
| Step | Example |
|
|
55
|
+
|------|---------|
|
|
56
|
+
| `Given I navigate to {string}` | `Given I navigate to "/login"` |
|
|
57
|
+
| `When I click the button {string}` | `When I click the button "Submit"` |
|
|
58
|
+
| `When I click the link {string}` | `When I click the link "Sign Up"` |
|
|
59
|
+
| `When I fill the field {string} with {string}` | `When I fill the field "Email" with "test@example.com"` |
|
|
60
|
+
| `When I fill in {string} with {string}` | `When I fill in "Password" with "secret"` |
|
|
61
|
+
| `When I select {string} from dropdown {string}` | `When I select "Admin" from dropdown "Role"` |
|
|
62
|
+
| `Then I should see text {string}` | `Then I should see text "Welcome"` |
|
|
63
|
+
| `Then the URL should contain {string}` | `Then the URL should contain "/dashboard"` |
|
|
64
|
+
| `Then the element {string} should be visible` | `Then the element "#modal" should be visible` |
|
|
65
|
+
| `When I pause for debugging` | Opens Playwright Inspector |
|
|
66
|
+
|
|
67
|
+
### TUI Steps (`@tui`)
|
|
68
|
+
|
|
69
|
+
| Step | Example |
|
|
70
|
+
|------|---------|
|
|
71
|
+
| `Given I start the TUI application` | Starts the configured TUI app |
|
|
72
|
+
| `When I type {string}` | `When I type "hello world"` |
|
|
73
|
+
| `When I press {string}` | `When I press "Enter"` |
|
|
74
|
+
| `When I press enter` | Press Enter key |
|
|
75
|
+
| `Then I should see {string}` | `Then I should see "Welcome"` |
|
|
76
|
+
| `Then the screen should contain {string}` | Assert screen has text |
|
|
77
|
+
|
|
78
|
+
### Shared Steps (All Tags)
|
|
79
|
+
|
|
80
|
+
| Step | Example |
|
|
81
|
+
|------|---------|
|
|
82
|
+
| `Given I set variable {string} to {string}` | `Given I set variable "email" to "test@test.com"` |
|
|
83
|
+
| `Given I generate a UUID and store as {string}` | `Given I generate a UUID and store as "runId"` |
|
|
84
|
+
| `Given I register cleanup DELETE {string}` | `Given I register cleanup DELETE "/users/{userId}"` |
|
|
85
|
+
|
|
86
|
+
## Detailed Reference
|
|
87
|
+
|
|
88
|
+
For complete step definitions with all parameters and examples:
|
|
89
|
+
|
|
90
|
+
- [API Steps](references/api-steps.md) - HTTP methods, assertions, authentication
|
|
91
|
+
- [UI Steps](references/ui-steps.md) - Navigation, clicks, forms, assertions
|
|
92
|
+
- [TUI Steps](references/tui-steps.md) - Terminal input, output, snapshots
|
|
93
|
+
- [Shared Steps](references/shared-steps.md) - Variables, cleanup, feature flags
|
|
94
|
+
|
|
95
|
+
## Step Parameters
|
|
96
|
+
|
|
97
|
+
| Placeholder | Type | Example |
|
|
98
|
+
|-------------|------|---------|
|
|
99
|
+
| `{string}` | Text in quotes | `"hello"` or `"/api/users"` |
|
|
100
|
+
| `{int}` | Integer | `200`, `404` |
|
|
101
|
+
| Docstring | Multi-line text | Triple quotes `"""` |
|
|
102
|
+
| DataTable | Tabular data | Gherkin table format |
|
|
103
|
+
|
|
104
|
+
## Common Patterns
|
|
105
|
+
|
|
106
|
+
### API CRUD Test
|
|
107
|
+
|
|
108
|
+
```gherkin
|
|
109
|
+
@api
|
|
110
|
+
Scenario: Create and fetch user
|
|
111
|
+
Given I am authenticated as an admin via API
|
|
112
|
+
When I POST "/users" with JSON body:
|
|
113
|
+
"""
|
|
114
|
+
{ "email": "test@example.com", "name": "Test" }
|
|
115
|
+
"""
|
|
116
|
+
Then the response status should be 201
|
|
117
|
+
And I store the value at "id" as "userId"
|
|
118
|
+
When I GET "/users/{userId}"
|
|
119
|
+
Then the response status should be 200
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### UI Login Test
|
|
123
|
+
|
|
124
|
+
```gherkin
|
|
125
|
+
@ui
|
|
126
|
+
Scenario: User login
|
|
127
|
+
Given I navigate to "/login"
|
|
128
|
+
When I fill in "Email" with "user@example.com"
|
|
129
|
+
And I fill in "Password" with "password123"
|
|
130
|
+
And I click the button "Sign In"
|
|
131
|
+
Then I should see text "Dashboard"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Hybrid Test (API + UI)
|
|
135
|
+
|
|
136
|
+
```gherkin
|
|
137
|
+
@hybrid
|
|
138
|
+
Scenario: Create via API, verify in UI
|
|
139
|
+
Given I am authenticated as an admin via API
|
|
140
|
+
When I POST "/users" with JSON body:
|
|
141
|
+
"""
|
|
142
|
+
{ "email": "new@example.com" }
|
|
143
|
+
"""
|
|
144
|
+
Then the response status should be 201
|
|
145
|
+
Given I navigate to "/admin/users"
|
|
146
|
+
Then I should see text "new@example.com"
|
|
147
|
+
```
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# API Steps Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for API steps. Available in `@api` and `@hybrid` scenarios.
|
|
4
|
+
|
|
5
|
+
## HTTP Method Steps
|
|
6
|
+
|
|
7
|
+
### GET Request
|
|
8
|
+
|
|
9
|
+
```gherkin
|
|
10
|
+
When I GET {string}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Example:**
|
|
14
|
+
```gherkin
|
|
15
|
+
When I GET "/users"
|
|
16
|
+
When I GET "/users/{userId}"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### POST Request with JSON
|
|
20
|
+
|
|
21
|
+
```gherkin
|
|
22
|
+
When I POST {string} with JSON body:
|
|
23
|
+
"""
|
|
24
|
+
{ JSON content }
|
|
25
|
+
"""
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Example:**
|
|
29
|
+
```gherkin
|
|
30
|
+
When I POST "/users" with JSON body:
|
|
31
|
+
"""
|
|
32
|
+
{
|
|
33
|
+
"email": "test@example.com",
|
|
34
|
+
"name": "Test User",
|
|
35
|
+
"role": "member"
|
|
36
|
+
}
|
|
37
|
+
"""
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### PUT Request with JSON
|
|
41
|
+
|
|
42
|
+
```gherkin
|
|
43
|
+
When I PUT {string} with JSON body:
|
|
44
|
+
"""
|
|
45
|
+
{ JSON content }
|
|
46
|
+
"""
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Example:**
|
|
50
|
+
```gherkin
|
|
51
|
+
When I PUT "/users/{userId}" with JSON body:
|
|
52
|
+
"""
|
|
53
|
+
{
|
|
54
|
+
"name": "Updated Name"
|
|
55
|
+
}
|
|
56
|
+
"""
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### PATCH Request with JSON
|
|
60
|
+
|
|
61
|
+
```gherkin
|
|
62
|
+
When I PATCH {string} with JSON body:
|
|
63
|
+
"""
|
|
64
|
+
{ JSON content }
|
|
65
|
+
"""
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Example:**
|
|
69
|
+
```gherkin
|
|
70
|
+
When I PATCH "/users/{userId}" with JSON body:
|
|
71
|
+
"""
|
|
72
|
+
{
|
|
73
|
+
"status": "active"
|
|
74
|
+
}
|
|
75
|
+
"""
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### DELETE Request
|
|
79
|
+
|
|
80
|
+
```gherkin
|
|
81
|
+
When I DELETE {string}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Example:**
|
|
85
|
+
```gherkin
|
|
86
|
+
When I DELETE "/users/{userId}"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Authentication Steps
|
|
90
|
+
|
|
91
|
+
### Admin Authentication
|
|
92
|
+
|
|
93
|
+
```gherkin
|
|
94
|
+
Given I am authenticated as an admin via API
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Uses `DEFAULT_ADMIN_USERNAME` and `DEFAULT_ADMIN_PASSWORD` env variables.
|
|
98
|
+
|
|
99
|
+
### User Authentication
|
|
100
|
+
|
|
101
|
+
```gherkin
|
|
102
|
+
Given I am authenticated as a user via API
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Uses `DEFAULT_USER_USERNAME` and `DEFAULT_USER_PASSWORD` env variables.
|
|
106
|
+
|
|
107
|
+
### Set Bearer Token
|
|
108
|
+
|
|
109
|
+
```gherkin
|
|
110
|
+
Given I set bearer token from variable {string}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Example:**
|
|
114
|
+
```gherkin
|
|
115
|
+
Given I set bearer token from variable "authToken"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Set Custom Header
|
|
119
|
+
|
|
120
|
+
```gherkin
|
|
121
|
+
Given I set header {string} to {string}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Example:**
|
|
125
|
+
```gherkin
|
|
126
|
+
Given I set header "X-API-Key" to "abc123"
|
|
127
|
+
Given I set header "Authorization" to "Bearer {token}"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Response Assertion Steps
|
|
131
|
+
|
|
132
|
+
### Assert Status Code
|
|
133
|
+
|
|
134
|
+
```gherkin
|
|
135
|
+
Then the response status should be {int}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Example:**
|
|
139
|
+
```gherkin
|
|
140
|
+
Then the response status should be 200
|
|
141
|
+
Then the response status should be 201
|
|
142
|
+
Then the response status should be 404
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Assert JSON Type
|
|
146
|
+
|
|
147
|
+
```gherkin
|
|
148
|
+
Then the response should be a JSON array
|
|
149
|
+
Then the response should be a JSON object
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Assert JSON Value
|
|
153
|
+
|
|
154
|
+
```gherkin
|
|
155
|
+
Then the value at {string} should equal {string}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Uses JSON path syntax for nested values.
|
|
159
|
+
|
|
160
|
+
**Example:**
|
|
161
|
+
```gherkin
|
|
162
|
+
Then the value at "id" should equal "123"
|
|
163
|
+
Then the value at "user.name" should equal "John"
|
|
164
|
+
Then the value at "items[0].id" should equal "1"
|
|
165
|
+
Then the value at "data.users[0].email" should equal "{expectedEmail}"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Assert Value Contains
|
|
169
|
+
|
|
170
|
+
```gherkin
|
|
171
|
+
Then the value at {string} should contain {string}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Example:**
|
|
175
|
+
```gherkin
|
|
176
|
+
Then the value at "message" should contain "success"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Assert Value Matches Pattern
|
|
180
|
+
|
|
181
|
+
```gherkin
|
|
182
|
+
Then the value at {string} should match {string}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Example:**
|
|
186
|
+
```gherkin
|
|
187
|
+
Then the value at "email" should match "^[a-z]+@example\\.com$"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Value Extraction Steps
|
|
191
|
+
|
|
192
|
+
### Store Response Value
|
|
193
|
+
|
|
194
|
+
```gherkin
|
|
195
|
+
And I store the value at {string} as {string}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Extracts a value from the JSON response and stores it in a variable.
|
|
199
|
+
|
|
200
|
+
**Example:**
|
|
201
|
+
```gherkin
|
|
202
|
+
And I store the value at "id" as "userId"
|
|
203
|
+
And I store the value at "data.token" as "authToken"
|
|
204
|
+
And I store the value at "items[0].id" as "firstItemId"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Complete API Example
|
|
208
|
+
|
|
209
|
+
```gherkin
|
|
210
|
+
@api
|
|
211
|
+
Feature: User Management API
|
|
212
|
+
|
|
213
|
+
Background:
|
|
214
|
+
Given I am authenticated as an admin via API
|
|
215
|
+
|
|
216
|
+
Scenario: Full CRUD lifecycle
|
|
217
|
+
# Create
|
|
218
|
+
Given I generate a UUID and store as "runId"
|
|
219
|
+
When I POST "/admin/users" with JSON body:
|
|
220
|
+
"""
|
|
221
|
+
{
|
|
222
|
+
"email": "test-{runId}@example.com",
|
|
223
|
+
"name": "Test User {runId}",
|
|
224
|
+
"role": "member"
|
|
225
|
+
}
|
|
226
|
+
"""
|
|
227
|
+
Then the response status should be 201
|
|
228
|
+
And I store the value at "id" as "userId"
|
|
229
|
+
And the value at "email" should equal "test-{runId}@example.com"
|
|
230
|
+
|
|
231
|
+
# Read
|
|
232
|
+
When I GET "/admin/users/{userId}"
|
|
233
|
+
Then the response status should be 200
|
|
234
|
+
And the value at "name" should contain "Test User"
|
|
235
|
+
|
|
236
|
+
# Update
|
|
237
|
+
When I PATCH "/admin/users/{userId}" with JSON body:
|
|
238
|
+
"""
|
|
239
|
+
{ "name": "Updated User" }
|
|
240
|
+
"""
|
|
241
|
+
Then the response status should be 200
|
|
242
|
+
And the value at "name" should equal "Updated User"
|
|
243
|
+
|
|
244
|
+
# Delete
|
|
245
|
+
When I DELETE "/admin/users/{userId}"
|
|
246
|
+
Then the response status should be 204
|
|
247
|
+
```
|