-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[🐛 Bug]: Cucumber - Screenshot not attached in Allure report in failed step #8323
Comments
@anupamck you should use async await for hooks too , could you try that :
|
Please leave a comment if its still needs to reopened |
@praveendvd - Thank you! Making it async resolved the problem. If that is the case, does it not make sense to update this in the documented example too? Under documentation? |
Can you point to where in the docs this is wrong? |
https://webdriver.io/docs/allure-reporter/
It isn't wrong, strictly speaking, since the feature works in most cases without async await. But if this issue isn't a bug, I think the document ought to also mention this. |
@anupamck @christian-bromann its better to update that as we have same issue reopened many times, thanks for pointing it out . Previously we used to support webdriverio sync mode. Now its not there so will update that documentation |
Thanks both @praveendvd and @anupamck 👏 |
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
7.19.17
Node.js Version
14.17.6
Mode
Standalone Mode
Which capabilities are you using?
Cucumber
What happened?
Despite clearly including the command for capturing screenshot in case of failure in the
Afterstep
hook, no screenshot is captured and attached in the Allure report.afterStep: function (step, scenario, result, context) { // browser.takeScreenshot(); if(!result.passed) { browser.takeScreenshot(); console.log("A test has failed!"); } },
I've also ensured that the
disableWebdriverScreenshotsReporting
flag is set to false.Further, the log message directly below the screenshot works. Therefore, the hook is executed. I also notice that if I take a screenshot before the
if(!result.passed)
condition, screenshots are attached in every step in the Allure report, which is the expected behaviour.What is your expected behavior?
Screenshots are attached with the failed step in the Allure report.
How to reproduce the bug.
https://github.com/anupamck/wdio-allure-screenshot-bug
It is just the standard example repo with cucumber + page objects and one additional test.
Relevant log output
-
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: