Testing
We have no automated test suite today. All verification is live against
the MELODIESTEST / LMKTEST WMS tenant, with scenarios tracked in
reports/test-cases-verified.md. Live-gateway tests are gated behind
the feature flag so they do not spam production during CI; run them
manually before every release.
Environments
| Tenant | customerCode | warehouseCode | When to use |
|---|---|---|---|
| Dev (shared test) | MELODIESTEST | LMKTEST | Development, inner-loop verification |
| Production | (customer-specific) | (customer-specific) | Only after PR approval + customer sign-off |
Credentials live in appsettings.json — never commit the production
key.
Canonical verified scenarios
Source of truth: reports/test-cases-verified.md in the main repo.
It has one checklist row per scenario; flip [ ] → [x] only after
live verification.
Example modules covered:
- Item Code Sync — auto-sync new, multi-UOM mapping, category fallback to GENERAL, per-UOM barcode propagation, update re-sync.
- Picking — CREATE_ORDER, callback status progression, UOM division on callback, partial shipments, re-sync on modification.
- PO-ASN-GRN — CREATE_ASN, callback triggers GRN, EA/CT round-trip, GRN blocks ASN cancel.
- Cancel — manual, orphan, GRN-guard, Shipped-refuses.
- UI — 5-tab navigation, start/stop toggles, auto-sync-new checkbox, sync log date filter.
Simulating WMS callbacks
tools/send-wms-callback.ps1 reads a real picking note from the DB,
builds a spec-compliant GLINK_UPDATE_ORDER_STATUS payload,
MD5-signs it, and POSTs to /api/wms-callback. Useful for testing
the callback path without bothering the real warehouse.
cd tools
# Single callback
.\send-wms-callback.ps1 -PickingNoteNo PN-26040163 -Status Shipped
# Full lifecycle walk
foreach ($s in 'Released','Picking','Packed','Shipped') {
.\send-wms-callback.ps1 -PickingNoteNo PN-26040163 -Status $s
Start-Sleep 2
}
# Partial shipment (50% of each line)
.\send-wms-callback.ps1 -PickingNoteNo PN-26040163 -Status Packed -ShipRatio 0.5
# Target a local API instance instead of the public URL
.\send-wms-callback.ps1 -PickingNoteNo PN-26040163 -Status Shipped `
-CallbackUrl http://localhost:5006/api/wms-callback
The sibling script tools/send-asn-callback.ps1 does the same for
ASN receipts (GLINK_UPDATE_ASN_STATUS).
Manual smoke flow
Minimum pre-release regression, run end-to-end against dev tenant:
- Item sync: create a new item with 3 UOMs (UN/PACK/CT), auto-sync
picks it up, verify
GLINK_QUERY_ITEM_NOTIFYreturns 3packagingListrows. - Picking push: generate a picking note, watch
PickingNoteWorkerpush, check WMS admin UI for the order. - Callback — Shipped: use
send-wms-callback.ps1 -Status Shipped, verifyZ_PickingNote.DtlStatus = 'AC'andZ_WmsPickingNoteItemStatus.ShippedQtyis in the line's UOM (not raw EA). - Cancel — pre-Shipped: create a second picking note, set it to
DtlStatus='PC'before WMS Shipped, verifyZ_WmsCancelHistory.Success = 1. - Cancel — Shipped refuses: try to cancel the Shipped note,
verify WMS response
INVALID_OPERATIONand local rows left untouched. - PO → ASN: create a PO with
80 CT @ Rate 24, transfer, verify WMS ASN shows 1920 EA. - ASN callback: simulate receive of 1920 EA, verify AutoCount GRN
shows
80 CT.
Fixture gotchas
ItemTypemaster — every ItemType you test must exist on WMS already; otherwise category silently becomesGENERALand you will chase a false positive. See Prerequisites.- Picking list regeneration — known duplicate-push bug. Avoid regenerating the same list twice in tests until the fix lands.
Z_WmsSyncLogandZ_WmsErrorLog— grow fast in tests. Truncate between runs if you want clean evidence.
Caution
:::caution Dev tenant is shared
MELODIESTEST is shared among all developers. If two people test at
the same time, expect noisy Z_WmsSyncLog and unexpected SKUs in
GLINK_QUERY_INVENTORY_NOTIFY. Coordinate before running destructive
scenarios (cancel-all, etc).
:::
:::tip Always record a test run in test-cases-verified.md If you ran a scenario against the real gateway and it passed, flip the checkbox. That file is the closest thing we have to a regression suite. :::