@esimplicity/stack-tests 0.1.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 +77 -0
- package/dist/chunk-YPUQQZM2.js +827 -0
- package/dist/index.d.ts +540 -0
- package/dist/index.js +881 -0
- package/dist/steps/index.d.ts +58 -0
- package/dist/steps/index.js +34 -0
- package/package.json +65 -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,77 @@
|
|
|
1
|
+
# @kata/stack-tests
|
|
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
|
+
GitHub Packages (recommended for release builds):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm config set @kata:registry https://npm.pkg.github.com
|
|
11
|
+
npm set //npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
12
|
+
npm install -D @kata/stack-tests @playwright/test playwright-bdd
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Workspace/local development (from this monorepo):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun add -d @kata/stack-tests@"file:../packages/stack-tests" @playwright/test playwright-bdd
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What’s included
|
|
22
|
+
|
|
23
|
+
- **Fixtures**: `createBddTest` wiring world, api/ui/auth/cleanup adapters.
|
|
24
|
+
- **Ports**: `ApiPort`, `UiPort`, `AuthPort`, `CleanupPort`.
|
|
25
|
+
- **Adapters**: Playwright API/UI adapters, default cleanup, example auth adapter.
|
|
26
|
+
- **Step registrations**: API (auth/http/assertions), UI (basic + wizard), shared vars/cleanup, hybrid helpers.
|
|
27
|
+
- **Config helpers**: tag expression helpers for project tagging.
|
|
28
|
+
|
|
29
|
+
## Minimal usage
|
|
30
|
+
|
|
31
|
+
1) Create fixtures (consumer repo):
|
|
32
|
+
```ts
|
|
33
|
+
// features/steps/fixtures.ts
|
|
34
|
+
import {
|
|
35
|
+
createBddTest,
|
|
36
|
+
PlaywrightApiAdapter,
|
|
37
|
+
PlaywrightUiAdapter,
|
|
38
|
+
UniversalAuthAdapter,
|
|
39
|
+
DefaultCleanupAdapter,
|
|
40
|
+
} from '@kata/stack-tests';
|
|
41
|
+
|
|
42
|
+
export const test = createBddTest({
|
|
43
|
+
createApi: ({ apiRequest }) => new PlaywrightApiAdapter(apiRequest),
|
|
44
|
+
createUi: ({ page }) => new PlaywrightUiAdapter(page),
|
|
45
|
+
createAuth: ({ api, ui }) => new UniversalAuthAdapter({ api, ui }),
|
|
46
|
+
createCleanup: () => new DefaultCleanupAdapter(),
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
2) Register steps (thin wrappers):
|
|
51
|
+
```ts
|
|
52
|
+
// features/steps/steps_api/index.ts
|
|
53
|
+
import { test } from '../fixtures';
|
|
54
|
+
import { registerApiSteps } from '@kata/stack-tests/steps';
|
|
55
|
+
registerApiSteps(test);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3) Configure Playwright projects with your features/steps globs and tag expressions. Keep `@playwright/test` and `playwright-bdd` aligned with peer ranges.
|
|
59
|
+
|
|
60
|
+
## Publishing (GitHub Packages)
|
|
61
|
+
|
|
62
|
+
- Ensure `.npmrc` includes:
|
|
63
|
+
```
|
|
64
|
+
@kata:registry=https://npm.pkg.github.com
|
|
65
|
+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
|
|
66
|
+
```
|
|
67
|
+
- Build then publish:
|
|
68
|
+
```bash
|
|
69
|
+
npm run build
|
|
70
|
+
npm publish --access public
|
|
71
|
+
```
|
|
72
|
+
(Adjust access per your org policy.)
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
- Peer dependencies: `@playwright/test`, `playwright-bdd`, `typescript` must be installed in the consuming repo.
|
|
76
|
+
- Defaults (auth/cleanup) are examples; override via `createBddTest` options for app-specific behavior.
|
|
77
|
+
- Tagging: supports `@api`, `@ui`, `@hybrid`, plus your own (`@smoke`, `@slow`, `@external`); combine with Playwright’s `maxFailures`/reporters as needed.
|