aboutsummaryrefslogtreecommitdiff
path: root/tools/ui_flow.py
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-25 12:46:42 +0100
committercirakg <cirakg@cirakg.xyz>2026-10-25 12:46:42 +0100
commit096b5a4d17c85fa5f87db3e72364e9c3506d1e64 (patch)
tree9846544fe7d76d849df4a1ee2058f4847f674e7e /tools/ui_flow.py
parente0384274bbeab999279bdc35bdddbd8a3a451aeb (diff)
feat(pin): exactly 4 digits, entered on the 4th digit
The keypad has no OK key; the 4th digit submits, so a tap that also arrives as START can no longer submit a partial PIN (the likely cause of "Wrong PIN" before the code opened). PINs set by earlier versions still unlock and are then replaced by a 4-digit one. Opening an entry ignores a second request from the same tap. A Require PIN sent from the phone while the watch is locked now applies at the next PIN instead of waiting for Confirm all. The linter skips .claude. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/ui_flow.py')
-rw-r--r--tools/ui_flow.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/ui_flow.py b/tools/ui_flow.py
index a17d435..8c08caf 100644
--- a/tools/ui_flow.py
+++ b/tools/ui_flow.py
@@ -14,7 +14,7 @@ the screen. Watches without a button for an action use touch instead (Venu
Sq 2 has no UP/DOWN and no select button).
The app (UI-test build, source/util/TestMode.mc) starts with fake entries,
-the PIN 123456 and a frozen clock, and prints "DIAG shown <screen>" after
+the PIN 1234 and a frozen clock, and prints "DIAG shown <screen>" after
drawing each screen, so every step waits for the screen it expects instead
of sleeping. Menus are native Menu2 views that print nothing; for those the
script waits a fixed time.
@@ -65,10 +65,10 @@ MENU_SETTLE_S = 1.5 # Menu2 has no "shown" line
SETTLE_S = 0.4 # after a "shown" line, before the screenshot
CLICK_PAUSE_S = 0.25
HOLD_S = 1.6 # long enough for a hold (menu) on every device
-FIXTURE_PIN = "123456" # source/app/Fixtures.mc
-WRONG_PIN = "000000"
+FIXTURE_PIN = "1234" # source/app/Fixtures.mc
+WRONG_PIN = "0000"
FAILURES_UNTIL_WAIT = 5 # source/storage/Lockout.mc: the 5th failure starts a delay
-SELECTOR_OK = 10 # source/ui/PinView.mc: selector positions 0-9, then OK
+SELECTOR_DIGITS = 10 # source/ui/PinView.mc: selector positions 0-9 (no OK; the 4th digit submits)
GYM_CARD = "5901234123457" # source/app/Fixtures.mc: EAN-13 with its check digit
MEMBER_QR = ( # source/app/Fixtures.mc: a version 6 QR
"https://example.com/member/fake-0042?name=Alice%20Example&card=0000111122223333&valid=2027-12-31&level=gold"
@@ -298,12 +298,11 @@ class Flow:
value, xy = item.split("=")
x, y = xy.split(",")
centres[int(value)] = (int(x), int(y))
- for digit in pin:
+ for digit in pin: # the 4th digit submits
self.sim.tap(*centres[int(digit)])
- self.sim.tap(*centres[-2]) # OK
return
- for position in [int(d) for d in pin] + [SELECTOR_OK]:
- steps = (position - self.selector) % (SELECTOR_OK + 1)
+ for position in [int(d) for d in pin]:
+ steps = (position - self.selector) % SELECTOR_DIGITS
for _ in range(steps):
self.sim.press("down")
self.selector = position