@humanjs/playwright 0.7.0 → 0.8.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/README.md +22 -0
- package/dist/chunk-CCZEDNOF.js +1915 -0
- package/dist/chunk-CCZEDNOF.js.map +1 -0
- package/dist/chunk-RCMSDC3N.cjs +1998 -0
- package/dist/chunk-RCMSDC3N.cjs.map +1 -0
- package/dist/index.cjs +37 -1785
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -4
- package/dist/index.d.ts +100 -4
- package/dist/index.js +1 -1759
- package/dist/index.js.map +1 -1
- package/dist/test.cjs +26 -0
- package/dist/test.cjs.map +1 -0
- package/dist/test.d.cts +32 -0
- package/dist/test.d.ts +32 -0
- package/dist/test.js +21 -0
- package/dist/test.js.map +1 -0
- package/package.json +28 -4
package/README.md
CHANGED
|
@@ -54,6 +54,28 @@ await human.type('input[name="email"]', 'gonzalo@example.com');
|
|
|
54
54
|
|
|
55
55
|
Pass a `seed` and every random decision (path curvature, typo placement, keystroke jitter) becomes reproducible. Same seed + same personality + same value = same keystrokes.
|
|
56
56
|
|
|
57
|
+
### Playwright Test fixture
|
|
58
|
+
|
|
59
|
+
Writing `@playwright/test` specs? Import from the `@humanjs/playwright/test` subpath instead of constructing a `Human` in every test. It extends Playwright's `test` with a `human` fixture — seeded from the test title (deterministic per test) and instant in CI / humanized locally:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { test, expect } from '@humanjs/playwright/test';
|
|
63
|
+
|
|
64
|
+
test('checkout flow', async ({ human, page }) => {
|
|
65
|
+
await human.goto('/');
|
|
66
|
+
await human.click('Buy now');
|
|
67
|
+
await expect(page).toHaveURL(/checkout/);
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Customize per file (or per project via `playwright.config.ts` `use`) with the `humanOptions` option:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
test.use({ humanOptions: { personality: 'distracted', speed: 'human' } });
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Requires `@playwright/test` (an optional peer — you already have it to run the tests).
|
|
78
|
+
|
|
57
79
|
### Primitives
|
|
58
80
|
|
|
59
81
|
The full `Human` surface, at a glance. Each one fires real DOM events through Playwright; the humanization wraps the timing and the path, not the dispatch.
|