3
votes

I am preparing a suite of E2E tests using protractor and Jasmine. Currently I'm running these from the command line using Node. In the past I've used Jasmine tests with the SpecRunner.html setup, which shows the results in the browser as they are run, allows you to select individual tests or sub-suites of tests to run, etc.

Has anyone set up Jasmine + Protractor tests in that way - output going into one browser window, while tests run in another browser window?

Alternatively, is there a Jasmine reporter that will provide a similar output format even if I still have to run the tests from the command line?

1

1 Answers

4
votes

For jasmine2, look into jasmine2-screenshot-reporter package.

For jasmine1:

I've used protractor-html-screenshot-reporter package that generates nice test reports including screenshots:

  • initialize a baseDirectory inside the onPrepare function:

    onPrepare: function() {
          // Add a screenshot reporter and store screenshots to `/tmp/screnshots`:
          jasmine.getEnv().addReporter(new HtmlReporter({
             baseDirectory: '/tmp/screenshots'
          }));
       }
    
  • and observe a nicely HTML formatted test results:

enter image description here

Hope this is what you were asking about.