@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,151 @@
1
+ declare function registerApiHttpSteps(test: any): void;
2
+
3
+ declare function registerApiAssertionSteps(test: any): void;
4
+
5
+ declare function registerApiAuthSteps(test: any): void;
6
+
7
+ declare function registerHybridSteps(test: any): void;
8
+
9
+ declare function registerSharedCleanupSteps(test: any): void;
10
+
11
+ declare function registerSharedVarSteps(test: any): void;
12
+
13
+ /**
14
+ * Feature Flag Step Definitions
15
+ *
16
+ * Steps for managing feature flags in tests.
17
+ * These steps store flag state in the world object for use in other steps.
18
+ */
19
+ /**
20
+ * Check if a feature flag is enabled.
21
+ * Can be used by other steps for conditional logic.
22
+ */
23
+ declare function isFlagEnabled(world: any, flagName: string): boolean;
24
+ /**
25
+ * Set a feature flag value.
26
+ * Can be used programmatically by other steps or adapters.
27
+ */
28
+ declare function setFlag(world: any, flagName: string, enabled: boolean): void;
29
+ declare function registerFlagSteps(test: any): void;
30
+
31
+ declare function registerUiBasicSteps(test: any): void;
32
+
33
+ declare function registerWizardSteps(test: any): void;
34
+
35
+ /**
36
+ * UI Form Step Definitions
37
+ *
38
+ * Steps for bulk form filling using Gherkin data tables.
39
+ * Tagged with @ui or @hybrid for selective execution.
40
+ */
41
+ declare function registerFormSteps(test: any): void;
42
+
43
+ /**
44
+ * UI Debug Step Definitions
45
+ *
46
+ * Steps for debugging and troubleshooting UI tests.
47
+ * Tagged with @ui or @hybrid for selective execution.
48
+ */
49
+ declare function registerDebugSteps(test: any): void;
50
+
51
+ /**
52
+ * UI Layout Assertion Step Definitions
53
+ *
54
+ * Steps for asserting layout states like panels, split views, and responsive behavior.
55
+ * Tagged with @ui or @hybrid for selective execution.
56
+ */
57
+ declare function registerLayoutSteps(test: any): void;
58
+
59
+ /**
60
+ * UI Auth Step Definitions
61
+ *
62
+ * Steps for authenticating in UI tests using fetch interception.
63
+ * Tagged with @ui for selective execution.
64
+ */
65
+ declare function registerUiAuthSteps(test: any): void;
66
+
67
+ /**
68
+ * TUI Basic Step Definitions
69
+ *
70
+ * Basic step definitions for terminal user interface testing.
71
+ * Tagged with @tui for selective execution.
72
+ * Aligned with ui.basic.ts patterns for consistency.
73
+ */
74
+ declare function registerTuiBasicSteps(test: any): void;
75
+
76
+ /**
77
+ * TUI Wizard Step Definitions
78
+ *
79
+ * Advanced step definitions for terminal user interface testing.
80
+ * Tagged with @tui for selective execution.
81
+ * Aligned with ui.wizard.ts patterns for consistency.
82
+ */
83
+ declare function registerTuiWizardSteps(test: any): void;
84
+
85
+ /**
86
+ * Register all API step definitions.
87
+ * Steps are tagged with @api or @hybrid for selective execution.
88
+ */
89
+ declare function registerApiSteps(test: any): void;
90
+ /**
91
+ * Register all UI step definitions.
92
+ * Steps are tagged with @ui or @hybrid for selective execution.
93
+ *
94
+ * Includes:
95
+ * - Basic UI steps (navigation, clicks, fills)
96
+ * - Wizard steps (advanced interactions, locators, assertions)
97
+ * - Form steps (bulk form filling)
98
+ * - Debug steps (debugging utilities)
99
+ * - Layout steps (panel, split view, responsive assertions)
100
+ * - Auth steps (fetch interception auth)
101
+ */
102
+ declare function registerUiSteps(test: any): void;
103
+ /**
104
+ * Register shared step definitions (used by all test types).
105
+ *
106
+ * Includes:
107
+ * - Variable management steps
108
+ * - Cleanup steps
109
+ * - Feature flag steps
110
+ */
111
+ declare function registerSharedSteps(test: any): void;
112
+ /**
113
+ * Register hybrid step definitions.
114
+ * Steps that work with both API and UI in the same scenario.
115
+ */
116
+ declare function registerHybridSuite(test: any): void;
117
+ /**
118
+ * Register all TUI (Terminal User Interface) step definitions.
119
+ * Steps are tagged with @tui for selective execution.
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * import { createBddTest, registerTuiSteps, TuiTesterAdapter } from '@esimplicitylabs/katalyst-xspec';
124
+ *
125
+ * const test = createBddTest({
126
+ * createTui: () => new TuiTesterAdapter({
127
+ * command: ['node', 'dist/cli.js'],
128
+ * }),
129
+ * });
130
+ *
131
+ * registerTuiSteps(test);
132
+ * ```
133
+ */
134
+ declare function registerTuiSteps(test: any): void;
135
+ /**
136
+ * Register all step definitions for a full-featured test suite.
137
+ * This is a convenience function that registers API, UI, TUI, Shared, and Hybrid steps.
138
+ *
139
+ * Note: TUI steps require the optional `tui-tester` peer dependency.
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * import { createBddTest, registerAllSteps } from '@esimplicitylabs/katalyst-xspec';
144
+ *
145
+ * const test = createBddTest({ ... });
146
+ * registerAllSteps(test);
147
+ * ```
148
+ */
149
+ declare function registerAllSteps(test: any): void;
150
+
151
+ export { isFlagEnabled, registerAllSteps, registerApiAssertionSteps, registerApiAuthSteps, registerApiHttpSteps, registerApiSteps, registerDebugSteps, registerFlagSteps, registerFormSteps, registerHybridSteps, registerHybridSuite, registerLayoutSteps, registerSharedCleanupSteps, registerSharedSteps, registerSharedVarSteps, registerTuiBasicSteps, registerTuiSteps, registerTuiWizardSteps, registerUiAuthSteps, registerUiBasicSteps, registerUiSteps, registerWizardSteps, setFlag };
@@ -0,0 +1,50 @@
1
+ import {
2
+ isFlagEnabled,
3
+ registerAllSteps,
4
+ registerApiAssertionSteps,
5
+ registerApiAuthSteps,
6
+ registerApiHttpSteps,
7
+ registerApiSteps,
8
+ registerDebugSteps,
9
+ registerFlagSteps,
10
+ registerFormSteps,
11
+ registerHybridSteps,
12
+ registerHybridSuite,
13
+ registerLayoutSteps,
14
+ registerSharedCleanupSteps,
15
+ registerSharedSteps,
16
+ registerSharedVarSteps,
17
+ registerTuiBasicSteps,
18
+ registerTuiSteps,
19
+ registerTuiWizardSteps,
20
+ registerUiAuthSteps,
21
+ registerUiBasicSteps,
22
+ registerUiSteps,
23
+ registerWizardSteps,
24
+ setFlag
25
+ } from "../chunk-ACAXOGKZ.js";
26
+ export {
27
+ isFlagEnabled,
28
+ registerAllSteps,
29
+ registerApiAssertionSteps,
30
+ registerApiAuthSteps,
31
+ registerApiHttpSteps,
32
+ registerApiSteps,
33
+ registerDebugSteps,
34
+ registerFlagSteps,
35
+ registerFormSteps,
36
+ registerHybridSteps,
37
+ registerHybridSuite,
38
+ registerLayoutSteps,
39
+ registerSharedCleanupSteps,
40
+ registerSharedSteps,
41
+ registerSharedVarSteps,
42
+ registerTuiBasicSteps,
43
+ registerTuiSteps,
44
+ registerTuiWizardSteps,
45
+ registerUiAuthSteps,
46
+ registerUiBasicSteps,
47
+ registerUiSteps,
48
+ registerWizardSteps,
49
+ setFlag
50
+ };
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@esimplicitylabs/katalyst-xspec",
3
+ "version": "0.6.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./steps": {
14
+ "types": "./dist/steps/index.d.ts",
15
+ "import": "./dist/steps/index.js",
16
+ "default": "./dist/steps/index.js"
17
+ }
18
+ },
19
+ "description": "Playwright-BDD testing framework for API/UI/hybrid/TUI: fixtures, ports, adapters, step definitions, and the katalyst-xspec CLI (init, upgrade, stubs).",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/esimplicityinc/katalyst-xspec"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/esimplicityinc/katalyst-xspec/issues"
26
+ },
27
+ "homepage": "https://github.com/esimplicityinc/katalyst-xspec",
28
+ "license": "SEE LICENSE IN LICENSE",
29
+ "author": "Kata",
30
+ "keywords": [
31
+ "playwright",
32
+ "bdd",
33
+ "testing",
34
+ "cucumber",
35
+ "api",
36
+ "ui",
37
+ "hybrid",
38
+ "tui",
39
+ "terminal",
40
+ "cli"
41
+ ],
42
+ "files": [
43
+ "dist",
44
+ "bin",
45
+ "cli",
46
+ "skills",
47
+ "scripts"
48
+ ],
49
+ "engines": {
50
+ "node": ">=20"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "clean": "rm -rf dist",
55
+ "test": "node --import tsx --test src/__tests__/*.test.ts && node --test test/*.test.cjs",
56
+ "postinstall": "node scripts/postinstall.cjs"
57
+ },
58
+ "peerDependencies": {
59
+ "@playwright/test": "^1.49.0",
60
+ "playwright-bdd": "^9.1.0",
61
+ "tui-tester": "^1.0.0",
62
+ "typescript": "^5.6.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "tui-tester": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "devDependencies": {
70
+ "@types/node": "^22.10.0",
71
+ "tsup": "^8.3.0",
72
+ "tsx": "^4.19.2"
73
+ },
74
+ "publishConfig": {
75
+ "access": "public"
76
+ },
77
+ "bin": {
78
+ "katalyst-xspec": "bin/katalyst-xspec.cjs"
79
+ }
80
+ }
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { execSync } = require('child_process');
5
+
6
+ // ANSI color codes
7
+ const RESET = '\x1b[0m';
8
+ const BOLD = '\x1b[1m';
9
+ const RED = '\x1b[31m';
10
+ const YELLOW = '\x1b[33m';
11
+ const GREEN = '\x1b[32m';
12
+ const CYAN = '\x1b[36m';
13
+ const BG_YELLOW = '\x1b[43m';
14
+ const BG_RED = '\x1b[41m';
15
+ const BLACK = '\x1b[30m';
16
+
17
+ function checkCommand(cmd) {
18
+ try {
19
+ execSync(`which ${cmd}`, { stdio: 'pipe' });
20
+ return true;
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+
26
+ // Strip ANSI codes for length calculation
27
+ function stripAnsi(str) {
28
+ return str.replace(/\x1b\[[0-9;]*m/g, '');
29
+ }
30
+
31
+ function printBox(lines, color = YELLOW) {
32
+ const maxLen = Math.max(...lines.map(l => stripAnsi(l).length));
33
+ const border = '═'.repeat(maxLen + 2);
34
+
35
+ console.log(`${color}╔${border}╗${RESET}`);
36
+ for (const line of lines) {
37
+ const visibleLen = stripAnsi(line).length;
38
+ const padding = ' '.repeat(maxLen - visibleLen);
39
+ console.log(`${color}║${RESET} ${line}${padding} ${color}║${RESET}`);
40
+ }
41
+ console.log(`${color}╚${border}╝${RESET}`);
42
+ }
43
+
44
+ function main() {
45
+ // Allow testing with --test-warning flag
46
+ const testWarning = process.argv.includes('--test-warning');
47
+ const hasTmux = testWarning ? false : checkCommand('tmux');
48
+ const warnings = [];
49
+
50
+ // Check for tmux (needed for TUI testing)
51
+ if (!hasTmux) {
52
+ warnings.push({
53
+ title: 'tmux NOT FOUND',
54
+ lines: [
55
+ `${BOLD}TUI testing requires tmux${RESET}`,
56
+ '',
57
+ 'If you plan to use @tui tests, install tmux:',
58
+ '',
59
+ ` ${CYAN}macOS:${RESET} brew install tmux`,
60
+ ` ${CYAN}Ubuntu/Debian:${RESET} sudo apt-get install tmux`,
61
+ ` ${CYAN}Fedora/RHEL:${RESET} sudo dnf install tmux`,
62
+ '',
63
+ `${YELLOW}Skip this if you only use @api, @ui, or @hybrid tests.${RESET}`,
64
+ ],
65
+ });
66
+ }
67
+
68
+ // Print warnings if any
69
+ if (warnings.length > 0) {
70
+ console.log('');
71
+ console.log(`${BG_YELLOW}${BLACK}${BOLD} WARNING ${RESET}`);
72
+ console.log('');
73
+
74
+ for (const warning of warnings) {
75
+ printBox(warning.lines, YELLOW);
76
+ console.log('');
77
+ }
78
+ }
79
+
80
+ // Always show success message
81
+ console.log(`${GREEN}${BOLD}@esimplicitylabs/katalyst-xspec${RESET} installed successfully!`);
82
+ console.log('');
83
+ }
84
+
85
+ main();