1

I have an AngularJS app that I am using end-to-end testing on. This app relies on Protractor and Jasmine for testing. I'm running my tests via a Grunt task.

Does anyone know of a task or a way to display a summary of Protractor's test results in the command line? Currently, I have time-grunt to display a summary of how long each task took. I'd love to have the ability to show something like 'Ran [x] tests. [y] Succeeded. [z] Failed.'

Thank you

Bastien Caudan
  • 4,482
  • 1
  • 17
  • 29
user3284007
  • 1,697
  • 7
  • 27
  • 43

2 Answers2

1

You can add a consoleReporter. It's a little more verbose, but it does give a summary at the end.

Using jasmine-reporters you can add several reporters. My favorite is the HtmlReporter that takes screenshots when the test fails. Below is an example of several reporters configured in the protractor.conf.js

onPrepare: function () {

    require('jasmine-reporters');
    jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('reports', true, true));
    jasmine.getEnv().addReporter(new jasmine.ConsoleReporter());

    jasmine.getEnv().addReporter(new HtmlReporter({
        baseDirectory: 'reports/screenshots'   ,
        takeScreenShotsOnlyForFailedSpecs: true
    }));


},
Andre Paap
  • 751
  • 5
  • 9
0

If you want to tweak what you display in the console you can use jasmine-spec-reporter:

enter image description here

Bastien Caudan
  • 4,482
  • 1
  • 17
  • 29