@seontechnologies/playwright-utils 3.12.0 → 3.13.1

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 CHANGED
@@ -1,36 +1,38 @@
1
1
  # Playwright Utils
2
2
 
3
- A collection of utilities for Playwright tests at SEON Technologies, designed to make testing more efficient and maintainable.
3
+ A collection of utilities for Playwright tests, designed to make testing more efficient and maintainable.
4
4
 
5
- All utilities can be used as Playwright fixtures by importing the test object.
5
+ 📚 **[View the full documentation on GitHub Pages](https://seontechnologies.github.io/playwright-utils/)** or browse the [docs folder](./docs)
6
6
 
7
- ## Design Principles
7
+ ## One Pattern, Two Ways to Use
8
8
 
9
- Why this library was created:
9
+ Every utility follows the same design: **functional core, fixture shell**.
10
10
 
11
- - To bring consistent reusable Playwright utilities to projects at SEON.
12
- - To implement common testing patterns as **standardized fixtures**, to avoid duplication and boilerplate.
13
- - To follow a **functional-first** design: the core logic is always a standalone function that can be used directly, while fixtures provide convenience.
14
- - To support **typed API requests**, **polling patterns**, **auth session management**, **logging**, and **network interception** with clear APIs.
15
- - To make it easy to adopt and extend the utilities in other projects, without coupling tightly to any single app.
11
+ ```typescript
12
+ // Direct function - explicit dependencies
13
+ import { apiRequest } from '@seontechnologies/playwright-utils/api-request'
14
+ const result = await apiRequest({ request, method: 'GET', path: '/api/users' })
15
+
16
+ // Playwright fixture - injected, ready to use
17
+ test('example', async ({ apiRequest }) => {
18
+ const result = await apiRequest({ method: 'GET', path: '/api/users' })
19
+ })
20
+ ```
16
21
 
17
- Design patterns used:
22
+ Use functions for scripts and simple cases. Use fixtures for test suites.
18
23
 
19
- - **Fixture pattern**: all utilities can be consumed as fixtures to provide maximum flexibility.
20
- - **Functional core, fixture shell**: utilities can be used both directly and as fixtures.
21
- - **Decoupled logging and reporting**: logging is built to integrate cleanly into Playwright reports.
22
- - **Composable auth sessions**: auth session utilities can handle complex multi-user auth in a reusable way.
23
- - **Test-focused network interception**: network interception is designed for real-world test needs, not just simple mocking.
24
- - **Typed API request utility**: apiRequest provides a reusable, typed client for API tests and Playwright request fixture usage.
24
+ ## Utilities
25
25
 
26
- This library is not a general-purpose Playwright wrapper. It is designed to cover the most common test automation needs at SEON and to serve as a foundation for further project-specific extensions.
26
+ | Category | Utilities |
27
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
+ | **Agnostic** | [API Request](./docs/api-request.md), [Auth Session](./docs/auth-session.md), [Recurse](./docs/recurse.md), [Log](./docs/log.md), [File Utils](./docs/file-utils.md), [Burn-in](./docs/burn-in.md) |
29
+ | **Frontend** | [Network Interception](./docs/intercept-network-call.md), [Network Recorder](./docs/network-recorder.md), [Network Error Monitor](./docs/network-error-monitor.md) |
27
30
 
28
31
  - [Playwright Utils](#playwright-utils)
29
- - [Design Principles](#design-principles)
32
+ - [One Pattern, Two Ways to Use](#one-pattern-two-ways-to-use)
33
+ - [Utilities](#utilities)
30
34
  - [Installation](#installation)
31
- - [Module Format Support](#module-format-support)
32
35
  - [Development](#development)
33
- - [Testing Strategy](#testing-strategy)
34
36
  - [Available Utilities](#available-utilities)
35
37
  - [API Request](#api-request)
36
38
  - [Recurse (Polling)](#recurse-polling)
@@ -42,6 +44,8 @@ This library is not a general-purpose Playwright wrapper. It is designed to cove
42
44
  - [Network Recorder](#network-recorder)
43
45
  - [Burn-in](#burn-in)
44
46
  - [Network Error Monitor](#network-error-monitor)
47
+ - [Module Format Support](#module-format-support)
48
+ - [Testing Strategy in this repository](#testing-strategy-in-this-repository)
45
49
  - [Testing the Package Locally](#testing-the-package-locally)
46
50
  - [Release and Publishing](#release-and-publishing)
47
51
  - [Publishing via GitHub UI (Recommended)](#publishing-via-github-ui-recommended)
@@ -56,29 +60,6 @@ pnpm i -D @seontechnologies/playwright-utils
56
60
 
57
61
  > **Note:** This package requires `@playwright/test` as a peer dependency. It should already be installed in your repository.
58
62
 
59
- ## Module Format Support
60
-
61
- This package supports both CommonJS and ES Modules formats:
62
-
63
- - **CommonJS**: For projects using `require()` syntax or CommonJS module resolution
64
- - **ES Modules**: For projects using `import` syntax with ES modules
65
-
66
- The package automatically detects which format to use based on your project's configuration. This means:
67
-
68
- - You can use this package in both legacy CommonJS projects and modern ESM projects
69
- - No need to change import paths or add file extensions
70
- - TypeScript type definitions work for both formats
71
-
72
- Example usage:
73
-
74
- ```typescript
75
- // Works in both CommonJS and ESM environments
76
- import { log } from '@seontechnologies/playwright-utils'
77
-
78
- // Subpath imports also work in both formats
79
- import { recurse } from '@seontechnologies/playwright-utils/recurse'
80
- ```
81
-
82
63
  ## Development
83
64
 
84
65
  Quick start (this repo):
@@ -121,25 +102,6 @@ npm run test:pw # Run Playwright tests
121
102
  npm run test:pw-ui # Run Playwright tests with UI
122
103
  ```
123
104
 
124
- ### Testing Strategy
125
-
126
- The overall testing approach:
127
-
128
- 1. **Deployed Apps Tests** - Some tests use Playwright's deployed apps to keep things familiar (`log`, `interceptNetworkCall`):
129
- - `playwright/tests/network-mock-original.spec.ts`
130
- - `playwright/tests/todo-with-logs.spec.ts`
131
- - `playwright/tests/network-mock-intercept-network-call.spec.ts`
132
-
133
- 1. **Sample App Tests** - The `./sample-app` provides a more complex environment to test:
134
- - API request automation
135
- - Recursion and retry patterns
136
- - Authentication flows
137
- - Future: feature flag testing, email testing, etc.
138
-
139
- To start the sample app backend and frontend; `npm run start:sample-app`.
140
-
141
- The sample app uses `"@seontechnologies/playwright-utils": "*"` in its package.json so that changes to the library are immediately available for testing without requiring republishing or package updates.
142
-
143
105
  ## Available Utilities
144
106
 
145
107
  The library provides the following utilities, each with both direct function imports and Playwright fixtures:
@@ -676,6 +638,50 @@ test(
676
638
 
677
639
  Inspired by [Checkly's network monitoring pattern](https://github.com/checkly/checkly-playwright-examples/tree/main/network-monitoring). See [full docs](./docs/network-error-monitor.md).
678
640
 
641
+ ## Module Format Support
642
+
643
+ This package supports both CommonJS and ES Modules formats:
644
+
645
+ - **CommonJS**: For projects using `require()` syntax or CommonJS module resolution
646
+ - **ES Modules**: For projects using `import` syntax with ES modules
647
+
648
+ The package automatically detects which format to use based on your project's configuration. This means:
649
+
650
+ - You can use this package in both legacy CommonJS projects and modern ESM projects
651
+ - No need to change import paths or add file extensions
652
+ - TypeScript type definitions work for both formats
653
+
654
+ Example usage:
655
+
656
+ ```typescript
657
+ // Works in both CommonJS and ESM environments
658
+ import { log } from '@seontechnologies/playwright-utils'
659
+
660
+ // Subpath imports also work in both formats
661
+ import { recurse } from '@seontechnologies/playwright-utils/recurse'
662
+ ```
663
+
664
+ ### Testing Strategy in this repository
665
+
666
+ We showcase how to use the utilities in this repository through tests, often comparing and contrasting to vanilla Playwright patterns. We are using a backend and a frontend application to demonstrate more complex scenarios.
667
+
668
+ The overall testing approach:
669
+
670
+ 1. **Deployed Apps Tests** - Some tests use Playwright's deployed apps to keep things familiar (`log`, `interceptNetworkCall`):
671
+ - `playwright/tests/network-mock-original.spec.ts`
672
+ - `playwright/tests/todo-with-logs.spec.ts`
673
+ - `playwright/tests/network-mock-intercept-network-call.spec.ts`
674
+
675
+ 1. **Sample App Tests** - The `./sample-app` provides a more complex environment to test:
676
+ - API request automation
677
+ - Recursion and retry patterns
678
+ - Authentication flows
679
+ - Future: feature flag testing, email testing, etc.
680
+
681
+ To start the sample app backend and frontend; `npm run start:sample-app`.
682
+
683
+ The sample app uses `"@seontechnologies/playwright-utils": "*"` in its package.json so that changes to the library are immediately available for testing without requiring republishing or package updates.
684
+
679
685
  ## Testing the Package Locally
680
686
 
681
687
  ```bash
@@ -24,7 +24,7 @@
24
24
  * // Load JSON schema
25
25
  * const jsonSchema = await loadSchemaFromFile('./schemas/user.json')
26
26
  *
27
- * // Load YAML OpenAPI spec
27
+ * // Load YAML OpenAPI spec (requires js-yaml: npm install js-yaml)
28
28
  * const yamlSchema = await loadSchemaFromFile('./openapi/api.yaml')
29
29
  * ```
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
1
+ {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
@@ -46,7 +46,6 @@ exports.isValidSchemaFile = isValidSchemaFile;
46
46
  exports.getAllowedExtensions = getAllowedExtensions;
47
47
  const fs = __importStar(require("fs"));
48
48
  const path = __importStar(require("path"));
49
- const yaml = __importStar(require("js-yaml"));
50
49
  /**
51
50
  * Allowed file extensions for schema files
52
51
  */
@@ -69,7 +68,7 @@ const ALLOWED_EXTENSIONS = ['.json', '.yaml', '.yml'];
69
68
  * // Load JSON schema
70
69
  * const jsonSchema = await loadSchemaFromFile('./schemas/user.json')
71
70
  *
72
- * // Load YAML OpenAPI spec
71
+ * // Load YAML OpenAPI spec (requires js-yaml: npm install js-yaml)
73
72
  * const yamlSchema = await loadSchemaFromFile('./openapi/api.yaml')
74
73
  * ```
75
74
  *
@@ -94,8 +93,15 @@ async function loadSchemaFromFile(filePath) {
94
93
  const content = fs.readFileSync(resolvedPath, 'utf8');
95
94
  // Parse based on file extension
96
95
  if (filePath.endsWith('.yaml') || filePath.endsWith('.yml')) {
97
- // Security: yaml.load() is safe by default in js-yaml v4+ (no code execution)
98
- return yaml.load(content);
96
+ // Dynamic import - js-yaml is an optional peer dependency
97
+ try {
98
+ const yaml = await Promise.resolve().then(() => __importStar(require('js-yaml')));
99
+ // Security: yaml.load() is safe by default in js-yaml v4+ (no code execution)
100
+ return yaml.load(content);
101
+ }
102
+ catch {
103
+ throw new Error('YAML schema support requires js-yaml. Install it with: npm install js-yaml');
104
+ }
99
105
  }
100
106
  else {
101
107
  return JSON.parse(content);
@@ -1 +1 @@
1
- {"version":3,"file":"file-loader.js","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCH,gDAoCC;AAQD,8CAKC;AAOD,oDAEC;AA9FD,uCAAwB;AACxB,2CAA4B;AAC5B,8CAA+B;AAE/B;;GAEG;AACH,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,kBAAkB,CAAC,QAAgB;IACvD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAE3C,wEAAwE;QACxE,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;QAC1D,IACE,CAAC,kBAAkB,CAAC,QAAQ,CAC1B,aAAoD,CACrD,EACD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,2BAA2B,aAAa,cAAc,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtF,CAAA;QACH,CAAC;QAED,uBAAuB;QACvB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,0BAA0B,YAAY,EAAE,CAAC,CAAA;QAC3D,CAAC;QAED,oBAAoB;QACpB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QAErD,gCAAgC;QAChC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5D,8EAA8E;YAC9E,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAW,CAAA;QACrC,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACxF,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;IAC1D,OAAO,kBAAkB,CAAC,QAAQ,CAChC,aAAoD,CACrD,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB;IAClC,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"file-loader.js","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCH,gDA4CC;AAQD,8CAKC;AAOD,oDAEC;AArGD,uCAAwB;AACxB,2CAA4B;AAE5B;;GA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AAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACxF,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;IAC1D,OAAO,kBAAkB,CAAC,QAAQ,CAChC,aAAoD,CACrD,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB;IAClC,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
@@ -24,7 +24,7 @@
24
24
  * // Load JSON schema
25
25
  * const jsonSchema = await loadSchemaFromFile('./schemas/user.json')
26
26
  *
27
- * // Load YAML OpenAPI spec
27
+ * // Load YAML OpenAPI spec (requires js-yaml: npm install js-yaml)
28
28
  * const yamlSchema = await loadSchemaFromFile('./openapi/api.yaml')
29
29
  * ```
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
1
+ {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
@@ -46,7 +46,6 @@ exports.isValidSchemaFile = isValidSchemaFile;
46
46
  exports.getAllowedExtensions = getAllowedExtensions;
47
47
  const fs = __importStar(require("fs"));
48
48
  const path = __importStar(require("path"));
49
- const yaml = __importStar(require("js-yaml"));
50
49
  /**
51
50
  * Allowed file extensions for schema files
52
51
  */
@@ -69,7 +68,7 @@ const ALLOWED_EXTENSIONS = ['.json', '.yaml', '.yml'];
69
68
  * // Load JSON schema
70
69
  * const jsonSchema = await loadSchemaFromFile('./schemas/user.json')
71
70
  *
72
- * // Load YAML OpenAPI spec
71
+ * // Load YAML OpenAPI spec (requires js-yaml: npm install js-yaml)
73
72
  * const yamlSchema = await loadSchemaFromFile('./openapi/api.yaml')
74
73
  * ```
75
74
  *
@@ -94,8 +93,15 @@ async function loadSchemaFromFile(filePath) {
94
93
  const content = fs.readFileSync(resolvedPath, 'utf8');
95
94
  // Parse based on file extension
96
95
  if (filePath.endsWith('.yaml') || filePath.endsWith('.yml')) {
97
- // Security: yaml.load() is safe by default in js-yaml v4+ (no code execution)
98
- return yaml.load(content);
96
+ // Dynamic import - js-yaml is an optional peer dependency
97
+ try {
98
+ const yaml = await import('js-yaml');
99
+ // Security: yaml.load() is safe by default in js-yaml v4+ (no code execution)
100
+ return yaml.load(content);
101
+ }
102
+ catch {
103
+ throw new Error('YAML schema support requires js-yaml. Install it with: npm install js-yaml');
104
+ }
99
105
  }
100
106
  else {
101
107
  return JSON.parse(content);
@@ -1 +1 @@
1
- {"version":3,"file":"file-loader.js","sourceRoot":"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AAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACxF,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;IAC1D,OAAO,kBAAkB,CAAC,QAAQ,CAChC,aAAoD,CACrD,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB;IAClC,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"file-loader.js","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCH,gDA4CC;AAQD,8CAKC;AAOD,oDAEC;AArGD,uCAAwB;AACxB,2CAA4B;AAE5B;;GAEG;AACH,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,kBAAkB,CAAC,QAAgB;IACvD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAE3C,wEAAwE;QACxE,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;QAC1D,IACE,CAAC,kBAAkB,CAAC,QAAQ,CAC1B,aAAoD,CACrD,EACD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,2BAA2B,aAAa,cAAc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AAoB;IAClC,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
@@ -24,7 +24,7 @@
24
24
  * // Load JSON schema
25
25
  * const jsonSchema = await loadSchemaFromFile('./schemas/user.json')
26
26
  *
27
- * // Load YAML OpenAPI spec
27
+ * // Load YAML OpenAPI spec (requires js-yaml: npm install js-yaml)
28
28
  * const yamlSchema = await loadSchemaFromFile('./openapi/api.yaml')
29
29
  * ```
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
1
+ {"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../../../../src/api-request/schema-validation/internal/file-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seontechnologies/playwright-utils",
3
- "version": "3.12.0",
3
+ "version": "3.13.1",
4
4
  "description": "A collection of utilities for Playwright.",
5
5
  "workspaces": [
6
6
  "sample-app/*"
@@ -165,7 +165,10 @@
165
165
  "test:pw:burn-in": "PW_BURN_IN=true npx playwright test --repeat-each=3 --retries=0",
166
166
  "test:pw:burn-in-changed-classic": "PW_BURN_IN=true npx playwright test --only-changed=main --repeat-each=3 --retries=0",
167
167
  "test:pw:burn-in-changed": "tsx playwright/scripts/burn-in-changed.ts",
168
- "show:report": "npx playwright show-report --port 9324"
168
+ "show:report": "npx playwright show-report --port 9324",
169
+ "docs:dev": "DOCS_BASE=/ vitepress dev docs",
170
+ "docs:build": "vitepress build docs",
171
+ "docs:preview": "DOCS_BASE=/ vitepress preview docs"
169
172
  },
170
173
  "peerDependencies": {
171
174
  "@playwright/test": ">=1.54.1",
@@ -221,13 +224,13 @@
221
224
  "tsx": "4.20.6",
222
225
  "typescript": "5.9.3",
223
226
  "vite": "6.4.1",
227
+ "vitepress": "^1.6.4",
224
228
  "zod": "4.1.12"
225
229
  },
226
230
  "dependencies": {
227
231
  "adm-zip": "0.5.16",
228
232
  "deepmerge": "4.3.1",
229
233
  "exceljs": "4.4.0",
230
- "js-yaml": "4.1.0",
231
234
  "madge": "7.0.0",
232
235
  "papaparse": "5.5.3",
233
236
  "picomatch": "4.0.3",