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
Screenshots seemed not to be sent using the afterStep hook #80
Comments
Submit an issue to wdio repo to make after step hook compatible(at least provide for which step hooks is executing). You have to know which step failed to send screenshot to it. I am not sure that something should be done in reporter code. |
I came across the same issue when using webdriverio v5 and ReportPortal v5. The afterStep hook signature was changed when it was updated so it respects promises and runs synchronously. You can see the issue here. Note: I've noticed in the
That the Instead the first approach I tried was to set the
This won't work since the wdio-reportportal-reporter receives the The primary issue comes down to being able to get the step that ran so that we can attach the screenshot to it. As a workaround (I'm not a fan of the approach) to get things working I created a custom reporter and required it in my wdio.conf.js file. Below is the reporter:
This was the only way I was able to get the step so that I could attach the screenshot correctly. Another thing to note, when using Report Portal v5, that if you use log level This isn't the best solution, but for me it's not to invasive and suites our needs while we wait for Report Portal v5 to come out of beta. |
@jpaolini thanks for sharing your thoughts. I've made some quick research and came to the same conclusions.
yeah. it isn't good to use browser in reporter.. I'm currently short on time. Hope will make solution for this and implement better Cucumber steps support for Report Portal V5 by the end of September. |
@jpaolini Indeed I was able to see that screenshot with the workaround you suggest. I had the same issue so I think we should open also an issue for the |
@gromanas yes. Please, submit the issue, simple repo to reproduce will help us in webdriverio repo fix\research it. |
It definitely feels dirty, lol I was thinking of looking into how to leverage the |
My thoughts
I think it is the best that we can do right now. Another approach is fix wdio-cucumber adapter to pass step name to afterStep hook, but I am not ready to do it. What do you think? @jpaolini |
I have opened the issue for the |
Those are good points, I forgot about the
I think that would work nicely and be a relatively quick win to help with some of the issues folks are having. For the long term though, I think the real win would be to go to the source of all of the headache which is cucumberjs not providing a before/after step hook. If that get implemented then it'll funnel through the stack and we wouldn't need the work arounds. I was looking at this pr and it seems like the updates to have the after/before steps respect the rules (promises/synchronous execution) of the other wdio hooks is the reason why it doesn't have the step definition anymore. I think it's worth investigating cucumberjs to see the work involved to add those hooks as part of this. |
Closing this one as far as it is reportportal related. |
@mgrybyk Need your advice as wdio-cucumber adapter expert. Are there any way to pass cucumber step name to wdio |
There is no easy way to do it, it's not something like pass an additional argument. |
I am not familiar with cucumber and v5 cucumber integration. If you can help us with we really appreciate it and can wait necessary time |
Now working well. Check readme for implementation details. @mgrybyk many thanks for help with wdio-cucumber enhancements |
The problem
I am trying to use the cucumber example to attach images into report portal and the image does not post.
Environment
Details
Hello all! My question is that I am trying to integrate rp to my project. I have successfully install rp but I am facing an issue on how to send a screenshot to rp. I was trying to use the example in ReadMe file. According to https://webdriver.io/docs/wdio-reportportal-reporter.html I need to add it in afterStep. What I have seen the hook has been change from
afterStep: function (uri, feature, scenario, step, result)
toafterStep: function (uri, feature, { error, result }).
Also some logs from
sendToReporter()
that is used fromsendFileToTest()
Code To Reproduce Issue [ Good To Have ]
The text was updated successfully, but these errors were encountered: