feat(tests): keyboard shortcuts for markers
What changed, and why it matters
This commit adds keyboard shortcuts to a Trezor internal test-reporting web page used by developers during UI testing. It lets reviewers press 'a', 's', or 'd' to mark a test result as OK, OK & UPDATE, or BAD, and improves the visual styling of the buttons. There is no security relevance: the tool is not shipped to end users, does not handle secrets, and does not change device firmware or wallet behavior.
No security action needed. This is a developer-experience improvement to internal test tooling.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is confined to tests/ui_tests/reporting/testreport.css, testreport.js, and testreport.py. testreport.py now wraps each mark button in a div with a keyboard shortcut label ([a], [s], [d]). testreport.js adds keydown handlers that trigger the corresponding button clicks. testreport.css adds cosmetic styling. The scroll amount variable was hoisted out of the keydown handler. No cryptographic, authentication, parsing, or firmware code is touched.
Changed components
tests/ui_tests/reporting/testreport.csstests/ui_tests/reporting/testreport.jstests/ui_tests/reporting/testreport.pyInspect captured patch +38 / −5
diff --git a/tests/ui_tests/reporting/testreport.css b/tests/ui_tests/reporting/testreport.css
index f0d90665..a01c766b 100644
--- a/tests/ui_tests/reporting/testreport.css
+++ b/tests/ui_tests/reporting/testreport.css
@@ -18,6 +18,13 @@ tr.bad a:visited {
right: 5px;
width: 500px;
padding: 1em;
+ font-family: Inter, 'Helvetica Neue', Arial, sans-serif;
+ font-size: 1rem;
+ line-height: 1.5;
+ color: #1f2937;
+ background: #f3f4f6;
+ border-radius: 8px;
+ box-shadow: 0 2px 6px rgb(0 0 0 / 10%);
}
#markbox #buttons {
@@ -25,11 +32,17 @@ tr.bad a:visited {
justify-content: space-evenly;
}
+#markbox .mark {
+ display: flex;
+ flex-direction: column;
+}
+
#markbox button {
border: 3px solid;
font-size: 20pt;
padding: 1em;
background: white;
+ border-radius: 10px;
}
#markbox #mark-ok {
diff --git a/tests/ui_tests/reporting/testreport.js b/tests/ui_tests/reporting/testreport.js
index 103d453b..fb63672a 100644
--- a/tests/ui_tests/reporting/testreport.js
+++ b/tests/ui_tests/reporting/testreport.js
@@ -150,6 +150,7 @@ function onLoadTestCase() {
}
}
+ const scrollAmount = window.location.href.includes("T3W1") ? 1000 : 500;
const p = document.createElement("p");
p.append("[j] / [k] to scroll");
markbox.append(p);
@@ -160,11 +161,24 @@ function onLoadTestCase() {
return;
}
- const scrollAmount = window.location.href.includes("T3W1") ? 1000 : 500;
+ if (e.key === "a") {
+ e.preventDefault();
+ document.getElementById("mark-ok").click();
+ }
+ if (e.key === "s") {
+ e.preventDefault();
+ document.getElementById("mark-update").click();
+ }
+ if (e.key === "d") {
+ e.preventDefault();
+ document.getElementById("mark-bad").click();
+ }
if (e.key === "j") {
+ e.preventDefault();
window.scrollBy({ top: scrollAmount, behavior: "smooth" });
}
if (e.key === "k") {
+ e.preventDefault();
window.scrollBy({ top: -scrollAmount, behavior: "smooth" });
}
for (const [a, key] of links) {
diff --git a/tests/ui_tests/reporting/testreport.py b/tests/ui_tests/reporting/testreport.py
index f720624a..77694676 100644
--- a/tests/ui_tests/reporting/testreport.py
+++ b/tests/ui_tests/reporting/testreport.py
@@ -340,11 +340,17 @@ def failed(result: TestResult) -> Path:
_header(result.test.id, result.expected_hash, result.actual_hash)
with div(id="markbox", _class="script-hidden"):
- p("Click a button to mark the test result as:")
+ p("Mark the test result as:")
with div(id="buttons"):
- t.button("OK", id="mark-ok")
- t.button("OK & UPDATE", id="mark-update")
- t.button("BAD", id="mark-bad")
+ with div(_class="mark"):
+ t.span("[a]", _class="helper")
+ t.button("OK", id="mark-ok")
+ with div(_class="mark"):
+ t.span("[s]", _class="helper")
+ t.button("OK & UPDATE", id="mark-update")
+ with div(_class="mark"):
+ t.span("[d]", _class="helper")
+ t.button("BAD", id="mark-bad")
if download_failed:
with p():
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.