mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-27 23:02:02 +00:00
tests/ui: order tests in summary
This commit is contained in:
parent
b99a6d5f6c
commit
23b3a59a5d
@ -166,7 +166,7 @@ def pytest_sessionfinish(session, exitstatus):
|
|||||||
for t in test:
|
for t in test:
|
||||||
test_names[status].add(get_test_name(t.nodeid))
|
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):
|
def pytest_terminal_summary(terminalreporter, exitstatus, config):
|
||||||
|
@ -74,23 +74,23 @@ def clear_dir():
|
|||||||
(REPORTS_PATH / "passed").mkdir()
|
(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")
|
title = "UI Test report " + datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
doc = dominate.document(title=title)
|
doc = dominate.document(title=title)
|
||||||
|
|
||||||
with doc:
|
with doc:
|
||||||
h1("UI Test report")
|
h1("UI Test report")
|
||||||
if status == 0:
|
if not failed_tests:
|
||||||
p("All tests succeeded!", style="color: green; font-weight: bold;")
|
p("All tests succeeded!", style="color: green; font-weight: bold;")
|
||||||
else:
|
else:
|
||||||
p("Some tests failed!", style="color: red; font-weight: bold;")
|
p("Some tests failed!", style="color: red; font-weight: bold;")
|
||||||
hr()
|
hr()
|
||||||
|
|
||||||
h2("Failed", style="color: red;")
|
h2("Failed", style="color: red;")
|
||||||
_report_links(tests["failed"], "failed")
|
_report_links(failed_tests, "failed")
|
||||||
|
|
||||||
h2("Passed", style="color: green;")
|
h2("Passed", style="color: green;")
|
||||||
_report_links(tests["passed"], "passed")
|
_report_links(passed_tests, "passed")
|
||||||
|
|
||||||
return _write(REPORTS_PATH, doc, "index.html")
|
return _write(REPORTS_PATH, doc, "index.html")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user