meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
497 stars 118 forks source link

(feat) Uploading file to cypress dashboard #151

Open tonai opened 4 years ago

tonai commented 4 years ago

Is your feature request related to a problem? Please describe. When running on CI screenshots are not accessible.

Describe the solution you'd like It would be nice to have screeshots available inside the cypress.io dashboard.

Additional context I am using CircleCI with record enabled and after the tests are complete it displays the following information:

(Uploading Results)

  - Failed Uploading (1/7) /root/project/cypress/screenshots/ui.js/UI  Homepage #0.png
  - Failed Uploading (2/7) /root/project/cypress/screenshots/ui.js/UI  Add page #0.png
  - Failed Uploading (3/7) /root/project/cypress/screenshots/ui.js/UI  Edit page #0.png
  - Done Uploading (4/7) /root/project/cypress/videos/ui.js.mp4
  - Done Uploading (5/7) /root/project/cypress/screenshots/ui.js/UI -- Homepage (failed).png
  - Done Uploading (6/7) /root/project/cypress/screenshots/ui.js/UI -- Edit page (failed).png
  - Done Uploading (7/7) /root/project/cypress/screenshots/ui.js/UI -- Add page (failed).png

It seems to upload successfully some files but failed on others (maybe because of the # in the name ?).

Here is the repo I use for the tests: https://github.com/tonai/react-deploy

mattfwood commented 3 years ago

I was looking for something similar, because it would be super helpful to be able to inspect the diff when using toMatchImageSnapshot() in the Cypress dashboard.

For context, I have a simple button component that i'm testing locally with toMatchImageSnapshot() but it's failing in my CI, so i can't visually debug it / see the image. I thought Cypress dashboard might help but I'm not able to upload the snapshot diff.

mattfwood commented 3 years ago

For anyone who finds a similar issue where toMatchSnapshotImage() works locally but not in a CI:

I forgot that the default font family in Chrome is different in a CI (which is typically Linux) than what I'm using locally. I made sure to add a style reset before these tests and that seemed to fix it.

StephaneTactill commented 3 years ago

Hi, I am experiencing the same issue here.

After adding cypress-plugin-snapshots to my project, screenshots are well saved locally but always fail to upload to the cypress dashboard.

Videos always sync with no issue. Only the screenshots fail.

What I have tried :

Here is what I systematicaly get after running a recorded test : Failed Uploading (1/2) /Users/stephane/testProjectCypress/cypress/screenshots/loginTestTDB.js/snapshot1-0.png

drdreo commented 3 years ago

I have contacted the Cypress support and they confirmed that snapshots will only be uploaded when the test failed. The UI still shows an show images button in the Dashboard regardless. But for failed tests, the upload of the diff image would be nice as well.

seif3r commented 2 years ago

This would still be an awesome feature. Is there any work done on it?

JamesOBR commented 1 year ago

+1 Anyone figured this out?