跳到主要内容

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

TenantcustomerCodewarehouseCodeWhen to use
Dev (shared test)MELODIESTESTLMKTESTDevelopment, 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:

  1. Item sync: create a new item with 3 UOMs (UN/PACK/CT), auto-sync picks it up, verify GLINK_QUERY_ITEM_NOTIFY returns 3 packagingList rows.
  2. Picking push: generate a picking note, watch PickingNoteWorker push, check WMS admin UI for the order.
  3. Callback — Shipped: use send-wms-callback.ps1 -Status Shipped, verify Z_PickingNote.DtlStatus = 'AC' and Z_WmsPickingNoteItemStatus.ShippedQty is in the line's UOM (not raw EA).
  4. Cancel — pre-Shipped: create a second picking note, set it to DtlStatus='PC' before WMS Shipped, verify Z_WmsCancelHistory.Success = 1.
  5. Cancel — Shipped refuses: try to cancel the Shipped note, verify WMS response INVALID_OPERATION and local rows left untouched.
  6. PO → ASN: create a PO with 80 CT @ Rate 24, transfer, verify WMS ASN shows 1920 EA.
  7. ASN callback: simulate receive of 1920 EA, verify AutoCount GRN shows 80 CT.

Fixture gotchas

  • ItemType master — every ItemType you test must exist on WMS already; otherwise category silently becomes GENERAL and 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_WmsSyncLog and Z_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. :::