@percy/core 1.27.4-beta.2 → 1.27.4-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/config.js +18 -0
- package/dist/discovery.js +9 -0
- package/dist/page.js +4 -2
- package/package.json +7 -7
- package/types/index.d.ts +3 -0
package/dist/config.js
CHANGED
|
@@ -47,9 +47,15 @@ export const configSchema = {
|
|
|
47
47
|
type: 'boolean',
|
|
48
48
|
default: false
|
|
49
49
|
},
|
|
50
|
+
enableLayout: {
|
|
51
|
+
type: 'boolean'
|
|
52
|
+
},
|
|
50
53
|
domTransformation: {
|
|
51
54
|
type: 'string'
|
|
52
55
|
},
|
|
56
|
+
reshuffleInvalidTags: {
|
|
57
|
+
type: 'boolean'
|
|
58
|
+
},
|
|
53
59
|
scope: {
|
|
54
60
|
type: 'string'
|
|
55
61
|
},
|
|
@@ -280,6 +286,12 @@ export const snapshotSchema = {
|
|
|
280
286
|
domTransformation: {
|
|
281
287
|
$ref: '/config/snapshot#/properties/domTransformation'
|
|
282
288
|
},
|
|
289
|
+
enableLayout: {
|
|
290
|
+
$ref: '/config/snapshot#/properties/enableLayout'
|
|
291
|
+
},
|
|
292
|
+
reshuffleInvalidTags: {
|
|
293
|
+
$ref: '/config/snapshot#/properties/reshuffleInvalidTags'
|
|
294
|
+
},
|
|
283
295
|
discovery: {
|
|
284
296
|
type: 'object',
|
|
285
297
|
additionalProperties: false,
|
|
@@ -524,6 +536,12 @@ export const snapshotSchema = {
|
|
|
524
536
|
}
|
|
525
537
|
}
|
|
526
538
|
}
|
|
539
|
+
},
|
|
540
|
+
hints: {
|
|
541
|
+
type: 'array',
|
|
542
|
+
items: {
|
|
543
|
+
type: 'string'
|
|
544
|
+
}
|
|
527
545
|
}
|
|
528
546
|
}
|
|
529
547
|
}]
|
package/dist/discovery.js
CHANGED
|
@@ -26,6 +26,9 @@ function debugSnapshotOptions(snapshot) {
|
|
|
26
26
|
debugProp(snapshot, 'enableJavaScript');
|
|
27
27
|
debugProp(snapshot, 'cliEnableJavaScript');
|
|
28
28
|
debugProp(snapshot, 'disableShadowDOM');
|
|
29
|
+
debugProp(snapshot, 'enableLayout');
|
|
30
|
+
debugProp(snapshot, 'domTransformation');
|
|
31
|
+
debugProp(snapshot, 'reshuffleInvalidTags');
|
|
29
32
|
debugProp(snapshot, 'deviceScaleFactor');
|
|
30
33
|
debugProp(snapshot, 'waitForTimeout');
|
|
31
34
|
debugProp(snapshot, 'waitForSelector');
|
|
@@ -101,6 +104,7 @@ function processSnapshotResources({
|
|
|
101
104
|
...snapshot
|
|
102
105
|
}) {
|
|
103
106
|
var _resources;
|
|
107
|
+
let log = logger('core:snapshot');
|
|
104
108
|
resources = [...(((_resources = resources) === null || _resources === void 0 ? void 0 : _resources.values()) ?? [])];
|
|
105
109
|
|
|
106
110
|
// find any root resource matching the provided dom snapshot
|
|
@@ -119,6 +123,11 @@ function processSnapshotResources({
|
|
|
119
123
|
|
|
120
124
|
// inject Percy CSS
|
|
121
125
|
if (snapshot.percyCSS) {
|
|
126
|
+
// check @percy/dom/serialize-dom.js
|
|
127
|
+
let domSnapshotHints = (domSnapshot === null || domSnapshot === void 0 ? void 0 : domSnapshot.hints) ?? [];
|
|
128
|
+
if (domSnapshotHints.includes('DOM elements found outside </body>')) {
|
|
129
|
+
log.warn('DOM elements found outside </body>, percyCSS might not work');
|
|
130
|
+
}
|
|
122
131
|
let css = createPercyCSSResource(root.url, snapshot.percyCSS);
|
|
123
132
|
resources.push(css);
|
|
124
133
|
|
package/dist/page.js
CHANGED
|
@@ -146,7 +146,8 @@ export class Page {
|
|
|
146
146
|
width,
|
|
147
147
|
enableJavaScript,
|
|
148
148
|
disableShadowDOM,
|
|
149
|
-
domTransformation
|
|
149
|
+
domTransformation,
|
|
150
|
+
reshuffleInvalidTags
|
|
150
151
|
} = snapshot;
|
|
151
152
|
this.log.debug(`Taking snapshot: ${name}${width ? ` @${width}px` : ''}`, this.meta);
|
|
152
153
|
|
|
@@ -191,7 +192,8 @@ export class Page {
|
|
|
191
192
|
}), {
|
|
192
193
|
enableJavaScript,
|
|
193
194
|
disableShadowDOM,
|
|
194
|
-
domTransformation
|
|
195
|
+
domTransformation,
|
|
196
|
+
reshuffleInvalidTags
|
|
195
197
|
});
|
|
196
198
|
return {
|
|
197
199
|
...snapshot,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.27.4-beta.
|
|
3
|
+
"version": "1.27.4-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"test:types": "tsd"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@percy/client": "1.27.4-beta.
|
|
47
|
-
"@percy/config": "1.27.4-beta.
|
|
48
|
-
"@percy/dom": "1.27.4-beta.
|
|
49
|
-
"@percy/logger": "1.27.4-beta.
|
|
50
|
-
"@percy/webdriver-utils": "1.27.4-beta.
|
|
46
|
+
"@percy/client": "1.27.4-beta.3",
|
|
47
|
+
"@percy/config": "1.27.4-beta.3",
|
|
48
|
+
"@percy/dom": "1.27.4-beta.3",
|
|
49
|
+
"@percy/logger": "1.27.4-beta.3",
|
|
50
|
+
"@percy/webdriver-utils": "1.27.4-beta.3",
|
|
51
51
|
"content-disposition": "^0.5.4",
|
|
52
52
|
"cross-spawn": "^7.0.3",
|
|
53
53
|
"extract-zip": "^2.0.1",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
59
59
|
"ws": "^8.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e560f5df1637d30722f8d1d7e6eae9cf99ede2dd"
|
|
62
62
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -39,6 +39,9 @@ interface CommonSnapshotOptions {
|
|
|
39
39
|
percyCSS?: string;
|
|
40
40
|
enableJavaScript?: boolean;
|
|
41
41
|
disableShadowDOM?: boolean;
|
|
42
|
+
enableLayout?: boolean;
|
|
43
|
+
domTransformation?: string;
|
|
44
|
+
reshuffleInvalidTags?: boolean;
|
|
42
45
|
devicePixelRatio?: number;
|
|
43
46
|
scope?: string;
|
|
44
47
|
}
|