@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
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Internal Use Only License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Kata. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted to employees and contractors of Kata, and other authorized parties explicitly approved in writing by Kata, to use, copy, and modify this software solely for internal business purposes. Distribution, sublicensing, or use for any external or commercial purpose without prior written consent from Kata is prohibited.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @esimplicitylabs/katalyst-xspec
|
|
2
|
+
|
|
3
|
+
Reusable Playwright-BDD fixtures, ports, adapters, and step registrations for API, UI, and hybrid testing. Designed to be consumed as a dev dependency across repos.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @esimplicitylabs/katalyst-xspec @playwright/test playwright-bdd
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or scaffold a new project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @esimplicitylabs/katalyst-xspec init my-tests
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What’s included
|
|
18
|
+
|
|
19
|
+
- **Fixtures**: `createBddTest` wiring world, api/ui/auth/cleanup adapters.
|
|
20
|
+
- **Ports**: `ApiPort`, `UiPort`, `AuthPort`, `CleanupPort`.
|
|
21
|
+
- **Adapters**: Playwright API/UI adapters, default cleanup, example auth adapter.
|
|
22
|
+
- **Step registrations**: API (auth/http/assertions), UI (basic + wizard), shared vars/cleanup, hybrid helpers.
|
|
23
|
+
- **Config helpers**: tag expression helpers for project tagging.
|
|
24
|
+
|
|
25
|
+
## Minimal usage
|
|
26
|
+
|
|
27
|
+
1) Create fixtures (consumer repo):
|
|
28
|
+
```ts
|
|
29
|
+
// features/steps/fixtures.ts
|
|
30
|
+
import {
|
|
31
|
+
createBddTest,
|
|
32
|
+
PlaywrightApiAdapter,
|
|
33
|
+
PlaywrightUiAdapter,
|
|
34
|
+
UniversalAuthAdapter,
|
|
35
|
+
DefaultCleanupAdapter,
|
|
36
|
+
} from '@esimplicitylabs/katalyst-xspec';
|
|
37
|
+
|
|
38
|
+
export const { test } = createBddTest({
|
|
39
|
+
createApi: ({ apiRequest }) => new PlaywrightApiAdapter(apiRequest),
|
|
40
|
+
createUi: ({ page }) => new PlaywrightUiAdapter(page),
|
|
41
|
+
createAuth: ({ api, ui }) => new UniversalAuthAdapter({ api, ui }),
|
|
42
|
+
createCleanup: () => new DefaultCleanupAdapter(),
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2) Register steps (thin wrappers):
|
|
47
|
+
```ts
|
|
48
|
+
// features/steps/steps_api/index.ts
|
|
49
|
+
import { test } from '../fixtures';
|
|
50
|
+
import { registerApiSteps } from '@esimplicitylabs/katalyst-xspec/steps';
|
|
51
|
+
registerApiSteps(test);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3) Configure Playwright projects with your features/steps globs and tag expressions. Keep `@playwright/test` and `playwright-bdd` aligned with peer ranges.
|
|
55
|
+
|
|
56
|
+
## Publishing (npm)
|
|
57
|
+
|
|
58
|
+
Publishing is automated. The `.github/workflows/publish.yml` workflow builds the package and publishes it to the
|
|
59
|
+
public npm registry, authenticating via `actions/setup-node` with `registry-url: https://registry.npmjs.org` and the
|
|
60
|
+
`NODE_AUTH_TOKEN` secret. There is no `.npmrc` in this package and none is needed.
|
|
61
|
+
|
|
62
|
+
To release: bump `version` in `katalyst-xspec/package.json`, land the change, and the workflow publishes it. The
|
|
63
|
+
workflow skips any version already present on npm, so a change without a version bump merges green and never
|
|
64
|
+
reaches the registry.
|
|
65
|
+
|
|
66
|
+
## Notes
|
|
67
|
+
- Peer dependencies: `@playwright/test`, `playwright-bdd`, `typescript` must be installed in the consuming repo.
|
|
68
|
+
- Defaults (auth/cleanup) are examples; override via `createBddTest` options for app-specific behavior.
|
|
69
|
+
- Tagging: supports `@api`, `@ui`, `@hybrid`, plus your own (`@smoke`, `@slow`, `@external`); combine with Playwright’s `maxFailures`/reporters as needed.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Single entry point: `katalyst-xspec <command> [options]`.
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const COMMANDS = {
|
|
8
|
+
init: { file: 'init.cjs', summary: 'Scaffold a new katalyst-xspec test project' },
|
|
9
|
+
upgrade: { file: 'upgrade.cjs', summary: 'Upgrade katalyst-xspec, migrate scaffolding, update skills' },
|
|
10
|
+
stubs: { file: 'stubs.cjs', summary: 'Generate stubs for undefined step definitions' },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function usage() {
|
|
14
|
+
const width = Math.max(...Object.keys(COMMANDS).map((c) => c.length));
|
|
15
|
+
const lines = Object.entries(COMMANDS).map(([name, { summary }]) => ` ${name.padEnd(width)} ${summary}`);
|
|
16
|
+
return `Usage: katalyst-xspec <command> [options]
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
${lines.join('\n')}
|
|
20
|
+
|
|
21
|
+
Run "katalyst-xspec <command> --help" for command options.
|
|
22
|
+
|
|
23
|
+
New project: npx @esimplicitylabs/katalyst-xspec init
|
|
24
|
+
In a project: npx katalyst-xspec upgrade
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
29
|
+
|
|
30
|
+
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
|
31
|
+
process.stdout.write(usage());
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (command === '--version' || command === '-V') {
|
|
36
|
+
console.log(require('../package.json').version);
|
|
37
|
+
process.exit(0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const entry = COMMANDS[command];
|
|
41
|
+
if (!entry) {
|
|
42
|
+
console.error(`Unknown command: ${command}\n`);
|
|
43
|
+
process.stderr.write(usage());
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Subcommands parse process.argv.slice(2), so drop the command name.
|
|
48
|
+
process.argv = [process.argv[0], process.argv[1], ...rest];
|
|
49
|
+
require(path.join(__dirname, '..', 'cli', entry.file))
|
|
50
|
+
.main()
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
console.error(`[katalyst-xspec ${command}] ERROR: ${err && err.message ? err.message : err}`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
});
|