GithubHelp home page GithubHelp logo

Comments (7)

librehat avatar librehat commented on July 22, 2024 10

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.

ALeschinsky avatar ALeschinsky commented on July 22, 2024 1

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.

renelux avatar renelux commented on July 22, 2024

@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?

https://github.com/meinaart/cypress-plugin-snapshots/blob/master/src/utils/commands/getTaskData.js#L23

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.

meinaart avatar meinaart commented on July 22, 2024

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.

renelux avatar renelux commented on July 22, 2024

@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.

meinaart avatar meinaart commented on July 22, 2024

@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.

sharutkarsh avatar sharutkarsh commented on July 22, 2024

Any update here ?

from cypress-plugin-snapshots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.