Skip to content
New issue

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

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

Already on GitHub? # to your account

When Cypress tests fail, I expect on allure reports creation to have failed screenshot automatically attached #204

Open
Shikharnigam87 opened this issue Apr 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Shikharnigam87
Copy link

Shikharnigam87 commented Apr 18, 2023

List of dependencies and versions used on Microsoft Windows 10 machine:
cypress: 12.9.0
shelex/cypress-allure-plugin: 2.22.0
allure-commandline: 2.13.8
cypress-multi-reporters: 1.6.3
mocha-junit-reporter: 2.0.2

Node: 16.16.0

After upgrading to Cypress 12.9.0 and node 16.16.0 allure reports are not attaching screenshots for failed tests automatically

Pre-requisites -
shelex/cypress-allure-plugin is configured as per latest documentation
allure-commandline is installed on machine

Steps to reproduce issue:

  1. Execute tests in Run mode using command
  2. npx cypress run --env allure=true --browser chrome --headed --spec 'test file path'
  3. Fail one or 2 tests intentionally
  4. Navigate to results folder after execution is finished, and verify that screenshots are saved inside 'screenshots' folder (This is happening properly for me as well)
  5. allure-results folder is also created inside parent project folder
  6. Generate allure report using command
  7. allure generate allure-results --clean -o results/allure-report
  8. Navigate to results/allure-report folder and open index.html. In failed tests no screenshots attached
    (Expected behaviour - To have failed tests screenshots attached in the report)

results/allure-report/attachment folder seems to be empty (Which was not the case with earlier version which i was using)

Note: I have not used or added any additional env variables which affect allure reports within cypress configuration file

And also seeing that if I try to change or modify path for allure results folder using env allureResultsPath within Cypress.config.json file, it is always defaulting to allure-results folder

Can someone please look into this issue, or provide suggestions to resolve this.

@Shikharnigam87 Shikharnigam87 added the bug Something isn't working label Apr 18, 2023
@Shelex
Copy link
Owner

Shelex commented Apr 21, 2023

Hi @Shikharnigam87
Thank you for opening an issue.

It is not clear to me: what version of cypress-allure-plugin do you have in the end? The start of your message states it is 2.22.0, which was released back in Nov 2021 and I guarantee you it will not work with cypress 10+.

Also, I have an example project with latest plugin version: https://github.com/Shelex/cypress-allure-plugin#examples

And I have a report with attachments available: https://shelex.github.io/cypress-allure-plugin-example/57/#suites/c831d81be87472a1202a702bb00fa775/36bda79be8e52519/

Could you please check the latest version or try it if you have not upgraded it yet?

@Shikharnigam87
Copy link
Author

Shikharnigam87 commented Aug 30, 2023

Hi Shelex, do you have any sample examples which are not using Cucumber. Also I have upgraded to
cypress: 12.14.0
shelex/cypress-allure-plugin: 2.40.0

allure-commandline: 2.13.8
cypress-multi-reporters: 1.6.3
mocha-junit-reporter: 2.0.2

Node: 16.16.0

Steps to reproduce issue:
Execute tests in Run mode using command
npx cypress run --env allure=true --browser chrome --headed --spec 'test file path'
Fail one or 2 tests intentionally
Navigate to results folder after execution is finished, and verify that screenshots are saved inside 'screenshots' folder (This is happening properly for me as well)
allure-results folder is also created inside parent project folder
Generate allure report using command
allure generate allure-results --clean -o results/allure-report
Navigate to results/allure-report folder and open index.html. In failed tests no screenshots attached
(Expected behaviour - To have failed tests screenshots attached in the report)
results/allure-report/attachment folder seems to be empty (Which was not the case with earlier version which i was using)

thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants