@percy/client 1.30.9-beta.1 → 1.30.9-beta.3
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/dist/client.js +17 -1
- package/package.json +4 -4
package/dist/client.js
CHANGED
|
@@ -21,6 +21,15 @@ function validateId(type, id) {
|
|
|
21
21
|
throw new Error(`Invalid ${type} ID`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
function ensureElementSelector(regions) {
|
|
25
|
+
if (!Array.isArray(regions)) return null;
|
|
26
|
+
return regions.map(region => ({
|
|
27
|
+
...region,
|
|
28
|
+
elementSelector: region.elementSelector || {
|
|
29
|
+
fullpage: true
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
24
33
|
|
|
25
34
|
// Validate project path arguments
|
|
26
35
|
function validateProjectPath(path) {
|
|
@@ -175,7 +184,8 @@ export class PercyClient {
|
|
|
175
184
|
tags: tagsArr,
|
|
176
185
|
'cli-start-time': cliStartTime,
|
|
177
186
|
source: source,
|
|
178
|
-
'skip-base-build': (_this$config$percy2 = this.config.percy) === null || _this$config$percy2 === void 0 ? void 0 : _this$config$percy2.skipBaseBuild
|
|
187
|
+
'skip-base-build': (_this$config$percy2 = this.config.percy) === null || _this$config$percy2 === void 0 ? void 0 : _this$config$percy2.skipBaseBuild,
|
|
188
|
+
'testhub-build-uuid': this.env.testhubBuildUuid
|
|
179
189
|
},
|
|
180
190
|
relationships: {
|
|
181
191
|
resources: {
|
|
@@ -406,6 +416,7 @@ export class PercyClient {
|
|
|
406
416
|
testCase,
|
|
407
417
|
labels,
|
|
408
418
|
thTestCaseExecutionId,
|
|
419
|
+
regions,
|
|
409
420
|
resources = [],
|
|
410
421
|
meta
|
|
411
422
|
} = {}) {
|
|
@@ -416,6 +427,7 @@ export class PercyClient {
|
|
|
416
427
|
this.log.warn('Warning: Missing `clientInfo` and/or `environmentInfo` properties', meta);
|
|
417
428
|
}
|
|
418
429
|
let tagsArr = tagsList(labels);
|
|
430
|
+
let regionsArr = ensureElementSelector(regions);
|
|
419
431
|
this.log.debug(`Validating resources: ${name}...`, meta);
|
|
420
432
|
for (let resource of resources) {
|
|
421
433
|
if (resource.sha || resource.content || !resource.filepath) continue;
|
|
@@ -433,6 +445,7 @@ export class PercyClient {
|
|
|
433
445
|
'test-case': testCase || null,
|
|
434
446
|
tags: tagsArr,
|
|
435
447
|
'scope-options': scopeOptions || {},
|
|
448
|
+
regions: regionsArr || null,
|
|
436
449
|
'minimum-height': minHeight || null,
|
|
437
450
|
'enable-javascript': enableJavaScript || null,
|
|
438
451
|
'enable-layout': enableLayout || false,
|
|
@@ -502,6 +515,7 @@ export class PercyClient {
|
|
|
502
515
|
consideredElementsData,
|
|
503
516
|
metadata,
|
|
504
517
|
sync,
|
|
518
|
+
regions,
|
|
505
519
|
meta = {}
|
|
506
520
|
} = {}) {
|
|
507
521
|
validateId('snapshot', snapshotId);
|
|
@@ -516,6 +530,7 @@ export class PercyClient {
|
|
|
516
530
|
tile.content = await fs.promises.readFile(tile.filepath);
|
|
517
531
|
}
|
|
518
532
|
}
|
|
533
|
+
let regionsArr = ensureElementSelector(regions);
|
|
519
534
|
this.log.debug(`${tiles.length} tiles for comparision: ${tag.name}...`, meta);
|
|
520
535
|
return this.post(`snapshots/${snapshotId}/comparisons`, {
|
|
521
536
|
data: {
|
|
@@ -523,6 +538,7 @@ export class PercyClient {
|
|
|
523
538
|
attributes: {
|
|
524
539
|
'external-debug-url': externalDebugUrl || null,
|
|
525
540
|
'ignore-elements-data': ignoredElementsData || null,
|
|
541
|
+
regions: regionsArr || null,
|
|
526
542
|
'consider-elements-data': consideredElementsData || null,
|
|
527
543
|
'dom-info-sha': domInfoSha || null,
|
|
528
544
|
sync: !!sync,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/client",
|
|
3
|
-
"version": "1.30.9-beta.
|
|
3
|
+
"version": "1.30.9-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"test:coverage": "yarn test --coverage"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@percy/env": "1.30.9-beta.
|
|
37
|
-
"@percy/logger": "1.30.9-beta.
|
|
36
|
+
"@percy/env": "1.30.9-beta.3",
|
|
37
|
+
"@percy/logger": "1.30.9-beta.3",
|
|
38
38
|
"pac-proxy-agent": "^7.0.2",
|
|
39
39
|
"pako": "^2.1.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "06ceb56e04806677d41a22eb1ccbee81a8d32c15"
|
|
42
42
|
}
|