Closed newagebegins closed 7 years ago
This might be useful as an example but I wouldn't add this to this library. It's simple enough to write yourself. Most of your code is specific to the way you want your path formatting done, which is your preference and would need to be configured. It's easy enough to do:
afterEach(function() {
if (this.currentTest.state !== 'passed') {
casper.capture(new Date().toLocaleString() + '-' + this.currentTest.fullTitle() + '.png')
}
})
3 lines. and users might want to add more logic in when they capture the screenshot, what path they put it under, etc. It doesn't belong in the project.
I see your point. Thanks!
With complicated test scripts it can be difficult to understand what exactly went wrong and having automatic screenshots on failures help with this greatly.