Giter Club home page Giter Club logo

Comments (6)

PippoRaimondi avatar PippoRaimondi commented on July 18, 2024 4

I've opened the following bug against cypress repo:

cypress-io/cypress#24052

from cypress-image-diff.

PippoRaimondi avatar PippoRaimondi commented on July 18, 2024

Thanks a lot for pointing this out, I will have a look and provide a fix as soon as I can!

from cypress-image-diff.

PippoRaimondi avatar PippoRaimondi commented on July 18, 2024

Ok, I've been working to try to fix this and there is no non-hacky way of doing this..

When taking screenshots, cypress would store and create folder structures that matched your spec structure based on the below information:

// Cypress 9.x

{
  name: 'folder-structure-test/folder-structure-spec-wholePage',
  specName: 'folder-structure-test/folder-structure-spec.js',
  path: '/Users/filipporaimondi/code/cypress-image-diff/cypress/screenshots/folder-structure-test/folder-structure-spec.js/folder-structure-test/folder-structure-spec-wholePage (1).png',
  ...
}

If you see below, you can notice that the same object provided by Cypress 10.x has a missing property called specName and flattens any folder structure from the other properties (I.E path), hence it puts all screenshots in the same folder...

// Cypress 10.x

{
  name: 'folder-structure.cy-wholePage',
  path: '/Users/filipporaimondi/code/cypress-image-diff/cypress/screenshots/folder-structure.cy-wholePage (1).png',
  ...
}

There are ways of course to handle this, but it would require quite a significant amount of rework and it would feel extremely hacky and for sure it wouldn't work for all cases... given it would rely on knowing a folder structure and this folder structure can be changed by cypress integrationFolder configurable path...

Unfortunately for now there will be a Cypress 10.x limitation...

I will be opening a ticket against cypress, which hopefully they can fix quickly, given I won't ask them to revert this breaking change, but just simply include specName that contains the folder structure so we can create it ourselves on a after:screenshot hook... once they provide this property again I can easily update this package to support complex folder structure again.

from cypress-image-diff.

uhlstefa avatar uhlstefa commented on July 18, 2024

Any update on this? I had the same issue with headless mode and therefore my tests break the CI jobs. Any workaround there so far?

from cypress-image-diff.

github-actions avatar github-actions commented on July 18, 2024

This issue is stale because it has been open for 30 days with no activity.

from cypress-image-diff.

github-actions avatar github-actions commented on July 18, 2024

This issue was closed because it has been inactive for 30 days since being marked as stale.

from cypress-image-diff.

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.