From 722e237ea4b87a1adaa8fdb2704616f546ee1676 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, 27 Sep 2026 01:19:32 +0300 Subject: [PATCH] feat: Test script pill in the Phone simulator (v3.5.11) - Phone simulator tab: a fourth pill **Test script** - script list (localStorage `simple_tests`) with New/Clone/Delete/Export/Import, a form-based step editor (modal) and a run panel. - Actions: ENVELOPE (Event Download), Menu Selection, UPDATE/READ file by path, raw APDU, SCP80 (C-APDU or a pre-built packet, per-step TAR/SPI1/ SPI2 overrides; the preset is matched by the equipped card's ICCID and the final counter is written back) and STATUS with an optional poll. Every action has SW/data checks (exact or ?-mask) and a PoR check for SCP80, with an error (stops) / warning (continues) fail level. - Expectations: FETCH the command announced by the previous step, verify type/qualifier/text/item/raw and answer with the scripted TERMINAL RESPONSE (result, item id, text, extra TLVs); templates for STK menu browsing and an applet via SCP80. - Run panel: progress banner (plus a marker on the pill), per-step OK/Warning/Error badges with expected vs actual values, sent/received hex, decoded commands and the SCP80 counter; 500 ms polling while a run is active, and a running script disables other card controls (data-needs gate; the server answers 409 to other card endpoints). - Help EN/RU (8.9 Test script), AGENTS; version 3.5.11; sw simple-v264. 579 frontend / 467 Python green. --- frontend/help-ru.html | 9 + frontend/help.html | 9 + frontend/index.html | 937 ++++++++++++++++++++++++++++- frontend/sw.js | 2 +- frontend/tests/indicator.test.js | 1 + frontend/tests/phone_tabs.test.js | 4 + frontend/tests/testscripts.test.js | 130 ++++ pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 9 files changed, 1089 insertions(+), 7 deletions(-) create mode 100644 frontend/tests/testscripts.test.js diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 891be84..e0e77a2 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -544,6 +544,15 @@
+

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

+

Тест-скрипт — упорядоченный список действий и ожиданий проактивных команд, выполняемый на подключённой карте на стороне сервера. Пока запуск активен, карта принадлежит скрипту: остальные операции с картой отклоняются (HTTP 409), фоновый опрос STATUS приостанавливается; отчёт о запуске хранится в памяти (в том числе после перезагрузки страницы) до нажатия Очистить отчёт. Скрипты хранятся в localStorage (simple_tests) и экспортируются/импортируются как JSON.

+ +

9. Установка сервера

Для работы с картой (вкладка «Картридер», «Симулятор телефона», доставка OTA) нужен локальный pysim-simple-server — встроенный в SIMple HTTP-сервер, оборачивающий pySim, работающий с ридером через PC/SC или serial и раздающий сам PWA (откройте http://127.0.0.1:8080).

diff --git a/frontend/help.html b/frontend/help.html index 6cf999b..540475d 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -543,6 +543,15 @@
+

8.9 Test script

+

A test script is an ordered list of actions and proactive-command expectations executed server-side on the equipped card. While a run is active the card belongs to the script: other card actions are refused (HTTP 409) and background STATUS polling is paused; the run report is kept in memory (also after reloading the page) until Clear report. Scripts live in localStorage (simple_tests) and export/import as JSON.

+ +

9. Server installation

Live card operations (Card reader tab, Phone simulator, OTA delivery) require the local pysim-simple-server — a small HTTP server bundled with SIMple that wraps pySim, talks to the reader over PC/SC or serial, and also serves the PWA itself (open http://127.0.0.1:8080).

diff --git a/frontend/index.html b/frontend/index.html index 104238f..6418d24 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1030,6 +1030,7 @@ +
@@ -1199,6 +1200,49 @@
+
@@ -1460,6 +1504,18 @@ + +