qxf2 / qxf2-page-object-model

Write Selenium and Appium tests in Python using the Page Object pattern. This Pythonic GUI and API test automation framework will help you get started with QA automation quickly. It comes with many useful integrations like - email, BrowserStack, Slack, TestRail, etc. This repository is developed and maintained by Qxf2 Services.
https://qxf2.com
MIT License
256 stars 191 forks source link

Explore using prettytable to print test result summary #424

Open shivahari opened 1 month ago

shivahari commented 1 month ago

Explore using prettytable to print the test result summary.

shivahari commented 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:

[!NOTE] I have added the development branch details to this issue.

shivahari commented 1 month ago

I have completed adding a prettytable Test result summary.

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.

shivahari commented 4 weeks ago

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:

failure_test_result_summary_old

This is how the Failure summary will be printed using prettytable:

failure_test_result_summary_prettytable

The new summary will list the scenarios failed in a test, this will be more useful than the plain Assertion errors thrown currently.