[Feature] Add ability of taking screenshot after test.step is finished
See original GitHub issueWould great to have a way of tacking screenshot when the test.step
function is finished, so that it is visible on Allure report.
Maybe some optional parameter, or maybe some step object passed to the callback that have screenshot function, like
test.step('do stuff',() => {
step.screenshot('some name here')
}, {screenshot: true});
or
test.step('do stuff', step => {
step.screenshot('some name here')
});
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to take Screenshot in Selenium WebDriver - BrowserStack
An easy way to do this would be to use TestNG annotations. Here are the steps to capture a screenshot in Selenium in...
Read more >How to capture a screenshot after each step in tests with JAVA ...
Solved this using Aspects. Was pretty tricky, note the annotation: @After("call(public * cucumber.runtime.StepDefinitionMatch.runStep(.
Read more >How to add screenshot at each step in the same test case?
I am using TestNG framework and I have a test case where I am taking screenshot at each step and pushing to report....
Read more >Managing automatic test screenshot settings
Capturing many screenshots can impair test performance. You can control which types of screenshots the system captures to minimize this ...
Read more >How to Take a Screenshot in Selenium - Testim.io
To take a screenshot, you should use the TakesScreenshot method. This method notifies the Selenium WebDriver to capture the screenshot.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also came with the following fixture for taking screenshots (maybe someone will find it useful)
and usage
Actually I figured it out. You can use testInfo object to do that. Kind of
But it attaches screenshot to the overall result (in Allure at least) so could be a bit more convenient to be able to attach to the step. Also would be a bit less of code if the
testInfo
object was available in the step callback, otherwise in custom fixtures I have to provide test info as a fixture. My fixture exampleand test