Comments (4)
Can you provide insight into your workflow? How are you running your tests?
from cypress-visual-regression.
Hello @mjhea0 ,
I'm working with cypress-visual-regression and i've same difficulties to work my tests.
Here is my workflow :
I've configured support/commands.js
const compareSnapshotCommand = require('cypress-visual-regression/dist/command');
compareSnapshotCommand();
And i've configured plugins/index.js
const getCompareSnapshotsPlugin = require('cypress-visual-regression/dist/plugin');
module.exports = (on) => {
getCompareSnapshotsPlugin(on);
};
Then, after have created my test "visual_testing.spec.js into "cypress/integration/examples" like this :
describe('Integration test with visual testing', function () {
it('Loads the homepage', function() {
cy.visit('https://www.amazon.fr').then(() => {
cy.compareSnapshot();
})
})
})
I run this cmd : npx cypress run --spec cypress/integration/examples/visual_testing.spec.js --env type=base --config screenshotsFolder=cypress/snapshots/base
It creates me a folder "snapshots/base/examples/visual_testing" where the .png file named "undefined-base.png" is included.
Then, i run this cmd : npx cypress run --spec cypress/integration/examples/visual_testing.spec.js --env type=actual
I get an error :
The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (
/Users/<myuser>/Documents/Projects/Cypress-projects/cypress-visual-regression-plugin/cypress/plugins/index.js
)Error: ENOENT: no such file or directory, open '/Users//Documents/Projects/Cypress-projects/cypress-visual-regression-plugin/cypress/snapshots/base/examples/visual_testing.spec.js/undefined-actual.png'
And it creates me a folder "snapshots/diff/examples/visual_testing.spec.js" but is empty
Env :
"cypress": "^4.4.0",
"cypress-visual-regression": "^1.2.0",
from cypress-visual-regression.
This should fix it: #40
Use version 1.3.1 of the library to test: https://www.npmjs.com/package/cypress-visual-regression
from cypress-visual-regression.
Hi @mjhea0
Thank you for your fix.
I allow myself to add this in the use of your plugin at the time of launching the script for the non regression. When launching the script, it's important to specify the directory like this: cypress run --env type=actual --config screenshotsFolder=cypress/snapshots/actual
.
No mentioned into your documentation https://www.npmjs.com/package/cypress-visual-regression.
Unless, it works :)
Simple question : How to custom the image name? I would like to have the combo "Test suite + context" for the image name. Ex : "Integration test with visual testing -- Loads the homepage.png"
from cypress-visual-regression.
Related Issues (20)
- The "type" environment variable is unknown. HOT 1
- e2e.setupNodeEvents() function: TypeError: (0 , plugin_1.default) is not a function HOT 5
- `env` object in config file or not? HOT 1
- failSilently and ALLOW_VISUAL_REGRESSION_TO_FAIL, confusing HOT 1
- Base in Mac, diff in Jenkins (actual) HOT 7
- Error: Snapshot does not exist after upgrade from 2.1.1 to 3.0.0 HOT 2
- CypressError: cy.task('moveSnapshot') failed HOT 2
- testFiles is deprecated, replace with specPattern
- Base screenshot doesnt get the full screen HOT 1
- Module not found: Can't resolve 'fs' error HOT 1
- cypress-mochawesome-reporter failing when used with cypress-visual-regression HOT 3
- `getSpecRelativePath()` returns invalid path on windows based hosts HOT 1
- Compare a single HTML element is not working as expected HOT 4
- Changelog entry / upgrade guide for v4? HOT 4
- No option to override test type through CLI in v4 HOT 4
- Compared screenshot path does not match initial screenshot path HOT 5
- [v4] Spec directory not included in screenshot path HOT 4
- Path issue with component testing HOT 8
- Testing Failing Unexpectedly in CI and threshold is not effective
- Webpack loader error for plugin command.js HOT 5
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-visual-regression.