comparadise-utils 1.25.0 → 1.25.2
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/index.js +4 -4
- package/dist/match-screenshot.js +4 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -128,9 +128,9 @@ function baseExists(path) {
|
|
|
128
128
|
return exists;
|
|
129
129
|
}
|
|
130
130
|
function compareScreenshots(args) {
|
|
131
|
-
const {
|
|
132
|
-
const basePath = createImageFileName(
|
|
133
|
-
const actualPath = createImageFileName(
|
|
131
|
+
const { screenshotsFolder, pixelMatchOptions } = args;
|
|
132
|
+
const basePath = createImageFileName(screenshotsFolder, "base");
|
|
133
|
+
const actualPath = createImageFileName(screenshotsFolder, "new");
|
|
134
134
|
const { diffPixels, diff } = getDiffPixels(
|
|
135
135
|
basePath,
|
|
136
136
|
actualPath,
|
|
@@ -138,7 +138,7 @@ function compareScreenshots(args) {
|
|
|
138
138
|
);
|
|
139
139
|
if (diffPixels) {
|
|
140
140
|
fs2.writeFile(
|
|
141
|
-
createImageFileName(
|
|
141
|
+
createImageFileName(screenshotsFolder, "diff"),
|
|
142
142
|
new Uint8Array(import_pngjs2.PNG.sync.write(diff)),
|
|
143
143
|
(err) => {
|
|
144
144
|
if (err) {
|
package/dist/match-screenshot.js
CHANGED
|
@@ -97,7 +97,10 @@ function matchScreenshot(subject, args) {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const pixelMatchOptions = options?.pixelMatchOptions;
|
|
100
|
-
const compareScreenshotsArg = {
|
|
100
|
+
const compareScreenshotsArg = {
|
|
101
|
+
screenshotsFolder,
|
|
102
|
+
pixelMatchOptions
|
|
103
|
+
};
|
|
101
104
|
cy.task("compareScreenshots", compareScreenshotsArg).then((diffPixels) => {
|
|
102
105
|
if (diffPixels === 0) {
|
|
103
106
|
cy.log(`\u2705 Actual image of ${name} was the same as base`);
|
package/package.json
CHANGED
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"url": "https://github.com/ExpediaGroup/comparadise/issues"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"pixelmatch": "
|
|
19
|
+
"pixelmatch": "5.3.0",
|
|
20
20
|
"pngjs": "7.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@types/pixelmatch": "5.2.6",
|
|
23
24
|
"@types/pngjs": "6.0.5",
|
|
24
25
|
"cypress": "14.1.0",
|
|
25
26
|
"tsup": "8.4.0"
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"cypress": ">=12"
|
|
29
30
|
},
|
|
30
|
-
"version": "1.25.
|
|
31
|
+
"version": "1.25.2",
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "tsup",
|
|
33
34
|
"postbuild": "echo \"require('./dist/match-screenshot');\" > commands.js",
|