Quality Assurance
WMS Agile — Test Strategy
7 livelli + Stress + SimBot v3 · 200+ check · Bug Detection · Voce formativa · CI Gitea integrata
7+2
Livelli test
41
Test Playwright
51
PHPUnit
8/9
Stress OK
S1–S7
Scenari sim
26
SimBot fasi

Overview & Filosofia

La test infrastructure del WMS Agile è progettata su tre principi fondamentali:

Ogni livello è indipendente ma orchestrato da infrastructure/test-master.sh. La pipeline CI Gitea esegue L1→L3→L4→L5 ad ogni push su main.

Piramide dei Test

 SIMBOT v3 — Browser-Native (200+ entita, 26 fasi, voce + bug detection)
 STRESS — Race Condition & Load (10–50× concurrent)
 L7 — Simulator Data Integrity (15+ check, S2–S7)
~3m
 L6 — Super Coverage (12 sezioni, 42 check)
~4m
 L5 — Playwright UI (41 test, 7 spec, Chrome)
~5m
 L4 — Simulator APIs (30+ endpoint, latency)
~3m
 L2 — E2E Integration (12 step multi-servizio)
~3m
 L3 — PHPUnit Unit (51 test, 137 assert)
~2m
 L1 — Smoke Health (14 check, 7 microservizi)
~30s

 L1 + L3 + L4 + L6 + L7 in parallelo (FASE 1). L2 sequenziale (FASE 2). L5 ultimo (FASE 3). SimBot & Stress indipendenti.

L1 — Smoke Test FASE 1 parallela

Health Check & API Routing
Verifica che tutti i microservizi siano in piedi e rispondano correttamente
test-smoke.sh ~10s parallela con L3, L4

Criterio di successo: tutti i servizi rispondono 2xx — se L1 fallisce, la pipeline si ferma.

L2 — E2E Integration FASE 2 sequenziale

Flussi End-to-End Multi-Microservizio
Verifica la coerenza dei dati attraverso il boundary tra servizi
test-e2e.sh ~30s dopo FASE 1

Criterio di successo: ogni flusso senza errori 5xx, dati coerenti end-to-end tra DB diversi.

L3 — PHPUnit Unit Test FASE 1 parallela

Logica di Business — Service Layer PHP
Unit test dei service layer con mock DB, verifica state machine e race condition
test-phpunit.sh ~20s parallela con L1, L4
FileServizioTestAssert
OutboundServiceTest.phpoutbound-ms1642
StockServiceTest.phpinventory-ms1437
InboundServiceTest.phpinbound-ms2158
Totale51137
docker exec wms-{svc} vendor/bin/phpunit tests/ --testdox --colors

L4 — Simulator APIs FASE 1 parallela

API del Simulatore WMS 4PL
Testa le API specifiche dello scenario 4PL: facility, tenant, carrier, SLA, OEE, billing
test-simulator-apis.sh ~25s parallela con L1, L3

L5 — Playwright UI Test FASE 3

Test UI nel Browser Chrome Reale
41 test Playwright (7 spec) su interfaccia utente — login, navigazione, form, simulatore, billing, AI
test-ui.sh ~3-8 min dopo L1+L2+L3+L4
SpecTestCosa testa
auth.spec.js5Login form, validazione, credenziali errate, redirect post-login
dashboard.spec.js6KPI dashboard, sezioni, JS errors, 401/500 check, logout
navigation.spec.js4Nav link click, topbar persistence, logout flow
forms.spec.js4Modal prodotto/ordine, form validation, required fields
simulator.spec.js8Scenario grid S2-S7, cockpit, speed, API check, no JS errors
billing.spec.js6Dashboard billing, invoice list, FatturaPA, state transitions
ai-chat.spec.js8Chat panel, messaggi, KB search, tools, streaming
Totale41 ✅7 spec file, tutti in produzione

Setup critico

L6 — Super Coverage FASE 1 parallela

