diff options
Diffstat (limited to 'tools/ui_flow.py')
| -rw-r--r-- | tools/ui_flow.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/ui_flow.py b/tools/ui_flow.py index 5428509..eea3e17 100644 --- a/tools/ui_flow.py +++ b/tools/ui_flow.py @@ -63,6 +63,8 @@ GYM_CARD = "5901234123457" # source/app/Fixtures.mc: EAN-13 with its check digi 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" ) +PARCEL_DM = "PARCEL-FAKE-0042-7731" # source/app/Fixtures.mc: Data Matrix +TICKET_PDF417 = "Boarding pass FAKE 0042 seat 12A" # source/app/Fixtures.mc: PDF417 QR_TIMEOUT_S = 30.0 # the QR is encoded in timer steps the first time @@ -430,7 +432,8 @@ def flow_lockout(f: Flow) -> None: def flow_code(f: Flow) -> None: - """The EAN-13 gym card (index 6) and the QR card (7): their screenshots must decode.""" + """The EAN-13 gym card (index 6), the QR (7), Data Matrix (8) and PDF417 (9) + cards: their screenshots must decode.""" f.act() f.back() # leave the waiting PIN screen f.expect("list") @@ -448,10 +451,20 @@ def flow_code(f: Flow) -> None: f.act() f.open_focused_row() f.expect("code", QR_TIMEOUT_S) - encoded = f.log.latest(r"DIAG qr_encoded version=(\d+) ms=(\d+)") + encoded = f.log.latest(r"DIAG matrix_encoded type=\d+ size=(\S+) ms=(\d+)") if encoded is not None: - print(f"[{f.sim.device_dir.name}] QR version {encoded.group(1)} encoded in {encoded.group(2)} ms") + print(f"[{f.sim.device_dir.name}] QR {encoded.group(1)} encoded in {encoded.group(2)} ms") f.shot("code_qr", expect_code=MEMBER_QR) + # Data Matrix (8) and PDF417 (9), also encoded as jobs the first time. + for name, expected in (("code_datamatrix", PARCEL_DM), ("code_pdf417", TICKET_PDF417)): + f.act() + f.back() + f.expect("list") + f.next() + f.act() + f.open_focused_row() + f.expect("code", QR_TIMEOUT_S) + f.shot(name, expect_code=expected) def run_flow(f: Flow) -> None: |
