Wednesday, January 25, 2017

Protractor - Show test run time in your logs

In this short article we will see how can we show the test run duration in a log file, displayed in hours, minutes, seconds.

There are some moments when we can add data in a log file: 
- jasmine started, meaning that we will add info in a log file when we started to run tests
- suite startedinside a .spec file we can have different suites (describe); we can add logs for each describe
- spec started; inside a suite we can have multiple specifications (it); we can add logs for each it
- spec done
- suite done
- jasmine done

To add the elapsed time, we need to capture start time in jasmine started and end time in jasmine done.


Happy testing and... make it green, becomes a dream :).

No comments:

Post a Comment

Popular Posts