protractor-jasmine2-screenshot-reporter icon indicating copy to clipboard operation
protractor-jasmine2-screenshot-reporter copied to clipboard

No screenshots on bail

Open F1LT3R opened this issue 9 years ago • 7 comments

If you bail ("quit") the test runner, no screenshots are taken (or no screenshots are saved).

The screenshots only appear to be saved when all the specs have finished running. I understand why this makes sense for the html report, but I think it is bad for the screenshots.

For example: say you have a very large suite of tests, you see one failure on the screen. You kill the tests. You go to see the screenshot to see what happened. No screenshot because the reporter hasn't finished up and move the screenshots into the directory yet.

F1LT3R avatar Feb 12 '16 20:02 F1LT3R

Actually screenshots should be written when spec is finished (when the runner calls .specDone method of the reporter), but the report itself is only generated when the whole run is finished.

mlison avatar Mar 28 '16 19:03 mlison

Interesting. Perhaps this is a bug then?

F1LT3R avatar Mar 28 '16 19:03 F1LT3R

Yep I'll have to check it out. Will get back to you.

mlison avatar Mar 28 '16 19:03 mlison

I am noticing the final screenshot for a test is taken properly, but the report has "undefined" in the link; regardless of the pass/fail status of the test. Does that sound related or perhaps a new issue?

psufoxman avatar Apr 04 '16 15:04 psufoxman

@psufoxman that sounds more like it's related to #10

mlison avatar Jul 01 '16 12:07 mlison

@F1LT3R I've tried replicating this multiple times, but can't seem to reproduce it. If you're still having this problem, could you please provide some additional details about the environment you're running in? Node version, platform and such.

mlison avatar Jul 01 '16 12:07 mlison

Thanks for trying this Michal. Are you saying that if the whole test run is not finished, that you still see the screenshot from the last test that failed? You could try a process.exit() in your test to force a similar behavior.

My environment is:

  • OSX
  • Node v4.2.5

If it helps, I created a custom reporter to work around this behavior:

https://github.com/F1LT3R/protractor-jasmine2-fail-whale

F1LT3R avatar Jul 01 '16 15:07 F1LT3R