Testery supports taking screenshots and having those screenshots attached to your test results. This works by placing screenshots in a screenshots folder in your current directory using the framework of your choice.
Testery highly recommends adding screenshots to your tests as this can often help you troubleshoot test failures that occur due to pages not loading quickly, elements changing, sites being down, etc.
let fs =require('fs');if (!fs.existsSync("./screenshots")){console.log("Screenshots dir being created.");fs.mkdirSync("./screenshots"); } browser.saveScreenshot("./screenshots/"+Math.random() +".png");
In the SpecFlow example above, the after scenario hook will be executed right after a test either passes or fails if when the @takeScreenshot tag is included on a feature file. The ("screenshot") can be removed from the [AfterScenario] annotation and that will run the hook without having to specify the @screenshot tag.