4.1. Listeners
Goal
- Create a listener named
TimeListener
which logs the start time of the test execution to the console.
Solution
Hints
Listeners can be used to monitor the test execution.
Solution: tests/listeners/TimeListener.py
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Results
To be able to use TimeListener
without defining the whole path to the file, you need to set its location with --pythonpath
parameter.
Inside the tests
folder, execute the following command.
1 |
|
The start time of the execution should be mentioned at every test case:
==============================================================================
Tests.01-Greetings.01-Greetings
==============================================================================
Original Greetings :: This test case checks that the Print Your Na...
Test execution started at: 20200608 16:58:16.692!
Original Greetings :: This test case checks that the Print Your Na... | PASS |
You can check the generated log.html
file to see how your test cases worked.
Last update: June 22, 2020