WasiqB / multiple-cucumber-html-reporter

Generate beautiful Cucumber HTML reports
https://github.com/WasiqB/multiple-cucumber-html-reporter/blob/main/README.md
MIT License
250 stars 117 forks source link

Screenshots are not attached to HTML report #382

Open KimberlingYarihuaman opened 2 weeks ago

KimberlingYarihuaman commented 2 weeks ago

Environment:

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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

KimberlingYarihuaman commented 4 days ago

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.