How do I take a screenshot when a test in internjs fails?
问题 I am having issues figuring out how to take a screenshot ONLY when a test fails in InternJs. I have this simple test in my registerSuite; 'verify google homepage': function () { var url = 'https://www.google.com/'; return this.remote .get(url) .getCurrentUrl() .then(function (data) { assert.strictEqual(data, url, 'Incorrect URL'); }) .findByName('q') .click() } I can simply create a screenshot using the following code; .takeScreenshot .then(function (data) { fs.writeFileSync('/path/to/some