jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
887 stars 160 forks source link

How to access screenshot on Github actions workflow ? #211

Closed edouard-lopez closed 3 years ago

edouard-lopez commented 3 years ago

Thanks for the plugin, it's pretty nice!

I got the following error on CI, but can't reproduce locally. So I'm looking for a way to access the CI screenshot in order to understand the problem.

1) theme_04: bot frame
         theme_04: should reset form after sending a message via submit button:
       Error: Image was 2.091666666666667% different from saved snapshot with 4769 different pixels.
  See diff for details: /__w/webchat-v2/webchat-v2/cypress/snapshots/theme_04/bot-frame.spec.js/__diff_output__/conversation-is-open.diff.png
        at Context.eval (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:17439:17)

Question

Do you know how can I access the screenshot taken on Github Actions CI ?

piofinn commented 3 years ago

@edouard-lopez you can use the upload-artifact action:

- name: Upload screenshots
  uses: actions/upload-artifact@latest
  if: failure()
  with:
      name: cypress-snapshots
      path: cypress/snapshots

The path will be relative to the base path of your project.

edouard-lopez commented 3 years ago

Thanks, after trying upload-artifact I decided to use https://github.com/trymbill/cypress-slack-video-upload-action which is a simpler workflow to share with my colleagues:

  - name: "Upload screenshots to Slack"
    uses: trymbill/cypress-slack-video-upload-action@v1.3.0
    if: failure()
    with:
      token: ${{ secrets.SLACK_TOKEN }}
      channels: "_tolk"
      message-text: "Cypress tests failed! They have been placed in this thread, good luck."
SrBrahma commented 1 year ago

@edouard-lopez this project is now archived. Do you know why? Do you still use it? Is there a better alternative?

Thanks!

edouard-lopez commented 1 year ago

@SrBrahma You should contact @trymbill for that, I'm not a maintainer of the project. Note, even archived you can use the repo I reckon