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

Incomplete Allure Reporting on Errors in before and after Hooks #149

Closed
chaitanyarajugithub opened this issue Jun 26, 2024 · 7 comments · Fixed by #151
Closed

Incomplete Allure Reporting on Errors in before and after Hooks #149

chaitanyarajugithub opened this issue Jun 26, 2024 · 7 comments · Fixed by #151
Labels
bug Something isn't working minor severity of issue

Comments

@chaitanyarajugithub
Copy link

Description:
There is an issue with the Allure reporting in our Cypress tests where failures in the before and after hooks are not being logged correctly. Specifically:

Error in before Hook:
When an error occurs in the before hook, Cypress stops executing further tests in that suite.
The after hook still executes for cleanup purposes.

Execution of after Hook:
If the after hook executes without any errors, Allure correctly logs the failure details from the before hook.
However, if the after hook also encounters an error, Allure does not properly log the failure details from both the before and after hooks. This results in incomplete error reporting in Allure.

Steps to Reproduce:
Create a Cypress test suite with before and after hooks.
Introduce an error in the before hook.
Ensure the after hook also encounters an error.
Execute the test suite and observe the Allure report.

Expected Result:
Allure should correctly log the errors from both the before and after hooks.

Actual Result:
Allure logs the failure details from the before hook correctly if the after hook executes without errors.
If the after hook also fails, Allure does not log the errors correctly, leading to incomplete reporting.

@chaitanyarajugithub
Copy link
Author

image

@mmisty
Copy link
Owner

mmisty commented Jun 26, 2024

@chaitanyarajugithub hello ,
Thank you for reporting this issue, will take a look

@mmisty
Copy link
Owner

mmisty commented Jun 26, 2024

I see that cypress itself cannot stand this behavior - and it doesn't output error
image
I'll trye to fix for adllure, but seems it is not so easy
I would suggest better do everything in before hooks

@chaitanyarajugithub
Copy link
Author

Thanks for the quick response @mmisty . Please try from your end, until then I will modify my code.
But if we can fix that, it would be helpful.

@mmisty
Copy link
Owner

mmisty commented Jun 27, 2024

@chaitanyarajugithub JFYI, this is related to cypress issue (which I've just created) cypress-io/cypress#29762

@mmisty mmisty added bug Something isn't working minor severity of issue labels Jun 27, 2024
mmisty added a commit that referenced this issue Jun 28, 2024
@mmisty
Copy link
Owner

mmisty commented Jun 28, 2024

should be fixed in v2.0.10

@chaitanyarajugithub
Copy link
Author

Thanks @mmisty for your quick support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor severity of issue
Projects
None yet
2 participants