Thursday, July 14, 2016

Protractor : How to generate single report for test suites

In order to generate aggregate reports we need to use consolidate option.

We will use our Suite projects that was develop through our post on how to implement suites in protractor.
We implement consolidate option on config.js file here.

Step 1 : Open the project and implement protractor-jasmine2-html-reporter package by using this post.

Step 2 : Open config.js file and write the following script and implement onPrepare() function.

image

Note that all the codes of onPrepare() function comes from the previous post except consolidate option. We make consolidate as true.

Step 3 : After running the script we see separate suite names at the report and all the suites reports are generate in a single html file.

image

Step 4 : If we make consolidate as false and run the script we see reports are generated in two separate files for two suites.

image

After running script,

image

We see reports for only one suite.

image

Step 5 : Now add another option consolidateAll and make it true.

image

After running the script we see all the suite report in a single file.

image

That’s all for now.

Happy end to end testing using Protractor!!!