# WhatsApp Node — test checklist

Run after `node app.js` on port **3000** and Laravel `node_base_url` = `http://127.0.0.1:3000`.

## Setup

- [ ] Health OK: `GET http://127.0.0.1:3000/health` → `engine: whatsapp-web-js`
- [ ] New CPS device created (fresh `wa_...` api_key)

## Test 1 — Personal sender

Phone: normal WhatsApp (not Business app).

- [ ] QR scan → status **connected**
- [ ] Send to receiver A (new number) → text visible, **not Waiting**
- [ ] Send to receiver B (different number) → text visible, **not Waiting**

## Test 2 — Business sender

Phone: WhatsApp Business app.

- [ ] QR scan → status **connected**
- [ ] Send to receiver A → text visible (first cold message may briefly show Waiting)
- [ ] Send to receiver B (never used before) → text visible

> Business first message to a **brand-new receiver** may briefly show "Waiting" until WhatsApp Web finishes sync. If it persists more than 1–2 minutes, receiver can open the chat once or sender can retry. Saving contact is **not** required for ongoing delivery.

## Test 3 — Session persistence

- [ ] Stop Node (Ctrl+C)
- [ ] Start Node again
- [ ] **No new QR** required
- [ ] Send message → still delivers

## Test 4 — Device delete destroys session

- [ ] Delete device in Laravel dashboard
- [ ] Confirm `GET /logout/{sessionId}` ran (or check Node logs: "Session destroyed")
- [ ] Folder `.wwebjs_auth/session-{api_key}/` is **gone**
- [ ] Chromium process for that session is **not** running

## Test 5 — RAM (Task Manager)

| Active sessions | RAM used (approx) |
|-----------------|-------------------|
| 1 | ~150–300 MB |
| 2 | ~300–600 MB |

## Test 6 — Paytm bridge (if used)

- [ ] `GET /paytm/health` → `ok: true`

## Quick curl send

```powershell
$sid = "wa_YOUR_DEVICE_API_KEY"
$to = "919876543210"
$msg = [uri]::EscapeDataString("test")
Invoke-RestMethod "http://127.0.0.1:3000/send-message?sessionId=$sid&to=$to&message=$msg"
```
