@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.
Files changed (29) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +69 -0
  3. package/bin/katalyst-xspec.cjs +54 -0
  4. package/cli/init.cjs +679 -0
  5. package/cli/stubs.cjs +365 -0
  6. package/cli/upgrade.cjs +1014 -0
  7. package/dist/chunk-ACAXOGKZ.js +1611 -0
  8. package/dist/index.d.ts +881 -0
  9. package/dist/index.js +1091 -0
  10. package/dist/steps/index.d.ts +151 -0
  11. package/dist/steps/index.js +50 -0
  12. package/package.json +80 -0
  13. package/scripts/postinstall.cjs +85 -0
  14. package/skills/katalyst-bdd-architecture/SKILL.md +517 -0
  15. package/skills/katalyst-bdd-architecture/references/adapters.md +310 -0
  16. package/skills/katalyst-bdd-architecture/references/custom-steps.md +360 -0
  17. package/skills/katalyst-bdd-architecture/references/ports.md +256 -0
  18. package/skills/katalyst-bdd-create-test/SKILL.md +366 -0
  19. package/skills/katalyst-bdd-create-test/references/api-patterns.md +371 -0
  20. package/skills/katalyst-bdd-create-test/references/hybrid-patterns.md +420 -0
  21. package/skills/katalyst-bdd-create-test/references/tui-patterns.md +458 -0
  22. package/skills/katalyst-bdd-create-test/references/ui-patterns.md +415 -0
  23. package/skills/katalyst-bdd-quickstart/SKILL.md +292 -0
  24. package/skills/katalyst-bdd-step-reference/SKILL.md +147 -0
  25. package/skills/katalyst-bdd-step-reference/references/api-steps.md +247 -0
  26. package/skills/katalyst-bdd-step-reference/references/shared-steps.md +340 -0
  27. package/skills/katalyst-bdd-step-reference/references/tui-steps.md +483 -0
  28. package/skills/katalyst-bdd-step-reference/references/ui-steps.md +521 -0
  29. package/skills/katalyst-bdd-troubleshooting/SKILL.md +449 -0
