1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 19:08:12 +00:00

tests/ui: order tests in summary

This commit is contained in:
Tomas Susanka 2020-01-09 14:37:15 +00:00
parent b99a6d5f6c
commit 23b3a59a5d
2 changed files with 5 additions and 5 deletions

View File

@ -166,7 +166,7 @@ def pytest_sessionfinish(session, exitstatus):
for t in test:
test_names[status].add(get_test_name(t.nodeid))
report.index(test_names, exitstatus)
report.index(sorted(list(test_names["passed"])), sorted(list(test_names["failed"])))
def pytest_terminal_summary(terminalreporter, exitstatus, config):

View File

@ -74,23 +74,23 @@ def clear_dir():
(REPORTS_PATH / "passed").mkdir()
def index(tests, status):
def index(passed_tests, failed_tests):
title = "UI Test report " + datetime.now().strftime("%Y-%m-%d %H:%M:%S")
doc = dominate.document(title=title)
with doc:
h1("UI Test report")
if status == 0:
if not failed_tests:
p("All tests succeeded!", style="color: green; font-weight: bold;")
else:
p("Some tests failed!", style="color: red; font-weight: bold;")
hr()
h2("Failed", style="color: red;")
_report_links(tests["failed"], "failed")
_report_links(failed_tests, "failed")
h2("Passed", style="color: green;")
_report_links(tests["passed"], "passed")
_report_links(passed_tests, "passed")
return _write(REPORTS_PATH, doc, "index.html")