diff --git a/ui-tests/cypress.config.sample.js b/ui-tests/cypress.config.sample.js index c5b2fdb507f..d9d14a58e8f 100644 --- a/ui-tests/cypress.config.sample.js +++ b/ui-tests/cypress.config.sample.js @@ -32,12 +32,12 @@ module.exports = defineConfig({ const data = new Uint8Array(fs.readFileSync(filePath)); const pdfDoc = await pdfjsLib.getDocument({ data }).promise; - // Import pixelmatch only if logo check is needed - let pixelmatch; + // Import blazediff only if logo check is needed + let blazediff; const doLogoCheck = !!options.referenceLogoPath; if (doLogoCheck) { - const pm = await import("pixelmatch"); - pixelmatch = pm.default; + const { diff } = await import("@blazediff/core"); + blazediff = diff; } let hasImage = false; @@ -88,7 +88,7 @@ module.exports = defineConfig({ const resizedPdfImg = PNG.sync.read(resizedPdfBuffer); const diff = new PNG({ width: refLogo.width, height: refLogo.height }); - const mismatched = pixelmatch( + const mismatched = blazediff( refLogo.data, resizedPdfImg.data, diff.data, diff --git a/ui-tests/package-lock.json b/ui-tests/package-lock.json index 100fbf5c3eb..a823a351f8a 100644 --- a/ui-tests/package-lock.json +++ b/ui-tests/package-lock.json @@ -16,13 +16,20 @@ "moment": "^2.29.4" }, "devDependencies": { + "@blazediff/core": "^1.9.0", "cypress": "^13.4.0", "pdfjs-dist": "^3.11.174", - "pixelmatch": "^7.1.0", "pngjs": "^7.0.0", "sharp": "^0.34.4" } }, + "node_modules/@blazediff/core": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.9.0.tgz", + "integrity": "sha512-4W6TNzvD5KyUWiAHT+MyAg79FWe8rv493nfvWKeWox67lbUHTiTy40n7rmg6cQjhu5hflCDw73FExgmv22IgNQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@cypress/request": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.9.tgz", @@ -1161,6 +1168,7 @@ "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", "hasInstallScript": true, "license": "MIT", + "peer": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", @@ -1339,6 +1347,7 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "peer": true, "dependencies": { "ansi-colors": "^4.1.1" }, @@ -2477,19 +2486,6 @@ "node": ">=0.10.0" } }, - "node_modules/pixelmatch": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-7.1.0.tgz", - "integrity": "sha512-1wrVzJ2STrpmONHKBy228LM1b84msXDUoAzVEl0R8Mz4Ce6EPr+IVtxm8+yvrqLYMHswREkjYFaMxnyGnaY3Ng==", - "dev": true, - "license": "ISC", - "dependencies": { - "pngjs": "^7.0.0" - }, - "bin": { - "pixelmatch": "bin/pixelmatch" - } - }, "node_modules/pngjs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", diff --git a/ui-tests/package.json b/ui-tests/package.json index 18d3d9c46b9..2955444a403 100644 --- a/ui-tests/package.json +++ b/ui-tests/package.json @@ -16,9 +16,9 @@ "moment": "^2.29.4" }, "devDependencies": { + "@blazediff/core": "^1.9.0", "cypress": "^13.4.0", "pdfjs-dist": "^3.11.174", - "pixelmatch": "^7.1.0", "pngjs": "^7.0.0", "sharp": "^0.34.4" }