@@ -0,0 +1,521 @@
1
+ # UI Steps Reference
2
+
3
+ Complete reference for UI steps. Available in `@ui` and `@hybrid` scenarios.
4
+
5
+ ## Navigation Steps
6
+
7
+ ### Navigate to Path
8
+
9
+ ```gherkin
10
+ Given I navigate to {string}
11
+ Given I open {string} page
12
+ Given I open {string} in the browser
13
+ ```
14
+
15
+ **Example:**
16
+ ```gherkin
17
+ Given I navigate to "/login"
18
+ Given I navigate to "/users/{userId}/profile"
19
+ Given I open "/dashboard" page
20
+ ```
21
+
22
+ ### Browser Navigation
23
+
24
+ ```gherkin
25
+ When I go back in the browser
26
+ When I reload the page
27
+ ```
28
+
29
+ ### Save Current URL
30
+
31
+ ```gherkin
32
+ When I save the current URL as {string}
33
+ ```
34
+
35
+ **Example:**
36
+ ```gherkin
37
+ When I save the current URL as "currentPage"
38
+ ```
39
+
40
+ ### Extract URL Part
41
+
42
+ ```gherkin
43
+ When I get a part of the URL based on {string} regular expression and save it as {string}
44
+ ```
45
+
46
+ **Example:**
47
+ ```gherkin
48
+ When I get a part of the URL based on "/users/(\d+)" regular expression and save it as "userId"
49
+ ```
50
+
51
+ ## Click Steps
52
+
53
+ ### Click Button
54
+
55
+ ```gherkin
56
+ When I click the button {string}
57
+ When I click the {string} button
58
+ ```
59
+
60
+ **Example:**
61
+ ```gherkin
62
+ When I click the button "Submit"
63
+ When I click the "Save" button
64
+ ```
65
+
66
+ ### Click Link
67
+
68
+ ```gherkin
69
+ When I click the link {string}
70
+ ```
71
+
72
+ **Example:**
73
+ ```gherkin
74
+ When I click the link "Sign Up"
75
+ When I click the link "Forgot Password?"
76
+ ```
77
+
78
+ ### Click Element by Selector
79
+
80
+ ```gherkin
81
+ When I click the element {string}
82
+ ```
83
+
84
+ **Example:**
85
+ ```gherkin
86
+ When I click the element "#submit-btn"
87
+ When I click the element ".menu-item"
88
+ ```
89
+
90
+ ### Click Element by Text/Locator
91
+
92
+ ```gherkin
93
+ When I {string} the {string} element that contains {string}
94
+ When I {string} the {string} element with {string} {string}
95
+ ```
96
+
97
+ Click modes: `click`, `dispatch click`, `force click`, `force dispatch click`
98
+ Locator methods: `text`, `label`, `placeholder`, `role`, `test ID`, `alternative text`, `title`, `locator`
99
+
100
+ **Example:**
101
+ ```gherkin
102
+ When I "click" the "button" element that contains "Save"
103
+ When I "force click" the "first" element with "test ID" "submit-button"
104
+ When I "click" the "2nd" element with "role" "button"
105
+ ```
106
+
107
+ ### Conditional Click
108
+
109
+ ```gherkin
110
+ When If its visible, I {string} the {string} element with {string} {string}
111
+ ```
112
+
113
+ **Example:**
114
+ ```gherkin
115
+ When If its visible, I "click" the "first" element with "text" "Dismiss"
116
+ ```
117
+
118
+ ## Form Input Steps
119
+
120
+ ### Fill by Label
121
+
122
+ ```gherkin
123
+ When I fill the field {string} with {string}
124
+ When I fill in {string} with {string}
125
+ ```
126
+
127
+ **Example:**
128
+ ```gherkin
129
+ When I fill the field "Email" with "test@example.com"
130
+ When I fill in "Password" with "secret123"
131
+ ```
132
+
133
+ ### Fill by Placeholder
134
+
135
+ ```gherkin
136
+ When I fill the placeholder {string} with {string}
137
+ ```
138
+
139
+ **Example:**
140
+ ```gherkin
141
+ When I fill the placeholder "Enter your email" with "test@example.com"
142
+ ```
143
+
144
+ ### Select Dropdown
145
+
146
+ ```gherkin
147
+ When I select {string} from dropdown {string}
148
+ Then I fill {string} into the {string} dropdown
149
+ ```
150
+
151
+ **Example:**
152
+ ```gherkin
153
+ When I select "Admin" from dropdown "Role"
154
+ Then I fill "United States" into the "Country" dropdown
155
+ ```
156
+
157
+ ### Upload a File (in-memory)
158
+
159
+ ```gherkin
160
+ When I set the file input {string} to a file named {string} with content {string}
161
+ ```
162
+
163
+ Content type is inferred from the extension (`.csv`, `.json`, `.xml`, otherwise `text/plain`).
164
+
165
+ **Example:**
166
+ ```gherkin
167
+ When I set the file input "#upload" to a file named "users.csv" with content "name,email\nAda,ada@example.com"
168
+ ```
169
+
170
+ ### Fill Form with Data Table
171
+
172
+ ```gherkin
173
+ When I fill the form:
174
+ | Field | Value |
175
+ | Email | test@test.com |
176
+ | Password | secret123 |
177
+ ```
178
+
179
+ ```gherkin
180
+ When I fill the form with {string} locators:
181
+ | Field | Value |
182
+ | #email | test@... |
183
+ | #password | secret |
184
+ ```
185
+
186
+ **Example:**
187
+ ```gherkin
188
+ When I fill the form:
189
+ | Field | Value |
190
+ | First Name | John |
191
+ | Last Name | Doe |
192
+ | Email | john@example.com |
193
+ ```
194
+
195
+ ### Clear and Fill
196
+
197
+ ```gherkin
198
+ Given I clear and fill the form:
199
+ | Field | Value |
200
+ ```
201
+
202
+ ### Fill and Submit
203
+
204
+ ```gherkin
205
+ When I fill and submit the form:
206
+ | Field | Value |
207
+ ```
208
+
209
+ ### Advanced Input
210
+
211
+ ```gherkin
212
+ When I {string} {string} in the {string} element with {string} {string}
213
+ ```
214
+
215
+ Actions: `type`, `fill`, `choose`
216
+
217
+ **Example:**
218
+ ```gherkin
219
+ When I "type" "Hello" in the "first" element with "placeholder" "Search"
220
+ When I "fill" "test@example.com" in the "1st" element with "label" "Email"
221
+ ```
222
+
223
+ ## Keyboard Steps
224
+
225
+ ### Type Text
226
+
227
+ ```gherkin
228
+ Then I {string} {string}
229
+ ```
230
+
231
+ **Example:**
232
+ ```gherkin
233
+ Then I "type" "Hello World"
234
+ Then I "press" "Enter"
235
+ Then I "press" "Tab"
236
+ Then I "press" "Escape"
237
+ ```
238
+
239
+ ## Wait Steps
240
+
241
+ ### Wait Fixed Time
242
+
243
+ ```gherkin
244
+ Then I wait {string} seconds
245
+ ```
246
+
247
+ **Example:**
248
+ ```gherkin
249
+ Then I wait "2" seconds
250
+ Then I wait "0.5" seconds
251
+ ```
252
+
253
+ ### Wait for Page Load
254
+
255
+ ```gherkin
256
+ Then I wait for the page to load
257
+ ```
258
+
259
+ ## Assertion Steps
260
+
261
+ ### Assert Visible Text
262
+
263
+ ```gherkin
264
+ Then I should see text {string}
265
+ ```
266
+
267
+ **Example:**
268
+ ```gherkin
269
+ Then I should see text "Welcome"
270
+ Then I should see text "User {userName} created"
271
+ ```
272
+
273
+ ### Assert URL
274
+
275
+ ```gherkin
276
+ Then the URL should contain {string}
277
+ Then I should be on page {string}
278
+ Then I verify if the URL {string} {string}
279
+ ```
280
+
281
+ URL modes: `contains`, `doesntContain`, `equals`
282
+
283
+ **Example:**
284
+ ```gherkin
285
+ Then the URL should contain "/dashboard"
286
+ Then I should be on page "/users"
287
+ Then I verify if the URL "contains" "/success"
288
+ Then I verify if the URL "equals" "https://example.com/home"
289
+ ```
290
+
291
+ ### Assert New Tab URL
292
+
293
+ ```gherkin
294
+ Then I verify if a new tab which URL {string} {string} opens
295
+ ```
296
+
297
+ **Example:**
298
+ ```gherkin
299
+ Then I verify if a new tab which URL "contains" "external-site.com" opens
300
+ ```
301
+
302
+ ### Assert Element Visibility
303
+
304
+ ```gherkin
305
+ Then the element {string} should be visible
306
+ Then the element {string} should not be visible
307
+ Then I verify that a {string} element with {string} text {string} visible
308
+ ```
309
+
310
+ **Example:**
311
+ ```gherkin
312
+ Then the element "#modal" should be visible
313
+ Then the element ".error-message" should not be visible
314
+ Then I verify that a "button" element with "Submit" text "is" visible
315
+ Then I verify that a "div" element with "Error" text "is not" visible
316
+ ```
317
+
318
+ ### Assert Element State
319
+
320
+ ```gherkin
321
+ Then I verify that {string} element with {string} {string} is {string}
322
+ Then I verify that {string} element with {string} {string} becomes {string} during {string} seconds
323
+ ```
324
+
325
+ States: `visible`, `hidden`, `editable`, `disabled`, `enabled`, `read-only`
326
+
327
+ **Example:**
328
+ ```gherkin
329
+ Then I verify that "first" element with "test ID" "submit-btn" is "enabled"
330
+ Then I verify that "1st" element with "label" "Email" is "editable"
331
+ Then I verify that "first" element with "text" "Loading" becomes "hidden" during "5" seconds
332
+ ```
333
+
334
+ ### Assert Element Value
335
+
336
+ ```gherkin
337
+ Then the element {string} should have value {string}
338
+ Then the element {string} should have attribute {string} equal to {string}
339
+ Then the element {string} should be checked
340
+ Then the element {string} should not be checked
341
+ ```
342
+
343
+ **Example:**
344
+ ```gherkin
345
+ Then the element "#email" should have value "test@example.com"
346
+ Then the element "#sidebar" should have attribute "data-state" equal to "expanded"
347
+ Then the element "#terms" should be checked
348
+ Then the element "#newsletter" should not be checked
349
+ ```
350
+
351
+ ## UI Authentication Steps
352
+
353
+ ### Auth with Fetch Intercept
354
+
355
+ ```gherkin
356
+ Given I am authenticated in UI as {string}
357
+ Given I am authenticated in UI as {string} for tenant {string}
358
+ Given I am authenticated in UI as {string} with id {string}
359
+ Given I am authenticated in UI with bearer token {string}
360
+ ```
361
+
362
+ **Example:**
363
+ ```gherkin
364
+ Given I am authenticated in UI as "admin,manager"
365
+ Given I am authenticated in UI as "user" for tenant "acme-corp"
366
+ Given I am authenticated in UI as "admin" with id "user-123"
367
+ Given I am authenticated in UI with bearer token "{authToken}"
368
+ ```
369
+
370
+ ### Switch User
371
+
372
+ ```gherkin
373
+ Given I switch UI user to {string} with id {string}
374
+ ```
375
+
376
+ ## Debug Steps
377
+
378
+ ### Pause for Debugging
379
+
380
+ ```gherkin
381
+ When I pause for debugging
382
+ ```
383
+
384
+ Opens Playwright Inspector for interactive debugging.
385
+
386
+ ### Logging
387
+
388
+ ```gherkin
389
+ Then I log the current URL
390
+ Then I log the page title
391
+ Then I print visible text
392
+ Then I log all cookies
393
+ Then I log localStorage
394
+ ```
395
+
396
+ ### Screenshots
397
+
398
+ ```gherkin
399
+ When I save a screenshot as {string}
400
+ When I save a full page screenshot as {string}
401
+ ```
402
+
403
+ **Example:**
404
+ ```gherkin
405
+ When I save a screenshot as "login-page"
406
+ When I save a full page screenshot as "full-dashboard"
407
+ ```
408
+
409
+ ### Capture Page Content
410
+
411
+ ```gherkin
412
+ When I capture the page HTML as {string}
413
+ When I capture viewport size
414
+ Then I count elements matching {string}
415
+ Then I print browser console messages
416
+ ```
417
+
418
+ ### Highlight Element
419
+
420
+ ```gherkin
421
+ When I highlight element {string}
422
+ ```
423
+
424
+ Adds red border to element for visual debugging.
425
+
426
+ ## Layout Steps
427
+
428
+ ### Panel Assertions
429
+
430
+ ```gherkin
431
+ Then I should see the {string} panel
432
+ Then I should not see the {string} panel
433
+ Then the {string} panel should be {string}
434
+ Then the {string} panel should be full width
435
+ Then the {string} panel should be narrow
436
+ ```
437
+
438
+ ### Split View
439
+
440
+ ```gherkin
441
+ Then I should see a split view layout
442
+ Then I should not see a split view layout
443
+ ```
444
+
445
+ ### Sidebar
446
+
447
+ ```gherkin
448
+ Then the sidebar should be visible
449
+ Then the sidebar should be hidden
450
+ Then the sidebar should be collapsed
451
+ ```
452
+
453
+ ### Modal
454
+
455
+ ```gherkin
456
+ Then I should see a modal dialog
457
+ Then I should not see a modal dialog
458
+ Then I should see the {string} modal
459
+ ```
460
+
461
+ ### Viewport
462
+
463
+ ```gherkin
464
+ Given the viewport is {string} size
465
+ Given the viewport is {int}x{int}
466
+ Then the layout should be responsive
467
+ ```
468
+
469
+ Sizes: `mobile`, `tablet`, `desktop`
470
+
471
+ **Example:**
472
+ ```gherkin
473
+ Given the viewport is "mobile" size
474
+ Given the viewport is 1920x1080
475
+ ```
476
+
477
+ ### Tabs
478
+
479
+ ```gherkin
480
+ Then the {string} tab should be active
481
+ Then the {string} tab should not be active
482
+ When I click the {string} tab
483
+ ```
484
+
485
+ ## Zoom
486
+
487
+ ```gherkin
488
+ Then I zoom to {string} in the browser
489
+ ```
490
+
491
+ **Example:**
492
+ ```gherkin
493
+ Then I zoom to "150" in the browser
494
+ ```
495
+
496
+ ## Complete UI Example
497
+
498
+ ```gherkin
499
+ @ui
500
+ Feature: User Login
501
+
502
+ Scenario: Successful login flow
503
+ Given I navigate to "/login"
504
+ When I fill in "Email" with "user@example.com"
505
+ And I fill in "Password" with "password123"
506
+ And I click the button "Sign In"
507
+ Then I should see text "Welcome back"
508
+ And the URL should contain "/dashboard"
509
+ And the element "#user-menu" should be visible
510
+
511
+ Scenario: Form validation
512
+ Given I navigate to "/register"
513
+ When I fill the form:
514
+ | Field | Value |
515
+ | First Name | John |
516
+ | Last Name | Doe |
517
+ | Email | invalid-email |
518
+ And I click the button "Register"
519
+ Then I should see text "Invalid email format"
520
+ And the element ".error-message" should be visible
521
+ ```