| name | abdm-testing |
| description | Test ABDM Connect integrations end-to-end - sandbox setup, per-milestone test suites, webhook testing with tunnels, FHIR validation, and go-live checklists. Use when the user says "test the integration", "run sandbox tests", "verify M1/M2/M3/M4", "is this ready for production", or after any integration work completes. |
Testing ABDM Connect Integrations
Principle: sandbox-first, automated, evidence-producing. Every integrate-* command ends by running the relevant suite here and showing the user a pass/fail report.
Sandbox setup
- Base URL
https://api.dev.eka.care with sandbox credentials (do not mix env/creds).
- Webhooks: expose the local server via a tunnel (
ngrok http <port> or cloudflared tunnel), register the URL with Eka, and log every inbound event during tests.
- Test identities: use Eka sandbox test Aadhaar/mobile numbers if provided by the Eka team; NEVER use real Aadhaar numbers in sandbox tests. Ask the user for their assigned test data.
Suite structure (generate in client repo under tests/abdm/)
- Auth: login returns tokens; expired-token → refresh → retry; wrong secret → clean 401 surface.
- M1: each enabled create/login method happy path; wrong OTP (expect MIS-1013); resend; rate-limit lockout messaging (ABDM-1100); duplicate → auto-login path;
abha_created webhook received and patient upserted.
- M2: link with data → webhook LINKED; link bad payload → ERRORED handled; providers+records listing; discovery round-trip; (self-custody) simulated
hip_data_fetch → encrypted push accepted; idempotency: same webhook delivered twice → one side effect.
- M3: create consent → approve (sandbox PHR) → data delivered via webhook or retrieve API; deny; revoke; expired artefact rejected; multi-part data push assembled correctly.
- M4: HPR exists/create paths; HFR search hit/miss; onboard; then one M2 link from that facility.
- FHIR: one bundle per enabled hi_type passes the FHIR R4 validator (NRCES IG if java available, else library-level schema validation).
Mechanics
- Write tests in the client's existing test framework (pytest/jest/go test/junit — detect from repo).
- Async webhook assertions: poll a local capture store (table or in-memory) with timeout ≥ 60s; ABDM flows can be slow.
- Mark tests requiring human OTP entry as interactive; group them and prompt the user once, capturing OTPs via stdin — everything else runs unattended.
- Produce a markdown report: suite, case, status, request-id/txn-id for every failure (feeds the abdm-debugging skill).
Go-live checklist