-
Notifications
You must be signed in to change notification settings - Fork 102
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
Attach screenshot on test failure #79
Comments
Hi @stefanteixeira , In the recent times I have gone through this challenge. I was able to solve it with the help of jestjs/jest#5292 (comment). Just wanted to share it so that it might help in your case.
Use the above from specs like below.
|
Hey @madhusudhan-patha, thanks for your reply! I guess my problem is related to how the library integrates with It works for me just if I call |
I managed to make a workaround. Assuming I already save the screenshots in the custom environment file I posted earlier, I could attach the screenshots in a Jest setup file inside an
|
Hey! First, congrats for the project, the report looks amazing and integration was seamless with my test suites.
I saw the docs and original feature requests regarding
addAttach
function, but I'm having trouble to figure out how to attach the current screenshots I save when a test fails.In my setup, I use jest-circus and I have a custom PuppeteerEnvironment which saves screenshot when a test fails. I check the event
test_fn_failure
to know when to take the screenshot. Just to have a notion, this is my custom environment:I tried adding
addAttach
passing the file path after the screenshot statement, but it doesn't work. In the examples from the README, I see theaddAttach
getting called directly in the test case. Do you have an idea of how I could make this work in my setup?Thanks in advance!
The text was updated successfully, but these errors were encountered: