mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-15 11:46:57 -06:00
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:
@@ -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
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"baseUrl": "http://localhost:3500",
|
||||
"videoRecording": false,
|
||||
"hosts": {
|
||||
"*.foobar.com": "127.0.0.1"
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user