Open shivahari opened 1 month ago
My conclusion - We can use prettytable
to print test result summary in our framework ✅
My findings after using prettytable
to create a Test Result Summary table:
I was able to create a table to post the test result summary, this is how it looked:
The log file test_example_form.log displayed the test result summary table, but the table needs to be at the end of the test. The log file displayed the table in the middle.
The consolidated_log.txt did not display the test result summary though. The table might need to be converted to a string before it can be viewed in the .txt
file, I need to check this.
We might need to create tables for: Failure Summary
, Exceptions
& Artifacts
(to show where the screenshot
is).
This table creation & print needs to happen in pytest
after hook, this might make the table be printed at the end of the test.
[!NOTE] I have added the development branch details to this issue.
I have completed adding a prettytable
Test result summary.
This summary will be printed when there is a failure. It will print the test name and the list of scenarios failed in that test. No prettytable
summary will be printed if all the tests pass.
I implemented this by replacing pytest's
default terminalreporter
plugin with a CustomTerminalReporter
plugin I created. This custom plugin will use prettytable
to print the summary.
I have implemented this change for the UI
tests alone. I will work on adding this to the Mobile
tests too. Implementing it for API
test can only be done after the API framework starts using the core_helpers/logging_objects.py
module rather than than utils/result.py
module.
I have pushed my changes to the branch
My changes will print the failure summary using prettytable
.
This is how the Failure summary is printed currently:
This is how the Failure summary will be printed using prettytable
:
The new summary will list the scenarios failed in a test, this will be more useful than the plain Assertion
errors thrown currently.
Explore using prettytable to print the test result summary.