@syngrisi/playwright-sdk 2.4.0 → 2.5.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 +126 -13
- package/dist/PlaywrightDriver.d.ts +60 -13
- package/dist/PlaywrightDriver.d.ts.map +1 -1
- package/dist/PlaywrightDriver.js +98 -3
- package/dist/PlaywrightDriver.js.map +1 -1
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/schemas/Baseline.schema.d.ts +2 -32
- package/dist/schemas/Baseline.schema.d.ts.map +1 -1
- package/dist/schemas/Check.schema.d.ts +1 -27
- package/dist/schemas/Check.schema.d.ts.map +1 -1
- package/dist/schemas/SessionParams.schema.d.ts +2 -28
- package/dist/schemas/SessionParams.schema.d.ts.map +1 -1
- package/package.json +5 -5
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/types/index.d.ts +10 -0
package/README.md
CHANGED
|
@@ -40,8 +40,10 @@ Before starting your test session, initialize the driver with the necessary conf
|
|
|
40
40
|
import { PlaywrightDriver } from '@syngrisi/playwright-sdk';
|
|
41
41
|
|
|
42
42
|
const config = {
|
|
43
|
+
page: page, // Playwright page object
|
|
44
|
+
url: 'your-syngrisi-url',
|
|
43
45
|
apiKey: 'your-api-key',
|
|
44
|
-
|
|
46
|
+
autoAccept: false // Optional: auto-accept new baselines (default: false)
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
const driver = new PlaywrightDriver(config);
|
|
@@ -74,12 +76,11 @@ await driver.startTestSession({ params: sessionParams });
|
|
|
74
76
|
Perform a visual check by providing the check name, image buffer, and any additional parameters.
|
|
75
77
|
|
|
76
78
|
```js
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
imageBuffer: fullPageSreenshot,
|
|
79
|
+
// Full page screenshot
|
|
80
|
+
const fullPageScreenshot = await page.screenshot({ fullPage: true });
|
|
81
|
+
await driver.check({
|
|
82
|
+
checkName: 'Full Page',
|
|
83
|
+
imageBuffer: fullPageScreenshot,
|
|
83
84
|
params: {
|
|
84
85
|
viewport: '1200x800',
|
|
85
86
|
browserName: 'chrome',
|
|
@@ -89,14 +90,45 @@ driver.check({
|
|
|
89
90
|
}
|
|
90
91
|
});
|
|
91
92
|
|
|
92
|
-
//
|
|
93
|
-
|
|
93
|
+
// Element screenshot with per-check autoAccept
|
|
94
|
+
const headerScreenshot = await page.locator('#header').screenshot();
|
|
95
|
+
await driver.check({
|
|
94
96
|
checkName: 'Header',
|
|
95
97
|
imageBuffer: headerScreenshot,
|
|
96
|
-
params: {
|
|
98
|
+
params: {
|
|
99
|
+
autoAccept: true // Auto-accept this specific check if new
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Auto-Accept Mode
|
|
105
|
+
|
|
106
|
+
When `autoAccept` is enabled, new checks (with no existing baseline) are automatically accepted as the new baseline. This is useful for:
|
|
107
|
+
- Initial test runs when establishing baselines
|
|
108
|
+
- CI/CD pipelines where human review isn't needed for new checks
|
|
109
|
+
- Development workflows where baselines change frequently
|
|
110
|
+
|
|
111
|
+
You can enable auto-accept at two levels:
|
|
112
|
+
|
|
113
|
+
1. **Driver level** (applies to all checks):
|
|
114
|
+
```js
|
|
115
|
+
const driver = new PlaywrightDriver({
|
|
116
|
+
page: page,
|
|
117
|
+
url: 'your-syngrisi-url',
|
|
118
|
+
apiKey: 'your-api-key',
|
|
119
|
+
autoAccept: true
|
|
97
120
|
});
|
|
121
|
+
```
|
|
98
122
|
|
|
99
|
-
|
|
123
|
+
2. **Check level** (overrides driver setting for specific check):
|
|
124
|
+
```js
|
|
125
|
+
await driver.check({
|
|
126
|
+
checkName: 'Header',
|
|
127
|
+
imageBuffer: screenshot,
|
|
128
|
+
params: {
|
|
129
|
+
autoAccept: true // or false to disable for this check
|
|
130
|
+
}
|
|
131
|
+
});
|
|
100
132
|
```
|
|
101
133
|
|
|
102
134
|
### 4. Stop the Test Session
|
|
@@ -107,6 +139,85 @@ Once all checks are completed, stop the test session.
|
|
|
107
139
|
await driver.stopTestSession();
|
|
108
140
|
```
|
|
109
141
|
|
|
142
|
+
## Additional Methods
|
|
143
|
+
|
|
144
|
+
### Accept a Check
|
|
145
|
+
|
|
146
|
+
Programmatically accept a check by setting a new baseline:
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
const result = await driver.acceptCheck({
|
|
150
|
+
checkId: 'check-id-123',
|
|
151
|
+
baselineId: 'baseline-id-456'
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Get Baselines
|
|
156
|
+
|
|
157
|
+
Fetch existing baselines matching criteria:
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
const baselines = await driver.getBaselines({
|
|
161
|
+
params: {
|
|
162
|
+
name: 'Header',
|
|
163
|
+
app: 'MyProject',
|
|
164
|
+
branch: 'main'
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Get Snapshots
|
|
170
|
+
|
|
171
|
+
Retrieve snapshots based on search criteria:
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
const snapshots = await driver.getSnapshots({
|
|
175
|
+
params: {
|
|
176
|
+
name: 'Header',
|
|
177
|
+
app: 'MyProject',
|
|
178
|
+
branch: 'main'
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Set Ignore Regions
|
|
184
|
+
|
|
185
|
+
Set regions to exclude from visual comparison on a baseline:
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
// First, get the baseline
|
|
189
|
+
const baselines = await driver.getBaselines({
|
|
190
|
+
params: {
|
|
191
|
+
name: 'Header',
|
|
192
|
+
app: 'MyProject',
|
|
193
|
+
branch: 'main'
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// Set ignore regions (coordinates in pixels)
|
|
198
|
+
await driver.setIgnoreRegions({
|
|
199
|
+
baselineId: baselines.results[0]._id,
|
|
200
|
+
regions: [
|
|
201
|
+
{ left: 0, top: 0, right: 100, bottom: 50 }, // Top banner area
|
|
202
|
+
{ left: 200, top: 300, right: 400, bottom: 350 } // Dynamic content
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// Or use the Region helper class
|
|
207
|
+
await driver.setIgnoreRegions({
|
|
208
|
+
baselineId: 'baseline-id-123',
|
|
209
|
+
regions: [
|
|
210
|
+
new PlaywrightDriver.Region(0, 0, 100, 50)
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Region coordinates:
|
|
216
|
+
- `left`: X coordinate of the left edge
|
|
217
|
+
- `top`: Y coordinate of the top edge
|
|
218
|
+
- `right`: X coordinate of the right edge
|
|
219
|
+
- `bottom`: Y coordinate of the bottom edge
|
|
220
|
+
|
|
110
221
|
## Environment variables
|
|
111
222
|
|
|
112
223
|
Environment variables are used to modify the behavior of the Syngrisi Playwright SDK without code changes.
|
|
@@ -116,14 +227,16 @@ Example: To set the log level to debug, use the following command:
|
|
|
116
227
|
Windows: `set SYNGRISI_LOG_LEVEL=debug`
|
|
117
228
|
macOS/Linux: `export SYNGRISI_LOG_LEVEL=debug`
|
|
118
229
|
|
|
230
|
+
`ENV_POSTFIX` - will add to platform property, you can use this to set some unique platform name for particular
|
|
231
|
+
environment
|
|
119
232
|
`SYNGRISI_LOG_LEVEL` - logging level (`"trace" | "debug" | "info" | "warn" | "error"`)
|
|
120
233
|
|
|
121
234
|
## Documentation
|
|
122
235
|
|
|
123
236
|
For detailed information about all available methods, parameters, and configurations, please refer to
|
|
124
|
-
the [Syngrisi
|
|
237
|
+
the [Syngrisi GitHub repository](https://github.com/syngrisi/syngrisi).
|
|
125
238
|
|
|
126
239
|
## License
|
|
127
240
|
|
|
128
|
-
This project is licensed under the
|
|
241
|
+
This project is licensed under the ISC License.
|
|
129
242
|
|
|
@@ -15,6 +15,7 @@ export declare class PlaywrightDriver {
|
|
|
15
15
|
browserName: BrowserName;
|
|
16
16
|
viewport: ViewportSize;
|
|
17
17
|
params: Params;
|
|
18
|
+
private autoAccept;
|
|
18
19
|
/**
|
|
19
20
|
* Constructs the PlaywrightDriver instance for interacting with Syngrisi API.
|
|
20
21
|
* Initializes with Playwright's page object, Syngrisi API configuration, and default parameters setup.
|
|
@@ -26,9 +27,10 @@ export declare class PlaywrightDriver {
|
|
|
26
27
|
* page: await browser.newPage(), // assuming 'browser' is a Playwright Browser instance
|
|
27
28
|
* url: 'your-syngrisi-url', // Syngrisi server URL
|
|
28
29
|
* apiKey: 'your-api-key', // API key for Syngrisi server authentication
|
|
30
|
+
* autoAccept: true // Automatically accept new baselines
|
|
29
31
|
* });
|
|
30
32
|
*/
|
|
31
|
-
constructor({ page, url, apiKey }: Config);
|
|
33
|
+
constructor({ page, url, apiKey, autoAccept }: Config);
|
|
32
34
|
/**
|
|
33
35
|
* Starts a new test session with the given parameters.
|
|
34
36
|
* If parameters [os, viewport, browserName, browserVersion, browserFullVersion] are not provided,
|
|
@@ -89,9 +91,7 @@ export declare class PlaywrightDriver {
|
|
|
89
91
|
getBaselines({ params }: {
|
|
90
92
|
params: BaselineParams;
|
|
91
93
|
}): Promise<ErrorObject | {
|
|
92
|
-
results:
|
|
93
|
-
[x: string]: any;
|
|
94
|
-
}[];
|
|
94
|
+
results: Record<string, unknown>[];
|
|
95
95
|
page: number;
|
|
96
96
|
limit: number;
|
|
97
97
|
totalPages: number;
|
|
@@ -133,7 +133,8 @@ export declare class PlaywrightDriver {
|
|
|
133
133
|
* browserName: 'chrome',
|
|
134
134
|
* os: 'Windows',
|
|
135
135
|
* app: 'MyProject',
|
|
136
|
-
* branch: 'develop'
|
|
136
|
+
* branch: 'develop',
|
|
137
|
+
* autoAccept: true // Auto-accept if no baseline exists
|
|
137
138
|
* },
|
|
138
139
|
* suppressErrors: false
|
|
139
140
|
* });
|
|
@@ -145,27 +146,27 @@ export declare class PlaywrightDriver {
|
|
|
145
146
|
domDump?: any;
|
|
146
147
|
suppressErrors?: boolean;
|
|
147
148
|
}): Promise<ErrorObject | {
|
|
148
|
-
_id: string;
|
|
149
149
|
name: string;
|
|
150
|
-
createdDate: string;
|
|
151
|
-
status: string | string[];
|
|
152
|
-
viewport: string;
|
|
153
|
-
browserName: string;
|
|
154
|
-
os: string;
|
|
155
|
-
app: string;
|
|
156
|
-
branch: string;
|
|
157
150
|
test: string;
|
|
158
151
|
suite: string;
|
|
152
|
+
app: string;
|
|
153
|
+
branch: string;
|
|
159
154
|
baselineId: string;
|
|
160
155
|
actualSnapshotId: string;
|
|
161
156
|
updatedDate: string;
|
|
157
|
+
status: string | string[];
|
|
158
|
+
browserName: string;
|
|
162
159
|
browserVersion: string | number;
|
|
163
160
|
browserFullVersion: string;
|
|
161
|
+
viewport: string;
|
|
162
|
+
os: string;
|
|
164
163
|
result: string;
|
|
165
164
|
run: string;
|
|
166
165
|
creatorId: string;
|
|
167
166
|
creatorUsername: string;
|
|
168
167
|
failReasons: any[];
|
|
168
|
+
_id: string;
|
|
169
|
+
createdDate: string;
|
|
169
170
|
currentSnapshot: {
|
|
170
171
|
_id?: string | undefined;
|
|
171
172
|
name?: string | undefined;
|
|
@@ -200,5 +201,51 @@ export declare class PlaywrightDriver {
|
|
|
200
201
|
baselineId: string;
|
|
201
202
|
suppressErrors?: boolean;
|
|
202
203
|
}): Promise<CheckResponse | ErrorObject>;
|
|
204
|
+
/**
|
|
205
|
+
* Region to ignore during visual comparison.
|
|
206
|
+
* Coordinates are in pixels relative to the image.
|
|
207
|
+
*/
|
|
208
|
+
static Region: {
|
|
209
|
+
new (left: number, top: number, right: number, bottom: number): {
|
|
210
|
+
left: number;
|
|
211
|
+
top: number;
|
|
212
|
+
right: number;
|
|
213
|
+
bottom: number;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Sets ignore regions on a baseline. These regions will be excluded from visual comparison.
|
|
218
|
+
* @param {string} baselineId - The unique identifier of the baseline.
|
|
219
|
+
* @param {Array<{left: number, top: number, right: number, bottom: number}>} regions - Array of region objects.
|
|
220
|
+
* @param {boolean} [suppressErrors=false] - Flag to suppress thrown errors.
|
|
221
|
+
* @returns {Promise<any | ErrorObject>} The update result or an error object.
|
|
222
|
+
* @example
|
|
223
|
+
* // Set ignore regions on a baseline
|
|
224
|
+
* await driver.setIgnoreRegions({
|
|
225
|
+
* baselineId: 'baseline-id-123',
|
|
226
|
+
* regions: [
|
|
227
|
+
* { left: 0, top: 0, right: 100, bottom: 50 }, // Top banner
|
|
228
|
+
* { left: 200, top: 300, right: 400, bottom: 350 } // Dynamic content area
|
|
229
|
+
* ]
|
|
230
|
+
* });
|
|
231
|
+
*
|
|
232
|
+
* // Using Region helper class
|
|
233
|
+
* await driver.setIgnoreRegions({
|
|
234
|
+
* baselineId: 'baseline-id-123',
|
|
235
|
+
* regions: [
|
|
236
|
+
* new PlaywrightDriver.Region(0, 0, 100, 50)
|
|
237
|
+
* ]
|
|
238
|
+
* });
|
|
239
|
+
*/
|
|
240
|
+
setIgnoreRegions({ baselineId, regions, suppressErrors }: {
|
|
241
|
+
baselineId: string;
|
|
242
|
+
regions: Array<{
|
|
243
|
+
left: number;
|
|
244
|
+
top: number;
|
|
245
|
+
right: number;
|
|
246
|
+
bottom: number;
|
|
247
|
+
}>;
|
|
248
|
+
suppressErrors?: boolean;
|
|
249
|
+
}): Promise<any | ErrorObject>;
|
|
203
250
|
}
|
|
204
251
|
//# sourceMappingURL=PlaywrightDriver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightDriver.d.ts","sourceRoot":"","sources":["../src/PlaywrightDriver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EA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AC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,OAAO,CAAA;KAC3B,GAAG,OAAO,CAAC,aAAa,GAAG,WAAW,CAAC;IAexC;;;OAGG;IACH,MAAM,CAAC,MAAM;mBAMS,MAAM,OAAO,MAAM,SAAS,MAAM,UAAU,MAAM;kBAL9D,MAAM;iBACP,MAAM;mBACJ,MAAM;oBACL,MAAM;;MAQjB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,gBAAgB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,cAAsB,EAAE,EAAE;QACpE,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC7E,cAAc,CAAC,EAAE,OAAO,CAAA;KAC3B,GAAG,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC;CAkCjC"}
|
package/dist/PlaywrightDriver.js
CHANGED
|
@@ -40,9 +40,10 @@ class PlaywrightDriver {
|
|
|
40
40
|
* page: await browser.newPage(), // assuming 'browser' is a Playwright Browser instance
|
|
41
41
|
* url: 'your-syngrisi-url', // Syngrisi server URL
|
|
42
42
|
* apiKey: 'your-api-key', // API key for Syngrisi server authentication
|
|
43
|
+
* autoAccept: true // Automatically accept new baselines
|
|
43
44
|
* });
|
|
44
45
|
*/
|
|
45
|
-
constructor({ page, url, apiKey }) {
|
|
46
|
+
constructor({ page, url, apiKey, autoAccept }) {
|
|
46
47
|
const pw = new PlaywrightEntities_1.PlaywrightEntities(page);
|
|
47
48
|
this.page = pw.page;
|
|
48
49
|
this.browser = pw.browser;
|
|
@@ -52,6 +53,7 @@ class PlaywrightDriver {
|
|
|
52
53
|
this.params = {
|
|
53
54
|
test: {}
|
|
54
55
|
};
|
|
56
|
+
this.autoAccept = autoAccept || false;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Starts a new test session with the given parameters.
|
|
@@ -213,7 +215,8 @@ class PlaywrightDriver {
|
|
|
213
215
|
* browserName: 'chrome',
|
|
214
216
|
* os: 'Windows',
|
|
215
217
|
* app: 'MyProject',
|
|
216
|
-
* branch: 'develop'
|
|
218
|
+
* branch: 'develop',
|
|
219
|
+
* autoAccept: true // Auto-accept if no baseline exists
|
|
217
220
|
* },
|
|
218
221
|
* suppressErrors: false
|
|
219
222
|
* });
|
|
@@ -254,14 +257,39 @@ class PlaywrightDriver {
|
|
|
254
257
|
domDump: domDump,
|
|
255
258
|
};
|
|
256
259
|
(0, paramsGuard_1.paramsGuard)(opts, 'check, opts', Check_schema_1.CheckOptionsSchema);
|
|
260
|
+
// Remove autoAccept from params before sending to API (it's SDK-only)
|
|
261
|
+
const { autoAccept: checkAutoAccept, ...apiParams } = params || {};
|
|
257
262
|
Object.assign(
|
|
258
263
|
// @ts-ignore
|
|
259
|
-
opts,
|
|
264
|
+
opts, apiParams);
|
|
260
265
|
// @ts-ignore
|
|
261
266
|
const result = await this.api.coreCheck(imageBuffer, opts);
|
|
262
267
|
if (result.error && !suppressErrors) {
|
|
263
268
|
throw `❌ Create Check error: ${JSON.stringify(result, null, ' ')}`;
|
|
264
269
|
}
|
|
270
|
+
// Auto-accept new checks if enabled (check-level or driver-level)
|
|
271
|
+
const shouldAutoAccept = checkAutoAccept ?? this.autoAccept;
|
|
272
|
+
if (shouldAutoAccept && !result.error) {
|
|
273
|
+
const checkResult = result;
|
|
274
|
+
const status = Array.isArray(checkResult.status)
|
|
275
|
+
? checkResult.status[0]
|
|
276
|
+
: checkResult.status;
|
|
277
|
+
if (status === 'new') {
|
|
278
|
+
log.info(`Auto-accepting new check: '${checkName}' (id: ${checkResult._id})`);
|
|
279
|
+
const acceptResult = await this.acceptCheck({
|
|
280
|
+
checkId: checkResult._id,
|
|
281
|
+
baselineId: checkResult.actualSnapshotId,
|
|
282
|
+
suppressErrors
|
|
283
|
+
});
|
|
284
|
+
if (acceptResult.error && !suppressErrors) {
|
|
285
|
+
log.warn(`Failed to auto-accept check '${checkName}': ${JSON.stringify(acceptResult)}`);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
log.debug(`Successfully auto-accepted check '${checkName}'`);
|
|
289
|
+
return acceptResult;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
265
293
|
return result;
|
|
266
294
|
}
|
|
267
295
|
catch (e) {
|
|
@@ -296,6 +324,73 @@ class PlaywrightDriver {
|
|
|
296
324
|
throw e;
|
|
297
325
|
}
|
|
298
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Sets ignore regions on a baseline. These regions will be excluded from visual comparison.
|
|
329
|
+
* @param {string} baselineId - The unique identifier of the baseline.
|
|
330
|
+
* @param {Array<{left: number, top: number, right: number, bottom: number}>} regions - Array of region objects.
|
|
331
|
+
* @param {boolean} [suppressErrors=false] - Flag to suppress thrown errors.
|
|
332
|
+
* @returns {Promise<any | ErrorObject>} The update result or an error object.
|
|
333
|
+
* @example
|
|
334
|
+
* // Set ignore regions on a baseline
|
|
335
|
+
* await driver.setIgnoreRegions({
|
|
336
|
+
* baselineId: 'baseline-id-123',
|
|
337
|
+
* regions: [
|
|
338
|
+
* { left: 0, top: 0, right: 100, bottom: 50 }, // Top banner
|
|
339
|
+
* { left: 200, top: 300, right: 400, bottom: 350 } // Dynamic content area
|
|
340
|
+
* ]
|
|
341
|
+
* });
|
|
342
|
+
*
|
|
343
|
+
* // Using Region helper class
|
|
344
|
+
* await driver.setIgnoreRegions({
|
|
345
|
+
* baselineId: 'baseline-id-123',
|
|
346
|
+
* regions: [
|
|
347
|
+
* new PlaywrightDriver.Region(0, 0, 100, 50)
|
|
348
|
+
* ]
|
|
349
|
+
* });
|
|
350
|
+
*/
|
|
351
|
+
async setIgnoreRegions({ baselineId, regions, suppressErrors = false }) {
|
|
352
|
+
try {
|
|
353
|
+
if (!baselineId) {
|
|
354
|
+
throw new Error('baselineId is required');
|
|
355
|
+
}
|
|
356
|
+
if (!Array.isArray(regions)) {
|
|
357
|
+
throw new Error('regions must be an array');
|
|
358
|
+
}
|
|
359
|
+
// Validate region format
|
|
360
|
+
for (const region of regions) {
|
|
361
|
+
if (typeof region.left !== 'number' ||
|
|
362
|
+
typeof region.top !== 'number' ||
|
|
363
|
+
typeof region.right !== 'number' ||
|
|
364
|
+
typeof region.bottom !== 'number') {
|
|
365
|
+
throw new Error(`Invalid region format: ${JSON.stringify(region)}. Expected {left, top, right, bottom} as numbers.`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
const ignoreRegions = JSON.stringify(regions);
|
|
369
|
+
log.debug(`Setting ignore regions on baseline '${baselineId}': ${ignoreRegions}`);
|
|
370
|
+
const result = await this.api.updateBaseline(baselineId, { ignoreRegions });
|
|
371
|
+
if (result.error && !suppressErrors) {
|
|
372
|
+
throw `❌ Set Ignore Regions error: ${JSON.stringify(result, null, ' ')}`;
|
|
373
|
+
}
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
catch (e) {
|
|
377
|
+
const eMsg = `Cannot set ignore regions, baselineId: '${baselineId}', error: '${e.stack || e.toString()}'`;
|
|
378
|
+
log.error(eMsg);
|
|
379
|
+
throw e;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
299
382
|
}
|
|
300
383
|
exports.PlaywrightDriver = PlaywrightDriver;
|
|
384
|
+
/**
|
|
385
|
+
* Region to ignore during visual comparison.
|
|
386
|
+
* Coordinates are in pixels relative to the image.
|
|
387
|
+
*/
|
|
388
|
+
PlaywrightDriver.Region = class {
|
|
389
|
+
constructor(left, top, right, bottom) {
|
|
390
|
+
this.left = left;
|
|
391
|
+
this.top = top;
|
|
392
|
+
this.right = right;
|
|
393
|
+
this.bottom = bottom;
|
|
394
|
+
}
|
|
395
|
+
};
|
|
301
396
|
//# sourceMappingURL=PlaywrightDriver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightDriver.js","sourceRoot":"","sources":["../src/PlaywrightDriver.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;GAKG;AACH,6CAAwC;AACxC,iDAAyH;AAKzH,+DAGkC;AAClC,yDAAyE;AAEzE,yEAAmF;AACnF,+CAA8G;AAC9G,uDAAmD;AACnD,0DAAgD;AAChD,6DAAyD;AAEzD,MAAM,GAAG,GAAG,IAAA,gBAAM,EAAC,yBAAyB,CAAC,CAAA;AAC7C,0EAA0E;AAC1E,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACjC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkC,CAAC,CAAA;AAChE,CAAC;AAED;;;GAGG;AACH,MAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"PlaywrightDriver.js","sourceRoot":"","sources":["../src/PlaywrightDriver.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;GAKG;AACH,6CAAwC;AACxC,iDAAyH;AAKzH,+DAGkC;AAClC,yDAAyE;AAEzE,yEAAmF;AACnF,+CAA8G;AAC9G,uDAAmD;AACnD,0DAAgD;AAChD,6DAAyD;AAEzD,MAAM,GAAG,GAAG,IAAA,gBAAM,EAAC,yBAAyB,CAAC,CAAA;AAC7C,0EAA0E;AAC1E,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACjC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkC,CAAC,CAAA;AAChE,CAAC;AAED;;;GAGG;AACH,MAAa,gBAAgB;IASzB;;;;;;;;;;;;;OAaG;IACH,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAU;QACjD,MAAM,EAAE,GAAG,IAAI,uCAAkB,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;QACnB,IAAI,CAAC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AC,CAAA;QACX,CAAC;IACL,CAAC;;AAzaL,4CA0aC;AAhFG;;;GAGG;AACI,uBAAM,GAAG;IAMZ,YAAY,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,MAAc;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;CACJ,CAAA"}
|
package/dist/lib/utils.d.ts
CHANGED
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,eAAO,MAAM,GAAG,EAAE,MAA0C,CAAA;AAE5D,UAAU,WAAW;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAU,CAAC,EAC7B,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EAC1C,UAAS,WAAgB,KAC1B,OAAO,CAAC,CAAC,GAAG,IAAI,CA6BlB,CAAA;AAED,eAAO,MAAM,eAAe,cACP,CAAA;AAErB,eAAO,MAAM,gBAAgB,cAA4B,CAAA;AAEzD,eAAO,MAAM,aAAa,GAAI,UAAU,QAAQ,kBAM/C,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,WAE9C,CAAA"}
|
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6C;AAC7C,2CAAuC;AAG1B,QAAA,GAAG,GAAW,IAAA,gBAAM,EAAC,yBAAyB,CAAC,CAAA;AAQrD,MAAM,SAAS,GAAG,KAAK,EAC1B,QAA0C,EAC1C,UAAuB,EAAE,EACR,EAAE;IACnB,MAAM,EACF,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,GAAG,EACd,OAAO,GAAG,KAAK,EAClB,GAAG,OAAO,CAAA;IAEX,IAAI,eAAe,GAAG,KAAK,CAAA;IAC3B,UAAU,CAAC,GAAG,EAAE;QACZ,eAAe,GAAG,IAAI,CAAA;IAC1B,CAAC,EAAE,OAAO,CAAC,CAAA;IAEX,IAAI,MAAW,CAAA;IAEf,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;QACnD,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;QAChC,IAAI,eAAe,EAAE,CAAC;YAClB,WAAG,CAAC,IAAI,CAAC,sBAAsB,OAAO,cAAc,CAAC,CAAA;YACrD,OAAO,MAAM,CAAA;QACjB,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,MAAM,CAAA;QACjB,CAAC;QACD,IAAI,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;QAC/D,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAA;AACjB,CAAC,CAAA;AAhCY,QAAA,SAAS,aAgCrB;AAEM,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,aAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;KACvD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AADR,QAAA,eAAe,mBACP;AAEd,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,aAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AAA5C,QAAA,gBAAgB,oBAA4B;AAElD,MAAM,aAAa,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAA;IACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AANY,QAAA,aAAa,iBAMzB;AAEM,MAAM,YAAY,GAAG,CAAC,QAAkB,EAAE,EAAE;IAC/C,OAAO,QAAQ,CAAC,KAAK,CAAA;AACzB,CAAC,CAAA;AAFY,QAAA,YAAY,gBAExB"}
|
|
@@ -6,21 +6,7 @@ export declare const BaselineParamsSchema: z.ZodObject<{
|
|
|
6
6
|
os: z.ZodString;
|
|
7
7
|
app: z.ZodString;
|
|
8
8
|
branch: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
name: string;
|
|
11
|
-
viewport: string;
|
|
12
|
-
browserName: string;
|
|
13
|
-
os: string;
|
|
14
|
-
app: string;
|
|
15
|
-
branch: string;
|
|
16
|
-
}, {
|
|
17
|
-
name: string;
|
|
18
|
-
viewport: string;
|
|
19
|
-
browserName: string;
|
|
20
|
-
os: string;
|
|
21
|
-
app: string;
|
|
22
|
-
branch: string;
|
|
23
|
-
}>;
|
|
9
|
+
}, z.core.$strip>;
|
|
24
10
|
export type BaselineParams = z.infer<typeof BaselineParamsSchema>;
|
|
25
11
|
export declare const RequiredIdentOptionsSchema: z.ZodObject<{
|
|
26
12
|
name: z.ZodString;
|
|
@@ -30,22 +16,6 @@ export declare const RequiredIdentOptionsSchema: z.ZodObject<{
|
|
|
30
16
|
app: z.ZodString;
|
|
31
17
|
branch: z.ZodString;
|
|
32
18
|
imghash: z.ZodString;
|
|
33
|
-
},
|
|
34
|
-
name: string;
|
|
35
|
-
viewport: string;
|
|
36
|
-
browserName: string;
|
|
37
|
-
os: string;
|
|
38
|
-
app: string;
|
|
39
|
-
branch: string;
|
|
40
|
-
imghash: string;
|
|
41
|
-
}, {
|
|
42
|
-
name: string;
|
|
43
|
-
viewport: string;
|
|
44
|
-
browserName: string;
|
|
45
|
-
os: string;
|
|
46
|
-
app: string;
|
|
47
|
-
branch: string;
|
|
48
|
-
imghash: string;
|
|
49
|
-
}>;
|
|
19
|
+
}, z.core.$strip>;
|
|
50
20
|
export type RequiredIdentOptions = z.infer<typeof RequiredIdentOptionsSchema>;
|
|
51
21
|
//# sourceMappingURL=Baseline.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Baseline.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/Baseline.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"Baseline.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/Baseline.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oBAAoB;;;;;;;iBAQ/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B;;;;;;;;iBAQrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -12,32 +12,6 @@ export declare const CheckOptionsSchema: z.ZodObject<{
|
|
|
12
12
|
browserFullVersion: z.ZodString;
|
|
13
13
|
hashCode: z.ZodOptional<z.ZodString>;
|
|
14
14
|
domDump: z.ZodOptional<z.ZodAny>;
|
|
15
|
-
},
|
|
16
|
-
name: string;
|
|
17
|
-
viewport: string;
|
|
18
|
-
browserName: string;
|
|
19
|
-
os: string;
|
|
20
|
-
app: string;
|
|
21
|
-
branch: string;
|
|
22
|
-
testId: string;
|
|
23
|
-
suite: string;
|
|
24
|
-
browserVersion: string;
|
|
25
|
-
browserFullVersion: string;
|
|
26
|
-
hashCode?: string | undefined;
|
|
27
|
-
domDump?: any;
|
|
28
|
-
}, {
|
|
29
|
-
name: string;
|
|
30
|
-
viewport: string;
|
|
31
|
-
browserName: string;
|
|
32
|
-
os: string;
|
|
33
|
-
app: string;
|
|
34
|
-
branch: string;
|
|
35
|
-
testId: string;
|
|
36
|
-
suite: string;
|
|
37
|
-
browserVersion: string;
|
|
38
|
-
browserFullVersion: string;
|
|
39
|
-
hashCode?: string | undefined;
|
|
40
|
-
domDump?: any;
|
|
41
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
42
16
|
export type CheckOptions = z.infer<typeof CheckOptionsSchema>;
|
|
43
17
|
//# sourceMappingURL=Check.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Check.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/Check.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"Check.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/Check.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;iBAgB7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -11,33 +11,7 @@ export declare const SessionParamsSchema: z.ZodObject<{
|
|
|
11
11
|
browserName: z.ZodOptional<z.ZodString>;
|
|
12
12
|
browserVersion: z.ZodOptional<z.ZodString>;
|
|
13
13
|
browserFullVersion: z.ZodOptional<z.ZodString>;
|
|
14
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString
|
|
15
|
-
},
|
|
16
|
-
run: z.ZodString;
|
|
17
|
-
runident: z.ZodString;
|
|
18
|
-
test: z.ZodString;
|
|
19
|
-
branch: z.ZodString;
|
|
20
|
-
app: z.ZodString;
|
|
21
|
-
suite: z.ZodOptional<z.ZodString>;
|
|
22
|
-
os: z.ZodOptional<z.ZodString>;
|
|
23
|
-
viewport: z.ZodOptional<z.ZodString>;
|
|
24
|
-
browserName: z.ZodOptional<z.ZodString>;
|
|
25
|
-
browserVersion: z.ZodOptional<z.ZodString>;
|
|
26
|
-
browserFullVersion: z.ZodOptional<z.ZodString>;
|
|
27
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
-
}, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodUndefined]>, "strip">, z.objectInputType<{
|
|
29
|
-
run: z.ZodString;
|
|
30
|
-
runident: z.ZodString;
|
|
31
|
-
test: z.ZodString;
|
|
32
|
-
branch: z.ZodString;
|
|
33
|
-
app: z.ZodString;
|
|
34
|
-
suite: z.ZodOptional<z.ZodString>;
|
|
35
|
-
os: z.ZodOptional<z.ZodString>;
|
|
36
|
-
viewport: z.ZodOptional<z.ZodString>;
|
|
37
|
-
browserName: z.ZodOptional<z.ZodString>;
|
|
38
|
-
browserVersion: z.ZodOptional<z.ZodString>;
|
|
39
|
-
browserFullVersion: z.ZodOptional<z.ZodString>;
|
|
40
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
41
|
-
}, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodUndefined]>, "strip">>;
|
|
14
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
+
}, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodUndefined]>>>;
|
|
42
16
|
export type SessionParams = z.infer<typeof SessionParamsSchema>;
|
|
43
17
|
//# sourceMappingURL=SessionParams.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionParams.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/SessionParams.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"SessionParams.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/SessionParams.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;iGAasC,CAAA;AAEtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|