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
Screenshot for each test step is required. #59
Comments
Could you please close this ticket. Thanks, |
Hi @Amrishs94 , Sorry for late reply due to work commitments. Screenshot after each step is user specific requirement, some users prefer to take after scenario and only failed ones. cucumberJS itself doesn't provide after or before steps hooks , you can refer the issue which is still open in the official cucumberjs repo - cucumber/cucumber-js#997 However there is workaround and a trick which can make use of - you can actually call screenshot method in each of the step definition after you have done your validations something like this -
you can write a helper function for I tried it out and it works magically 😄 I am attaching the report screens for your reference - closing this issue for now ! |
Ram, Could you please share me code for the helper function for the takeScreenhshot() function. Thanks, |
Hi Ram Can you please provide Takescreenshot() function code if possible? Thanks, |
@Amrishs94 @gnaneswarreddy that function is available by the webdriver itself ;) |
@FibreFoX exactly! thanks for putting out there :) |
I am getting error as
Any help? |
@PadalaSandeep - if you are still waiting for the solution you can import the below and hopefully it should work fine And for the people who asked about Takescreenshot() function its simple guys Create a simple function like below in your base class public async takeScreenshot(){ and just call where ever you want (Wither step definitions or the pages ) by just calling the method this.takeScreenshot(); simple it works , Thank you @igniteram for the solution |
for this.attach('text ') we are getting error message like this might be undefined |
Should capture screenshot for each test step. Moreover, in the HTML report when a test step is clicked it should also show the captured screenshot for that test step.
Thanks in advance.
require screenshot.docx
The text was updated successfully, but these errors were encountered: