From 7250dbd63a951ad15af981bca31da99902c23c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Sun, 4 Oct 2026 21:05:19 +0300 Subject: [PATCH] v3.19.0 (cont.): live fixtures; menu text match is case-insensitive by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No test scripts have been authored yet, so the format is still free to change - the menu-select text match is now case-insensitive by default (menu labels are UI text; case_sensitive: true still forces an exact-case match, and a miss on it names the case-insensitive candidates). Verification against the live card's own bytes (captured 2026-10-04): - the Annex A Variant 2 Cyrillic menu (ids 128..130) resolves by text and the case behaviour above is pinned ('кофе' -> item 130); - the applet's SEND SHORT MESSAGE (alpha 'Отправка...', SMS-SUBMIT to +79332505884) pins the new alpha and sms checks and the run-log line. docs/help/api updated; sw cache simple-v388 (help pages changed). Tests: 819 frontend + 726 Python. --- docs/api.md | 3 +- docs/test-scripts.md | 11 +++-- frontend/help-ru.html | 2 +- frontend/help.html | 2 +- frontend/sw.js | 2 +- pysim_simple_server/server.py | 20 +++++++-- pysim_simple_server/testscript.py | 5 ++- tests/test_testscript.py | 73 ++++++++++++++++++++++++++++++- 8 files changed, 105 insertions(+), 13 deletions(-) diff --git a/docs/api.md b/docs/api.md index 5bdb4a0..78e0d08 100644 --- a/docs/api.md +++ b/docs/api.md @@ -671,7 +671,8 @@ optional `src` - the device-identities source override), `event` (`event` name or hex + `fields`, optional `src` - the semantic event download for 0x03/0x0B/0x12/0x1D), `menu-select` (`item_id` 1-255, or `text` + `mode` `exact`/`contains` with an -optional `case_sensitive` - the text is resolved against the card's cached +optionally `case_sensitive: true` for an exact-case match, case-insensitive by +default - the text is resolved against the card's cached SET UP MENU, which is refreshed whenever the card sends the menu), `file-write` (`path`, `data`, `mode` `auto`/`binary`/`record`, `record`), `file-read` (same, verifies `check.data`), diff --git a/docs/test-scripts.md b/docs/test-scripts.md index 4bd7b6d..b32c3b3 100644 --- a/docs/test-scripts.md +++ b/docs/test-scripts.md @@ -177,7 +177,7 @@ continue correctly. |---|---|---| | `envelope` | `event` 0–255, `data` hex (optional), optional `src` | ENVELOPE(Event Download) with raw data; `src` overrides the device-identities source (`82` terminal / `83` network) | | `event` | `event` (name or hex), `fields` (object), optional `src` | semantic ENVELOPE(Event Download) for 0x03/0x0B/0x12/0x1D (see below) | -| `menu-select` | `item_id` 1–255 **or** `text` + `mode` `exact`/`contains` (+ `case_sensitive`), not both | ENVELOPE(Menu Selection); the text is resolved against the card's cached menu - refreshed whenever the card sends SET UP MENU, so it follows the applet's install parameters | +| `menu-select` | `item_id` 1–255 **or** `text` + `mode` `exact`/`contains` (+ `case_sensitive: true` for an exact-case match — the default is case-insensitive), not both | ENVELOPE(Menu Selection); the text is resolved against the card's cached menu - refreshed whenever the card sends SET UP MENU, so it follows the applet's install parameters | | `file-write` | `path`, `data`, `mode` `auto`/`binary`/`record`, `record` 1–255 | UPDATE BINARY/RECORD | | `file-read` | `path`, `mode`, `record` | READ BINARY/RECORD; verify with `check.data` | | `apdu` | `apdu` hex | raw transport, no auto-handler | @@ -362,8 +362,10 @@ then fetches. ]} ``` -The text is matched against the card's cached menu; the cache is refreshed -whenever the card sends SET UP MENU (e.g. after an install + REFRESH). If the +The text is matched against the card's cached menu, **case-insensitively by +default** (`case_sensitive: true` forces an exact-case match); the cache is +refreshed whenever the card sends SET UP MENU (e.g. after an install + +REFRESH). If the script must wait for the menu, add a `status` action and an `expect SET UP MENU` before the selection. @@ -427,6 +429,9 @@ PoR-in-submit (with the transport asserted by the expectation): has no entry in the preset and the step carries no `spi1`. - `no proactive command pending …` - an expectation ran without a `91XX` from the previous step (add a `status` action when the card delivers on poll). +- `menu-select: no menu item matches …` - the error lists the cached menu; a + miss on an explicit `case_sensitive: true` names the case-insensitive + candidates. - `card verdict: no PoR (the card sent none for SPI2 …)` - an SCP80 operation expected a PoR that never arrived (check SPI2 and the transport). diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 21cd1a3..34aa590 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -563,7 +563,7 @@

8.9 Тест-скрипт

Тест-скрипт — упорядоченный список действий и ожиданий проактивных команд, выполняемый на подключённой карте на стороне сервера. Пока запуск активен, карта принадлежит скрипту: остальные операции с картой отклоняются (HTTP 409), фоновый опрос STATUS приостанавливается; отчёт о запуске хранится в памяти (в том числе после перезагрузки страницы) до нажатия Очистить отчёт. Скрипты хранятся в хранилище на сервере (~/.pysim-simple-server/test_scripts.json, --test-scripts), поэтому все браузеры работают с одним набором; изменения записываются в хранилище по мере правки (кнопки «Сохранить» нет — черновик без валидного шага остаётся локальным); экспорт/импорт JSON остаётся для резервных копий и переноса скриптов между стендами (старый экспорт из localStorage импортируется как есть).