Test Avanzati — 12 Sezioni, Tutti i Microservizi
Copertura completa dei servizi enterprise: billing, AI, calendar, WCS, network, labour, yard, slotting
test-super.sh ~3-5 min parallela con L1, L3, L4, L7
§SezioneServizioCheck
0Loginauth-msJWT token
1Billingbilling-ms :3091Fatture, FatturaPA XML, Revolut payment
2AIai-ms :3087Settings, tools, chat, KB stats, sim-datasets
3Calendarcalendar-ms :3088Holidays (16 paesi), settings, tokens
4WCSwcs-ms :3089Status, adapters, robot dispatch
5Networknetwork-ms :3090Partners, PO, confirm, ship, receipt
6Returnswarehouse-msNCR, stock adjustments, rettifiche
7Multi-tenantauth-msSupervisor login, tenant isolation, null check
8Error Casesall400/422 validation, 401 auth, 404, JWT tampering
9Labourwarehouse-msShift reports, KPI operatori
10Yardwarehouse-msStatus, dock slots, trailer management
11Slotting + Auditwarehouse-msProposals, audit trail, notifications

Graceful degradation: test passano anche se un servizio esterno non e' configurato (Revolut, Anthropic). Skip per sezione: WMS_SKIP_BILLING=1, WMS_SKIP_AI=1, ecc.

L7 — Simulator Verification FASE 1 parallela

Integrita Dati Simulatore & Performance
Verifica scenari S2-S7, sim-log, anomalie, file JS, baseline performance
test-simulator.sh ~2-4 min parallela con L1, L3, L4, L6

SimBot v3 — Browser-Native UI Test + Formazione standalone

Robot Browser-Native che Configura, Forma e Testa il WMS
26 fasi · 23 sezioni · voce sincronizzata · bug detection · AI Q&A + microfono · osservazioni utente · dati reali nel DB
simbot/panel.html ~15-25 min (Full) on-demand · Lancia SimBot

Architettura v3 (Browser-Native)

A differenza della v2 (Playwright + Node.js headless), SimBot v3 gira interamente nel browser dell'utente:

Le 26 fasi del percorso

FaseCosa faTipoVerifica DB
00 ResetElimina dati SB- precedenti via APICleanup
01 LoginAccesso admin, verifica #app-screenAuth
02 Dashboard TourKPI, health banner, risorse, alertTour
03 Warehouse5 magazzini via form UICRUDBatch
04 Zone30 zone (6 tipi, 5 ambienti)CRUDBatch
05 Bin27 bin (FEFO, FIFO, dedicated)CRUDBatch
06 Prodotti61 SKU (cold/frozen/ambient)CRUDBatch
07 Packaging GS1Tour EA>CASE>PALLET, EAN/GTINTour
08 Clienti/Forn/Corr15 fornitori, 20 clienti, 4 corrieriCRUD
09 Operatori/Equip8 mezzi (UI) + 6 operatori (API)CRUD+API
10 InventarioLotti + stock (scadenze realistiche)API
11 Inbound3 ordini + receiving QC + putawayAPI+UI
12 Outbound3 ordini + confirm + wave + shipUI+API
13 TMS3 autisti + 1 giro consegnaUI+API
14 Tracking3 colli + scan eventiAPI
15 Missioni5 missioni (pick/put/transfer/count)API
16 Conformita NCR4 NCR (danni, discrepanze, scadenze)API
17 4PL & Billing3 aziende multi-tenantUI+API
18 Yard3 trailer con stati banchinaAPI
19 MappaTour planimetria SVG interattivaTour
20 CalendarioTour disponibilita risorseTour
21 NotificheTest alert SSE real-timeTour
22 AI AssistantClaude + RAG, domanda liveTour+API
23 Operativita5 giorni simulati (ordini/missioni/alert)API
24 Report KPI6 tab report + stock + dashboardTour
25 VerificaConteggi API + navigazione 7 sezioniCheckFull
Totale S2-Full200+ entita26 fasi

Bug Detection integrato

SimBot monitora automaticamente ogni operazione e segnala bug in tempo reale:

A fine sessione il log mostra un Bug Report con fase, tipo di problema e dettaglio tecnico. Il contatore Bug nella barra KPI e' verde (0) o rosso (problemi rilevati).

Presentazione scenario aziendale

All'avvio la voce descrive l'azienda che stiamo simulando. Per lo scenario S2-Full:

Formazione vocale campo-per-campo

La voce spiega il significato di ogni campo al primo inserimento di ogni tipo:

Interazione in pausa — AI Contestuale, Osservazioni e Microfono

Premendo PAUSA il bot si ferma e l'utente puo interagire in due modalita:

A fine sessione: Bug Report + Report Osservazioni nel log.

Protezioni operative

Durata stimata (senza pause)

ScenarioVeloceNormaleLentoDemo
S2 Fast~2 min~4 min~7 min~10 min
S2 Full~8 min~15 min~25 min~35 min

Indicatore ~Xmin sempre visibile nella barra viola, si aggiorna in tempo reale.

Come usarlo

https://app.wms.agile.software/simbot/panel.html    (SimBot)
https://app.wms.agile.software/simbot-guide.html     (Guida utente)
https://app.wms.agile.software/simbot-technical.html  (Specifica tecnica)

Stress Test — Race Condition & Load manuale

Comportamento sotto carico concorrente reale
10–50 worker paralleli, verifica race condition, no crash, no data corruption
test-stress.sh [URL] [CONCURRENCY] ~2-3 min manuale / notturno
#SezioneWorkerVerificaStatus
0Login inizialeSetup token OK
1Concurrent Login10×JWT race condition OK
2Concurrent SKU10×Unique constraint, no 5xx OK
3Concurrent Inbound10×order_number unici OK
4Concurrent Outbound10×order_number unici OK
5Stock Movements10×No stock negativo (GREATEST guard) OK
6API Flood50×No crash, no rate 5xx OK
7Tenant IsolationTenant 99999 non visibile OK
8Qty verificationCampo JSON corretto cosmetic

Fix race condition applicati: MAX()+1+random_int(1,20) + retry 5× con jitter su InboundService e OutboundService.

Il Simulatore come Strumento QA

Il Simulatore WMS non è solo una demo commerciale — è il livello di test più avanzato dell'intera suite. Simula fino a 365 giorni di operatività in pochi minuti, generando migliaia di eventi reali che testano il sistema in condizioni impossibili da riprodurre con test tradizionali.

SimEngine (Web Worker)
Motore asincrono in Web Worker separato. Genera eventi (inbound, outbound, missioni AGV, guasti, flash sale) senza bloccare la UI. Velocità 1×–100×.
SimRecorder (event-driven)
Registra ogni evento engine (non time-based). Un frame per evento con KPI snapshot. Replay slider, sparklines, istogramma frequenza. Max 5.000 frame con thinning automatico.
SimIDB (IndexedDB)
Logger API call via IndexedDB (fuori heap V8 → no OOM). Path normalizzati, latenza per chiamata, top endpoint, conteggio errori. Fino a 5.000 entries FIFO.

7 Scenari Industriali — Copertura Funzionale

ScenarioVerticaleCosa testa in modo unico
S1 Logitech 4PL GroupConsumer Electronics5 facility, 3 tenant 4PL, SLA multi-carrier, billing cycle
S2 +Layer Complexity4PL AvanzatoResi, guasti equipment (OEE), flash sale, stagionalità per SKU
S3 Pharma Cold ChainFarmaceuticoGDP compliance, temperatura 2–8°C, lotti FEFO critici
S4 Automotive JITAutomotiveJust-in-time, kanban, lead time rigido, zero stock tollerato
S5 Retail OmnichannelRetailE-commerce + punto vendita, webhook ordini, wave picking ad alto volume
S6 E-commerce ExpressE-commerceSLA 24h, alto volume, stress picking, cartonization automatica
S7 Food DistributionFood & BeverageFEFO obbligatorio, tracciabilità filiera, allerta scadenze

