Member-only story

Creating HTML reports for protractor

Praveen David Mathew
5 min readOct 9, 2019

--

Note: I have found an easier and better report for protractor by sauce lab use that report instead:

Read about the new report at: https://medium.com/@praveendavidmathew/protractor-best-html-report-d548d1460c36

But still, you can continue reading and see any of the features would be useful for you:

First, let us see why need reporting

Imagine you have written thousands was of wonderful test cases and you have put up it in CI/CD pipeline. You must be feeling proud right? and here the news that the first test runs for the suites you have written will run over the night and you get all excited.

Next day you come to the office and sees the below console logs:

And you have no clue what passed, what failed because the execution got interrupted and was not completed.

Printing test status and logs after each test-case execution:

Add the below code to the protractor config file:

This enables real-time reporting, allowing to print errors onto console without having to wait for the test suite to finish executing.

exports.config = {onPrepare: function(){const SpecReporter = require('jasmine-spec-reporter').SpecReporter;jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true…

--

--

Praveen David Mathew
Praveen David Mathew

Written by Praveen David Mathew

An open source advocator/WebdriverIO Projectcommiter/Postman Supernova/Postman-html-extra contributor/Stack overflow sqa moderator/Speaker

No responses yet