Open archfz opened 1 year ago
Hey, Sorry I needed to take a break from OSS and focus on my full-time job for last 3 months. Thanks for this nice write up!
From my perspective there are two flows that can be used to achieve good visual testing workflow:
__local_images__
directories. These directories are also included in .gitignore
and never committed to the repository. On the other hand there is a set of images which is a part of repo and which CI is comparing screenshots against. There images live in directory __image_snapshots__
and can be updated only by using [update screenshots]
at the end of commit message within PR (this triggers CI workflow that generates new images and commits new to PR branch).
cypress open
within docker (it's possible):
I've also seen a variant of point 2
where visual tests were just skipped entirely on local runs and report issues only on the CI.
I think one or more of solutions described above could be implemented as a part of this plugin (separate libs in this repo). But my main concern is - which will be the best developer experience. And I'm wondering if we could get more community feedback on that.
Problem
I have been using https://github.com/meinaart/cypress-plugin-snapshots for a good while now. When I started to use it I quickly realized that it had a big flaw: using it on locals images were generated with subtle differences which would always cause failures. These differences were due to the fact that initial images were generated on X OS and on Y browser. Now everyone who was using a different combination of OS or browser than what was used initially would bump into this issue. This was a deal breaker. From a quick look I do not see any solution for it in this plugin either.
Semi solution
I have managed to create a solution that works for us:
But this has certain inconveniences:
Theoretical solution
I've been thinking that maybe this whole process with docker could be automated and even connected with the GUI so that previously mentioned issues/inconveniences would be solved. The high level idea is something like this:
For this to work the main concerns are:
Let me hear what you think, or whether you have different ideas. Also I am open to collaborate on the implementation for this.