Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshots are not attached to HTML report #382

Open
KimberlingYarihuaman opened this issue Sep 17, 2024 · 7 comments
Open

Screenshots are not attached to HTML report #382

KimberlingYarihuaman opened this issue Sep 17, 2024 · 7 comments

Comments

@KimberlingYarihuaman
Copy link

KimberlingYarihuaman commented Sep 17, 2024

Environment:

  • Node.js version: [v20.17.0]
  • Cypress: [v13.14.1]
  • multiple-cucumber-html-reporter: [v3.7.0]
  • cypress-cucumber-preprocessor: [v4.3.1]

Config of multiple-cucumber-html-reporter

I´ve configured the report so that to be generated from cucumberJson with multiple-cucumber-html-reporter

Captura de pantalla 2024-09-17 111128

Captura de pantalla 2024-09-17 110933

Captura de pantalla 2024-09-17 111708

Also, I´ve tried using cypress-cucumber-attach-screenshots-to-failed-steps with the report, but I´ve gotten the same.

Describe the bug

The report is not getting attached the screenshots, only shows the error.

Captura de pantalla 2024-09-17 104158

Expected behavior

The report should get attached the screenshots.

@sven-seyfert
Copy link
Contributor

Hi @KimberlingYarihuaman 👋 ,

how does you TakeScreenshot function look like in Cypress and when should it fire?
I mean, in WebdriverIO, Seleninum etc. you usually have to setup a hook like Before, After, to call the specific Screenshot function. I guess this is very similar what you have to do with Cypress, am I right?

Did you do this? Get us a bit more code to work with. My feeling tells me it's not a issues of the report.

Best regards
Sven

@KimberlingYarihuaman
Copy link
Author

KimberlingYarihuaman commented Sep 23, 2024

Hi @sven-seyfert !
Cypress takes screenshots by default when the tests are failed so I assume they'll be attached automatically, so I don´t understand why they aren´t being attached in the report.

Captura de pantalla 2024-09-23 105256

Regards.

@sven-seyfert
Copy link
Contributor

sven-seyfert commented Sep 23, 2024

Like in the cypress docs described, the screenshots will be stored in cypress/screenshots folder which is maybe not recognised by the reporter 🤔 ?

Do you use cypress run or cypress open?

Additionally, Cypress will automatically capture screenshots when a failure happens during cypress run. Screenshots on failure are not automatically taken during cypress open.

My guess is: you have to define the location to the screenshots.

Best regards
Sven

Update: Also see this README.md FAQ question and answer which could help you to find the right direction.

@KimberlingYarihuaman
Copy link
Author

Hi @sven-seyfert !

I´m running the tests with cypress run and the folder cypress/screenshots are being created, but the report keeps without showing the screenshots. Also, I defined the path for the screenshots (in cucumberReport.js) but I got the same result.

Regards

@sven-seyfert
Copy link
Contributor

Okay, sad. Without a reproducible example, I cannot further support you.
Could you provide a small running cypress project which we could execute and maybe debug?

@KimberlingYarihuaman
Copy link
Author

Yes @sven-seyfert let me to do a small example and I will attach in this question.
Thanks

@KimberlingYarihuaman
Copy link
Author

KimberlingYarihuaman commented Sep 27, 2024

Hi @sven-seyfert !

I attached a small example where you will be able to reproduce the issue. You should read the README.md file to understand how to run the tests and generate the report. Please, let me know if you need something else.

cypress-tests-ok.zip

Thanks in advance

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants