SeleniumBase/examples/example_logs
Michael Mintz 3b86bef97a Update the docs 2020-05-19 17:22:07 -04:00
..
ReadMe.md Update the docs 2020-05-19 17:22:07 -04:00
basic_test_info.txt Update the sample logs 2020-01-13 02:57:24 -05:00
page_source.html Update the example logs 2018-08-30 23:57:30 -04:00
screenshot.png [ImgBot] Optimize images 2018-11-15 01:07:59 +00:00

ReadMe.md

Logging, Screenshots, and Reports:

Log files in SeleniumBase/examples/example_logs were generated when test_fail.py ran and failed. During test failures, logs and screenshots get saved to the latest_logs/ folder. If --archive-logs is set, test logs will get archived to the archived_logs/ folder.

pytest test_fail.py --browser=chrome

nosetests test_fail.py --browser=firefox

Examples of expected log files generated during failures:


In addition to logging, you can also generate test reports:

Reports are most useful when running large test suites. Pytest and Nosetest reports are handled differently.

Pytest Reports:

Using --html=report.html gives you a fancy report of the name specified after your test suite completes.

pytest test_suite.py --html=report.html
Example Pytest Report

Nosetest Reports:

The --report option gives you a fancy report after your test suite completes. (Requires --with-testing_base to also be set when --report is used because it's part of that plugin.)

nosetests test_suite.py --report --browser=chrome
Example Nosetest Report

(NOTE: You can add --show_report to immediately display Nosetest reports after the test suite completes. Only use --show_report when running tests locally because it pauses the test run.)