-
Notifications
You must be signed in to change notification settings - Fork 14
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
How do I attach screenshot with my failed test case? #14
Comments
Screenshorts for failed tests generate automatically using protractor.browser.takeScreenshot() method. |
What if I'm using mocha, and for me client.screenshot() function returns the screenshot or I can client.saveScreenshot() to save it in some location |
Unfortunately, now it works only with protractor. I'll think how to implement custom screenshot. |
Okay so what I did is afterEach("take screenshot on failure", function() { Also updated mochawesome.js to take the same name |
Done. version 1.5.9 |
Hello Thx for the reply |
@AndrewFisher093 You can use it directly, my test run by below command: |
@BelAn97 logReport.setScreenshot(this, imageFileName) , will imageFileName accept a file name with a relative or absolute path or is it just a name? I am not able to see the screenshot in the report when my test is in the test folder and the screenshot is generated is one level up in ./mochawesome-reports/screenshots/ folder. |
|
require('mochawesome-screenshots/logReport'); |
Can i use this functionality without Protector? Thanks. |
it uses default protractor's browser.takeScreenshot() method, but if you do not have browser object - this will skip. |
I'm using mocha for my test case. I am getting report using mochawesome as well with mochawesome screenshot, How do I attach screenshot with my failed test case?
The text was updated successfully, but these errors were encountered: