SeleniumBase/examples/example_logs
Michael Mintz e5d3d0d64a Update the docs 2018-08-01 21:04:00 -04:00
..
ReadMe.md Update the docs 2018-08-01 21:04:00 -04:00
basic_test_info.txt Move example log files to the example_logs folder 2016-06-18 18:57:27 -04:00
page_source.html Move example log files to the example_logs folder 2016-06-18 18:57:27 -04:00
screenshot.png Screenshots are saved as png files (not jpg files) 2017-09-01 00:47:05 -04:00

ReadMe.md

Logging, Screenshots, and Reports examples

Log files in example_logs/ were generated when test_fail.py ran and failed. By default, logs are saved to latest_logs/. If ARCHIVE_EXISTING_LOGS is set to True in settings.py, past logs get saved to archived_logs/.

pytest test_fail.py --browser=chrome

nosetests test_fail.py --browser=firefox

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 my_test_suite.py --html=report.html

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 my_test_suite.py --report --browser=chrome

(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.)