How to Add Screenshot to Jenkins Cucumber Reports for Capybara

If you are using Capybara and Cucumber for test automation and Jenkins for CI/CD process you can run your test over Jenkins and see the result by Cucumber Result Plugin, for more information check the plugin page. By this plugin you can also see the screenshots taken when test cases fail. 

To produce the result you need to save the result of the test as .json file, you can use the following command: 

   cucumber features -f json -o cucumber_result.json

To enable to take screenshot if a case fails you need to set the application hook  of after case. The following configuration makes it automatically. See it and change screenshot path with your path. The key point is embedding the image after taking it then reports plugin make it visible on the report.



Cucumber Result Plugin

Screenshot for the failed test case

Comments

Popular posts from this blog

Selenium Error "Element is not currently interactable and may not be manipulated"

Change Default Timeout and Wait Time of Capybara

Page-Object Pattern for Selenium Test Automation with Python

Performance Testing on CI: Locust is running on Jenkins

How to Set Shared Preferences in Espresso Test for Kotlin and Java