Comments (12)
Thank you so much @kien-ht @PippoRaimondiDIT now it works :D
from cypress-image-diff.
Hi @kien-ht I checked the Java configuration and they are the same. I notice that in your example, the cypress.config.js is the same compared with TypeScript. Is that correct? the issue that I facing is related in the const definition
![image](https://private-user-images.githubusercontent.com/39304271/291100986-3b5709cf-ef0a-416b-abcb-6daaf7ab4be2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDk5MTU5MDQsIm5iZiI6MTcwOTkxNTYwNCwicGF0aCI6Ii8zOTMwNDI3MS8yOTExMDA5ODYtM2I1NzA5Y2YtZWYwYS00MTZiLWFiY2ItNmRhYWY3YWI0YmUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzA4VDE2MzMyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjZGQ1MTQxODkyMTAxMjQ4YTNjMzQyM2JjZWRlMTE0ZjJjYTVmZjBlMTUyNTlkMGIzMTc2MTA3NDg1OTNjZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.w-9B3ti4lIycmvdGX0ZvPLCHDVwgTKWD84AvYEQ4riQ)
Look what I have
cypress-image-diff.config.cjs
I think I do not need an extra configuration to run the plugin, right?
from cypress-image-diff.
🎉 This issue has been resolved in version 2.1.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
from cypress-image-diff.
@CaiqueCoelho We have just released version 2.1.0, please upgrade your package and see if the error still persists.
Side note: I've noticed you have initialized our plugin twice, can you confirm if it's just a copy and paste problem?
from cypress-image-diff.
Hi @kien-ht I recently updated the plugin and also read the previous issue. I followed the steps but still got an error.
Configuration
// cypress.config.js
const { defineConfig } = require("cypress");
const getCompareSnapshotsPlugin = require('cypress-image-diff-js/plugin');
module.exports = defineConfig({
e2e: {
video: false,
setupNodeEvents(on, config) {
return getCompareSnapshotsPlugin(on, config);
},
},
});
// cypress-image-diff.config.cjs
const config = {
ROOT_DIR: 'cypress/Visua_Test',
REPORT_DIR: 'cypress/Report/html-report',
SCREENSHOTS_DIR: 'screenshots',
FAILURE_THRESHOLD: 0.1,
RETRY_OPTIONS: {
log: true,
limit: 2, // max number of iterations
timeout: 30000, // time limit in ms
delay: 300, // delay before next iteration, ms
},
FAIL_ON_MISSING_BASELINE: true,
COMPARISON_OPTIONS: { threshold: 0.2 },
JSON_REPORT: {
FILENAME: 'cypress_visual_report',
OVERWRITE: false,
},
CYPRESS_SCREENSHOT_OPTIONS:{
capture: 'fullPage',
disableTimersAndAnimations: true,
}
};
module.exports = config;
e2e.js
const compareSnapshotCommand = require('cypress-image-diff-js/command');
compareSnapshotCommand();
import './commands'
![image](https://private-user-images.githubusercontent.com/39304271/291018281-9e29a9f2-9079-4d8d-be1e-34893080ec97.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDk5MTU5MDQsIm5iZiI6MTcwOTkxNTYwNCwicGF0aCI6Ii8zOTMwNDI3MS8yOTEwMTgyODEtOWUyOWE5ZjItOTA3OS00ZDhkLWJlMWUtMzQ4OTMwODBlYzk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMDglMkZ1cy1l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ZoJvySUz-D0ESHcmanS3DDJId5fctQ)
from cypress-image-diff.
@camhost01, I've just created a working integration example here. Please take a look and see if you have any misconfig parts.
from cypress-image-diff.
Yes correct. Configuration file is optional, used in case you want to change the default behaviour of this plugin.
May I suggest you two things:
- Clean cache the node_modules and reinstall again.
- Pull the actual code of the example I provided above, and run it locally to see if you see any problems. I believe I wrote a README.md in the respective example folder, in case you struggle to make it run.
from cypress-image-diff.
Hi @kien-ht I checked the Java configuration and they are the same. I notice that in your example, the cypress.config.js is the same compared with TypeScript. Is that correct? the issue that I facing is related in the const definition
Look what I have cypress-image-diff.config.cjs
![]()
I think I do not need an extra configuration to run the plugin, right?
I updated to V2.1.1 and did follow this step but still found error same as you
I tried to clean node_modules many times but still found this error
from cypress-image-diff.
Same error, using it in a NextJS Typescript project.
from cypress-image-diff.
- Can you try to run the example locally, see if there's any problems?
- I'm assuming that your project type is CommonJs. Can you confirm that?
@dominikzogg, can you provide more details about your project setup please?
from cypress-image-diff.
@camhost01, I've just created a working integration example here. Please take a look and see if you have any misconfig parts.
I am seeing the same issue as others within this thread.
I have downloaded the example project linked, and ran the following: npm install
and npm run test
. I am presented with the following error:
Edit: I see you have already started working on a fix while I was fumbling around with a comment — thanks for your swift response.
from cypress-image-diff.
🎉 This issue has been resolved in version 2.1.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
Thank you for the excellent support. I was able to run through that point. However, I encountered another error. #198
from cypress-image-diff.
Related Issues (20)
- Customizable baseline image name format HOT 9
- In projects with cucumber, the standard json report is not generated HOT 5
- Incorrect Difference Percentage Resulting from compareSnapshot Command HOT 6
- v1.31.0 was a breaking change HOT 3
- Add option to not take full size screenshot HOT 5
- Taken screenshots are not the size I configured HOT 10
- Option to run all tests and get diff files at once even if there are failing ones HOT 2
- Custom config file is not working HOT 14
- Error preparing file: cypress/support/e2e.js HOT 8
- Config "FAILURE_THRESHOLD" did not work HOT 5
- Cypress integration broken: The deleteScreenshot 'task' event has not been registered in the setupNodeEvents method. You must register it before using cy.task() HOT 4
- User config error `cypress-image-diff.config.js`
- Missing JSON report when in `cypress OPEN` mode HOT 3
- Unable to update folder locations HOT 5
- Unable to generate JSON REPORT under Folder cypress-image-diff-html-report HOT 1
- Specify shared location/path for Screenshots and Reports HOT 2
- Package subpath './dist/plugin' is not defined by "exports"... HOT 8
- Intermittent Error: ENOENT: no such file or directory, open '/a/b/foo.png'
- Error: ERR_PACKAGE_PATH_NOT_EXPORTED HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-image-diff.