@percy/playwright 1.0.11-alpha.0 → 1.1.0-beta.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/index.js +18 -4
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -52,7 +52,15 @@ async function captureSerializedDOM(page, options, percyDOM) {
|
|
|
52
52
|
// This section only handles cross-origin iframe serialization and resource merging.
|
|
53
53
|
const pageUrl = new URL(page.url());
|
|
54
54
|
const crossOriginFrames = page.frames()
|
|
55
|
-
.filter(frame =>
|
|
55
|
+
.filter(frame => {
|
|
56
|
+
const frameUrl = frame.url();
|
|
57
|
+
if (!frameUrl || frameUrl === 'about:blank') return false;
|
|
58
|
+
try {
|
|
59
|
+
return new URL(frameUrl).origin !== pageUrl.origin;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
56
64
|
|
|
57
65
|
// Inject Percy DOM into all cross-origin frames before processing them in parallel
|
|
58
66
|
await Promise.all(crossOriginFrames.map(frame => frame.evaluate(percyDOM)));
|
|
@@ -114,9 +122,15 @@ async function captureResponsiveDOM(page, options, percyDOM) {
|
|
|
114
122
|
// Calculate default height for non-mobile widths
|
|
115
123
|
let defaultHeight = currentHeight;
|
|
116
124
|
if (process.env.PERCY_RESPONSIVE_CAPTURE_MIN_HEIGHT?.toLowerCase() === 'true') {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
if (options.minHeight) {
|
|
126
|
+
defaultHeight = options.minHeight;
|
|
127
|
+
} else {
|
|
128
|
+
const configMinHeight = utils.percy?.config?.snapshot?.minHeight;
|
|
129
|
+
/* istanbul ignore else: CLI always provides default value for config.snapshot */
|
|
130
|
+
if (configMinHeight) {
|
|
131
|
+
defaultHeight = configMinHeight;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
// Get width and height combinations
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/playwright",
|
|
3
3
|
"description": "Playwright client library for visual testing with Percy",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0-beta.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Perceptual Inc.",
|
|
7
7
|
"repository": "https://github.com/percy/percy-playwright",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public",
|
|
32
|
-
"tag": "
|
|
32
|
+
"tag": "beta"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"playwright-core": ">=1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@percy/cli": "
|
|
38
|
+
"@percy/cli": "1.31.10-alpha.0",
|
|
39
39
|
"@playwright/test": "^1.24.2",
|
|
40
40
|
"babel-eslint": "^10.1.0",
|
|
41
41
|
"cross-env": "^7.0.2",
|