Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Different path in case of 'cypress run' and 'cypress open' test execution #155

Closed Answered by FRSgit
viktorgogulenko asked this question in Q&A
Discussion options

Hi, I've tried to use this great plugin, but we've found that path is different for saving files in case of "cypress open..." and "cypress run...". I've seen that seems this is a Cypress bug (issue), but is it possible somehow to save snapshots without all extra prefixes to one folder for example? Thanks in advance!
Screenshot 2022年10月18日 at 14 50 33

You must be logged in to vote

Hello @viktorgogulenko,

Can you please provide a reproduction repo where this happens? (or at least configuration that you're using?)

I'm asking about that, because the directory structure seems to be off (the cp-visual-refression-diff_snapshots directory should be cleaned up after plugins' work and screenshots should be moved to a different path).

Replies: 2 comments 4 replies

Comment options

Hello @viktorgogulenko,

Can you please provide a reproduction repo where this happens? (or at least configuration that you're using?)

I'm asking about that, because the directory structure seems to be off (the cp-visual-refression-diff_snapshots directory should be cleaned up after plugins' work and screenshots should be moved to a different path).

You must be logged in to vote
4 replies
Comment options

What is happening from your side if you are executing the same test using Cypress GUI ("../node_modules/.bin/cypress open") and "cypress run" ("../node_modules/.bin/cypress run --spec=integration/snapshotTesting/snapshotTest.spec.js --browser=chrome")? Because for me it easily could be reproduced - plugin saves screenshots in two different folders :( I've set env to:
pluginVisualRegressionImagesDir: 'screenshots/tests/'

Comment options

If I run the example test suite locally I get images stored:

  • from E2E tests images are stored within example/cypress/e2e/__image_snapshots_local__,
  • from component-testing images are stored within example/cypress/component/__image_snapshots_local__.

Can you reproduce the same behaviour for the example project or do you get something different?

Comment options

Thanks @FRSgit for really quick response. After few more tries I realised that was looking into the wrong place and seems plugin works as expected.

Comment options

Good to hear that @viktorgogulenko, thanks for the update!

Though I am a bit worried that you were able to even see the __cp-visual-refression-diff_snapshots__ directory on your hard drive (it should've been removed after plugin finished it work. Would you have any details on how to reproduce this behavior?

Answer selected by FRSgit
Comment options

Closing this one as stale - but I believe we've answered the main question. Thanks for raising this discussion topic!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested

AltStyle によって変換されたページ (->オリジナル) /