Comments (7)
It'll be great if we can make the path configurable so we put the image snapshots in a completely different directory
from cypress-plugin-snapshots.
Hello, any updates on this issue? I'm trying to use cypress-plugin-snapshots
in an Angular app and it works fine, but the actual screenshots are saved under dist/
folder where the tests are compiled from typescript into javascript. This folder is excluded from git (in .gitignore
), so the snapshots are not really part of the repository this way... How can we move the screenshots to where the tests are, so that they are pushed to git and version tracked?
from cypress-plugin-snapshots.
@meinaart do you think it is possible to maybe add support for programmatically setting some of the values in the dict that are used to generate the path/filename for the snapshots?
A easy way to do that is to for example modify the config of your plugin dynamically, then if the key exists in the config use that if not use the current behavior.
from cypress-plugin-snapshots.
I will think about it for a bit. I am sure I can come up with a nice dynamic solution.
Would a filename template work for you? I need to think about what use cases would be valid.
Cypress itself does not recommend combining your test in one big file by the way. Especially not if you want to start using their dashboard service at some moment in time. One big test cannot be run in parallel. This is something I heard via a colleague who spoke with someone who worked at Cypress.
So I am a bit hesitant to fulfilling this request. I understand why you setup your Cypress this way but I think it's discouraged to do it like that. On the other hand I want to make my plugin as flexible as possible. Cypress itself is quite flexible as well.
Things I am considering:
- Filename template in your config, cleanest solution I think
- Maybe: adding the possibility to set the snapshot file location as an argument to
.toMatch(Image)Snapshot
.
from cypress-plugin-snapshots.
@meinaart we actually have no desire to integrate with their dashboard service, for our use case it is actually quiet overkill. Your colleague is correct that this doesn't work well with their way of running in parallel, but as we don't use the dashboard we can't use their implementation of running in parallel either way :)
So we are not maintaining one big spec file, we actually have around 40 smaller spec files. But we combine them in seperate larger files by importing the whole file in a index_spec
. This saved us around 4-5 min on a 15 min total runtime, as Cypress reloads the runner for every spec file.
Just FYI, if you have any sort of implementation that you think will work for you, feel free to highlight it to us and we would be more then happy to help you implement it. We understand that some use cases might be particular to our use case.
from cypress-plugin-snapshots.
@renelux could you try the latest version and then press "run all" to see if it then behaves if you want? That would not solve your issue completely but would perhaps make it possible to do an easy fix.
from cypress-plugin-snapshots.
Any update here ?
from cypress-plugin-snapshots.
Related Issues (20)
- (bug) cypress-plugin-snapshots errors out in component testing HOT 2
- Is it possible to remove the separator when generating the file name? HOT 1
- (bug) Cypress-image-snapshot makes the cut image
- (feat) Make the command retry on failure
- Can't pass updateSnapshots=true in npm script to update existing snapshots HOT 2
- Functionality of the plugin
- Maintaining this plugin HOT 8
- (bug) Typo in toMatchSnapshot type definition
- (bug) Update `socket.io`
- Update plugin to be compatible with Cypress 10 HOT 10
- attempt number is add to snapshot name(bug)
- Update snapshot button is missing (bug)
- Newcomers - Inactive repository HOT 3
- (bug) crypto.randomBytes is not a function
- (feat) Comparing screenshots from the same test run
- (bug) peerDependency on Cypress 4.x HOT 4
- (bug) Error reported during parallel execution of case;error message:listen EADDRINUSE: address already in use 127.0.0.1:2121
- Please make a new npm release
- Snapshot Compare Broken (bug)
- (feat) pixelmatch threshold control HOT 1
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-plugin-snapshots.