driver: take screenshots whenever we're running from terminal as opposed to interactive

- this gives us more consistent results based on how users use cypress
- is interactive could turn off at any time (such as when running too
many tests)
This commit is contained in:
Brian Mann
2017-09-16 21:17:52 -04:00
parent 394a4911ea
commit 34f3e1ecc6
3 changed files with 5 additions and 3 deletions

View File

@@ -53,7 +53,10 @@ takeScreenshot = (runnable, name, log, timeout) ->
module.exports = (Commands, Cypress, cy, state, config) ->
Cypress.on "runnable:after:run:async", (test, runnable) ->
if test.err and config("screenshotOnHeadlessFailure") and not config("isInteractive")
## we want to take a screenshot if we have an error, we're
## to take a screenshot and we are running from a terminal
## which means we're exiting at the end
if test.err and config("screenshotOnHeadlessFailure") and config("isTextTerminal")
new Promise (resolve) ->
## open up our test so we can see it during the screenshot

View File

@@ -1,6 +1,5 @@
{
"baseUrl": "http://localhost:3500",
"videoRecording": false,
"hosts": {
"*.foobar.com": "127.0.0.1"
}

View File

@@ -423,7 +423,7 @@ module.exports = {
## if we've been told to record and we're not spawning a headed browser
browserCanBeRecorded = (name) ->
name == "electron"
name is "electron"
if videoRecording
if browserCanBeRecorded(browser)