Wizard → Simulatore → SimRecorder: flusso QA

sim-wizard.html
CSV/JSON custom
Simulatore
SimRecorder REC
Replay + KPI
Snapshot AI Claude

Il Sim Wizard (/sim-wizard.html) guida la configurazione in 7 step (scenario, dati custom CSV/JSON, speed, health check) e lancia automaticamente il simulatore con i parametri scelti. Il SimRecorder cattura ogni evento per la revisione post-simulazione. Lo Snapshot AI invia la timeline a Claude per analisi automatica delle anomalie.

Anti-OOM — Protezione memoria in run lunghi

Orchestrazione & CI/CD

test-master.sh — Esecuzione locale

FASE 1 (parallela — 5 test in background):
  L1 Smoke     ─┐
  L3 PHPUnit   ─┤
  L4 SimAPIs   ─┤ → tutti in background (&) → wait
  L6 Super     ─┤
  L7 Simulator ─┘

FASE 2 (sequenziale):
  L2 E2E Integration (12 step multi-microservizio)

FASE 3 (UI, saltabile con SKIP_L5=1):
  L5 Playwright (41 test, 7 spec, Chrome headless)

Standalone (manuali, non nel master):
  Stress Test      → ./infrastructure/test-stress.sh [URL] [CONCURRENCY]
  SimBot S2-Fast   → node simbot/simbot-runner.js --headless --scenario=s2
  SimBot S2-Full   → node simbot/simbot-runner.js --headless --scenario=s2-full

Output: /tmp/wms-test-report-YYYYMMDD.html (master)
        simbot/report/index.html (SimBot)

CI Pipeline — .gitea/workflows/wms-tests.yml

smoke
phpunit
needs: smoke
+
simulator-apis
needs: smoke
playwright-ui
needs: smoke + Node 20
summary
needs: all

Variabili d'ambiente

WMS_BASE_URLhttps://wms.agile.softwareURL base per i test WMS_EMAILadmin@logitech-wh.itCredenziale admin test WMS_PASSAdmin2026!Password — in SSH url-encode il ! → %21 WMS_SKIP_L[1-7]Salta livello specifico (es. WMS_SKIP_L5=1) WMS_SKIP_BILLINGSkip sezione billing in L6 WMS_SKIP_AISkip sezione AI in L6 WMS_VERBOSEOutput dettagliato in test-master CONCURRENCY10Worker paralleli in test-stress.sh CHROME_PATH/usr/bin/google-chromePath Chrome per SimBot/Playwright

Bug Critici Trovati dai Test

DataLivelloBugSeveritàFix applicato
2026-02-26Stress InboundService: COUNT()+1 duplica order_number sotto carico Critical MAX()+1+random_int(1,20) + retry 5× jitter
2026-02-26Stress OutboundService: stesso problema (+$attempt insufficiente) Critical Jitter casuale su retry — rompe simmetria temporale
2026-02-26Stress ProductService TOCTOU: SELECT check + INSERT separati → 5xx su duplicate SKU High catch PDOException 23000 → return 400
2026-02-26L1 Smoke AuditLogger non nell'autoload inbound-ms → 500 su create order High Aggiunto wms/audit-lib a composer.json + rebuild
2026-02-26L5 Playwright Onboarding overlay blocca tutti i click post-login Medium Dismiss via page.evaluate() in ogni spec
2026-02-26L5 Playwright text=credenziali invalido come CSS selector Medium .or(page.getByText(/regex/i))
2026-03-02L4 Simulator POST /api/ai/knowledge/search restituiva 405 (route mancante) High Aggiunta route in ai-ms/public/index.php + docker cp

Roadmap QA