Doctor App - Add Patient & Appointment Booking Test Plan
Document Version: 1.0 Test Date: 2026-06-11 Focus Areas: Add Patient Flow + Appointment Booking Flow Environment: Staging
1. TEST FLOW OVERVIEW
Flow 1: Add Patient (Standalone)
Patients Page (/cms/patients)
↓
Add Patient Modal
↓
┌──────────────────────────────────────┐
│ FederatedPatientPicker │
│ ┌────────────┐ ┌────────────┐ │
│ │ In Clinic │ │In Kulcare │ │
│ │ (existing) │ │(network) │ │
│ └────────────┘ └────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ + Add a new patient (CTA) │ │
│ └────────────────────────────────┘ │
└──────────────────────────────────────┘
↓
┌──────────────────────────────────────┐
│ Patient Form │
│ - First Name (required) │
│ - Last Name (required) │
│ - Country Code + Phone (required) │
│ - Email (optional) │
│ - Gender (required) │
│ - Date of Birth (required) │
└──────────────────────────────────────┘
↓
POST /clinical/patients
↓
Patient CreatedFlow 2: Appointment Booking (2-Step Modal)
Queue Page (/cms/queue) → Add Appointment Modal
↓
┌──────────────────────────────────────┐
│ STEP 1: Doctor & Time │
│ ┌────────────────────────────────┐ │
│ │ Select Doctor (required) │ │
│ │ Appointment Type: │ │
│ │ ○ WALKIN (queue) │ │
│ │ ○ ONCALL (scheduled) │ │
│ │ ○ TELEMEDICINE │ │
│ │ Select Date (required) │ │
│ │ Select Time Slot (if ONCALL) │ │
│ └────────────────────────────────┘ │
│ [Continue →] │
└──────────────────────────────────────┘
↓
┌──────────────────────────────────────┐
│ STEP 2: Patient Information │
│ ┌────────────────────────────────┐ │
│ │ FederatedPatientPicker │ │
│ │ (same as Add Patient flow) │ │
│ └────────────────────────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ Patient Form Fields │ │
│ │ (auto-filled from picker) │ │
│ └────────────────────────────────┘ │
│ [Add Appointment] │
└──────────────────────────────────────┘
↓
POST /clinical/appointments
↓
Appointment Created → Appears in Queue2. TEST DATA REQUIREMENTS
Pre-Test Setup
| Type | Data | Purpose |
|---|---|---|
| Patient A | Existing clinic patient (in_clinic) | Test "In this clinic" bucket |
| Patient B | Kulcare network patient (in_kulcare) | Test "Elsewhere on Kulcare" bucket |
| Patient C | New patient (not in system) | Test "Add new patient" flow |
| Doctor 1 | Active doctor with availability | Test appointment booking |
| Doctor 2 | Active doctor | Test doctor selection |
| Doctor 3 | Doctor with no availability | Test "No slots" scenario |
Test Phones (Use distinct numbers)
- Patient A:
9999999001(existing in clinic) - Patient B:
9999999002(in Kulcare network) - Patient C:
9999999003(new patient)
3. PHASE 1: ADD PATIENT FLOW
URL
https://practice-stg-new.kulcare.com/cms/patients
3.1 Federated Patient Search
Component: FederatedPatientPicker.tsx
API: GET /clinical/patients/federated_search
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AP-01 | Search by phone (in clinic) | Enter existing patient phone → Wait 400ms | Shows "In this clinic" bucket with patient | P0 |
| AP-02 | Search by phone (in Kulcare) | Enter network patient phone → Wait 400ms | Shows "Elsewhere on Kulcare" bucket | P0 |
| AP-03 | Search by phone (no match) | Enter unknown phone → Wait 400ms | Both buckets empty, "Add new patient" shown | P1 |
| AP-04 | Search by name (2+ chars) | Enter patient name → Wait 400ms | Shows matching patients | P1 |
| AP-05 | Search by name (3+ chars for API) | Enter 2 chars → No search | Input threshold check | P2 |
| AP-06 | Auto-detect phone vs name | Enter digits → Search by phone | Auto-mode detection works | P2 |
| AP-07 | Auto-detect name vs phone | Enter letters → Search by name | Auto-mode detection works | P2 |
Selection Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AP-08 | Select in-clinic patient | Click patient in "In this clinic" | Toast: "already exists", modal closes | P0 |
| AP-09 | Select in-Kulcare patient | Click patient in "Elsewhere on Kulcare" | Form auto-fills with patient data | P0 |
| AP-10 | Import patient edits form | Import Kulcare patient → Edit name | Edited name used in submission | P1 |
| AP-11 | Create new after no match | Click "+ Add a new patient" | Form clears, ready for new entry | P1 |
| AP-12 | Create new with partial match | Has matches → Click "+ Add a new patient" | Form clears anyway | P2 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AP-13 | Phone < 4 digits | Enter 3 digits → Wait | No search triggered | P2 |
| AP-14 | Phone without country code | No countryCode prop passed | Warning: "Pass countryCode prop" | P2 |
| AP-15 | Search loading state | Enter valid phone → Show loading | "Searching Kulcare network…" spinner | P1 |
| AP-16 | Search error state | Force API error | Error message with retry hint | P1 |
| AP-17 | Empty search input | Clear search field | No buckets shown | P2 |
3.2 Create New Patient Form
Component: AddPatientModal.tsx
API: POST /clinical/patients
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| CP-01 | Create with all fields | Fill all fields → Submit | Patient created, modal closes | P0 |
| CP-02 | Create with required only | Fill required fields → Submit | Patient created | P0 |
| CP-03 | Create from Kulcare import | Import from Kulcare → Adjust → Submit | Patient created with identity link | P1 |
| CP-04 | View in patient list | Create → Go to list | New patient appears | P0 |
Validation Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| CP-05 | Empty first name | Leave first name blank → Submit | Error: "First name is required" | P0 |
| CP-06 | First name < 2 chars | Enter "A" → Submit | Error: "First name must be at least 2 characters" | P0 |
| CP-07 | Empty last name | Leave last name blank → Submit | Error: "Last name is required" | P0 |
| CP-08 | Empty phone number | Leave phone blank → Submit | Error: "Phone number is required" | P0 |
| CP-09 | Phone < 10 digits | Enter 9 digits → Submit | Error: "Phone number must be at least 10 digits" | P0 |
| CP-10 | Invalid phone (letters) | Enter letters in phone → Submit | Error: "Phone number must be at least 10 digits" | P0 |
| CP-11 | Empty gender | Leave gender blank → Submit | Error: "Gender is required" | P0 |
| CP-12 | Empty DOB | Leave DOB blank → Submit | Error: "Date of birth is required" | P0 |
| CP-13 | Future DOB | Select future date → Submit | Error: "Date of birth cannot be in the future" | P0 |
| CP-14 | Invalid email format | Enter "test@invalid" → Submit | Error: "Invalid email address" | P1 |
| CP-15 | Empty country code | Clear country code → Submit | Error: "Country code is required" | P1 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| CP-16 | Whitespace-only first name | Enter " " → Submit | Error: "First name is required" (trim validation) | P1 |
| CP-17 | Duplicate phone | Create with existing phone | Should allow (same person) or warn | P1 |
| CP-18 | Form reset on close | Fill form → Close modal → Reopen | Form empty | P1 |
| CP-19 | Form reset on success | Fill form → Submit → Reopen | Form empty | P1 |
| CP-20 | Submit while loading | Click Submit twice quickly | Only one patient created | P2 |
| CP-21 | Network error on submit | Submit with no network | Error toast, form preserved | P1 |
3.3 Patient List & Management
URL: https://practice-stg-new.kulcare.com/cms/patients
API: GET /clinical/patients
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| PL-01 | View patient list | Go to patients page | Shows all clinic patients | P0 |
| PL-02 | Search patients | Enter name/phone → Search | Shows matching patients | P1 |
| PL-03 | View patient details | Click on patient | Shows patient profile | P0 |
| PL-04 | Edit patient | Edit details → Save | Changes saved | P1 |
| PL-05 | Delete patient | Delete → Confirm | Patient removed | P1 |
| PL-06 | Pagination | Navigate pages | Shows correct patients | P2 |
4. PHASE 2: APPOINTMENT BOOKING FLOW
URL
https://practice-stg-new.kulcare.com/cms/queue
4.1 Step 1: Doctor & Time Selection
Component: AppointmentSetup.tsx
API: GET /clinical/facilities/{id}/practitioners/{id}/slots
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AB-01 | Select doctor | Choose from dropdown | Doctor selected | P0 |
| AB-02 | Select WALKIN type | Select WALKIN radio | Time slot NOT required | P0 |
| AB-03 | Select ONCALL type | Select ONCALL radio | Time slot required | P0 |
| AB-04 | Select TELEMEDICINE type | Select TELEMEDICINE radio | Time slot required | P1 |
| AB-05 | Select date | Pick date from calendar | Date selected, slots load | P0 |
| AB-06 | View available slots | Select doctor + date | Shows available time slots | P0 |
| AB-07 | Select time slot | Click on available slot | Slot selected | P0 |
| AB-08 | Continue to step 2 | Select doctor + (slot if ONCALL) → Continue | Advances to step 2 | P0 |
Validation Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AB-09 | Continue without doctor | Click Continue without doctor | Error: "Doctor selection is required" | P0 |
| AB-10 | Continue without slot (ONCALL) | ONCALL selected, no slot → Continue | Error: "Time slot is required" | P0 |
| AB-11 | Continue without slot (WALKIN) | WALKIN selected, no slot → Continue | Proceeds to step 2 | P0 |
| AB-12 | Continue without slot (TELEMEDICINE) | TELEMEDICINE selected, no slot → Continue | Error: "Time slot is required" | P1 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AB-13 | No slots available | Select date with no availability | "No slots available" message | P1 |
| AB-14 | Select past date | Try to select past date | Past dates disabled in calendar | P1 |
| AB-15 | Change doctor clears slot | Select slot → Change doctor | Slot cleared | P1 |
| AB-16 | Change date clears slot | Select slot → Change date | Slot cleared | P1 |
| AB-17 | Booked slot shown | Select booked slot | Slot should show as unavailable | P1 |
| AB-18 | Loading slots | Select doctor + date | Loading spinner | P1 |
| AB-19 | Slot time in correct timezone | Select slot | Time shown in clinic timezone | P1 |
| AB-20 | Doctors list loading | Page load | Loading spinner in dropdown | P2 |
4.2 Step 2: Patient Information
Component: PatientInformation.tsx
Flow: Same as Add Patient Flow (Federated Search + Form)
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| PS-01 | Search existing patient | Enter phone → Select from in_clinic | Form auto-fills | P0 |
| PS-02 | Import Kulcare patient | Enter phone → Select from in_kulcare | Form auto-fills | P0 |
| PS-03 | Create new patient | Fill form → Submit | New patient + appointment created | P0 |
| PS-04 | Edit auto-filled patient | Auto-fill → Edit name → Submit | Updated name used | P1 |
Validation Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| PS-05 | Submit without patient | Click Submit without patient | Error: "First name is required" | P0 |
| PS-06 | Submit with incomplete patient | Leave phone blank → Submit | Error: "Phone number is required" | P0 |
| PS-07 | Submit with invalid phone | Enter 9 digits → Submit | Error: "Phone number must be 10 digits" | P0 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| PS-08 | Go back to step 1 | Click Back | Returns to step 1, data preserved | P2 |
| PS-09 | Form reset on close | Fill form → Close → Reopen | Form resets | P1 |
| PS-10 | Couple session toggle | Enable couple session | Spouse details form appears | P2 |
4.3 Appointment Submission
API: POST /clinical/appointments
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AS-01 | Book WALKIN appointment | WALKIN + patient → Submit | Appointment created in queue | P0 |
| AS-02 | Book ONCALL appointment | ONCALL + slot + patient → Submit | Appointment created | P0 |
| AS-03 | Book TELEMEDICINE appointment | TELEMEDICINE + slot + patient → Submit | Appointment created | P1 |
| AS-04 | View in queue | After booking | Patient appears in queue | P0 |
| AS-05 | View appointment details | Click on appointment | Shows full details | P0 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| AS-06 | Double-click prevention | Double-click Submit | Only one appointment created | P1 |
| AS-07 | Network error on submit | Submit with no network | Error toast, form preserved | P1 |
| AS-08 | Slot no longer available | Select slot → Wait long → Submit | Error: "Slot no longer available" | P1 |
| AS-09 | Booking for different doctor | Select Doctor B → Book | Appointment for Doctor B | P1 |
| AS-10 | Submit with couple session | Enable couple + fill spouse → Submit | Both appointments created | P2 |
4.4 Queue Management
URL: https://practice-stg-new.kulcare.com/cms/queue
API: GET /clinical/facilities/{id}/queue
Happy Path Tests
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| QM-01 | View today's queue | Go to queue page | Shows today's appointments | P0 |
| QM-02 | Filter by status (Waiting) | Filter: Waiting | Shows waiting only | P1 |
| QM-03 | Filter by status (In Progress) | Filter: In Progress | Shows in-progress only | P1 |
| QM-04 | Filter by status (Completed) | Filter: Completed | Shows completed only | P1 |
| QM-05 | Filter by doctor | Select doctor filter | Shows that doctor's patients | P1 |
| QM-06 | Search in queue | Enter patient name | Shows matching | P1 |
| QM-07 | Navigate date (prev) | Click previous day | Shows that day's queue | P1 |
| QM-08 | Navigate date (next) | Click next day | Shows that day's queue | P1 |
| QM-09 | Navigate date (today) | Click Today | Shows today's queue | P1 |
| QM-10 | Queue statistics | View queue header | Shows total, waiting, in-progress counts | P1 |
Appointment Actions
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| QM-11 | Start encounter | Click "Start" on appointment | Encounter started | P0 |
| QM-12 | Complete appointment | Mark as completed | Status updated | P0 |
| QM-13 | Mark as no-show | Mark as no-show | Status updated | P1 |
| QM-14 | Cancel appointment | Cancel → Confirm | Appointment cancelled | P0 |
| QM-15 | View appointment details | Click on appointment | Shows full details | P0 |
Edge Cases
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| QM-16 | Empty queue | No appointments today | Empty state message | P2 |
| QM-17 | Refresh queue | Click refresh | Queue updated | P2 |
| QM-18 | Cancel past appointment | Try to cancel past | Error or warning | P2 |
5. INTEGRATION TEST CASES
Cross-Flow Integration
| # | Test Case | Steps | Expected | Priority |
|---|---|---|---|---|
| INT-01 | Add Patient → Book Appointment | Add patient → Book appointment | Patient exists, booking succeeds | P0 |
| INT-02 | Search → Import → Book | Search Kulcare → Import → Book | Patient imported, booking succeeds | P0 |
| INT-03 | Patient created → Appears in search | Create patient → Search | Patient found in in_clinic | P0 |
| INT-04 | Booking updates queue | Book appointment | Queue updates in real-time | P1 |
| INT-05 | Status change reflects in list | Complete appointment | Status updated in list | P0 |
6. TEST EXECUTION CHECKLIST
Pre-Flight Checklist
- Test accounts: 2 doctors, 2 staff
- Test data: Patient A (in clinic), Patient B (in Kulcare), Patient C (new)
- Test data: Doctor 1 (with availability), Doctor 2, Doctor 3 (no availability)
- Staging environment accessible
- API tools ready (Postman/curl)
Phase 1: Add Patient Flow
- AP-01 to AP-07: Federated Search (Happy Path)
- AP-08 to AP-12: Selection Tests
- AP-13 to AP-17: Edge Cases
- CP-01 to CP-04: Create Patient (Happy Path)
- CP-05 to CP-15: Validation Tests
- CP-16 to CP-21: Edge Cases
- PL-01 to PL-06: Patient List
Phase 2: Appointment Booking Flow
- AB-01 to AB-08: Step 1 (Happy Path)
- AB-09 to AB-12: Step 1 (Validation)
- AB-13 to AB-20: Step 1 (Edge Cases)
- PS-01 to PS-04: Step 2 (Happy Path)
- PS-05 to PS-07: Step 2 (Validation)
- PS-08 to PS-10: Step 2 (Edge Cases)
- AS-01 to AS-05: Submission (Happy Path)
- AS-06 to AS-10: Submission (Edge Cases)
- QM-01 to QM-10: Queue Management
- QM-11 to QM-15: Appointment Actions
- QM-16 to QM-18: Queue Edge Cases
Integration Tests
- INT-01 to INT-05: Cross-Flow Integration
7. API REFERENCE
Federated Patient Search
GET /clinical/patients/federated_search
Params:
- phone: string (min 4 digits)
- country_code: string (required with phone)
- name: string (min 3 chars)
Response:
{
in_clinic: PatientApi[],
in_kulcare: InKulcareIdentityPatient[],
no_match: []
}Create Patient
POST /clinical/patients
Body:
{
first_name: string,
last_name: string,
phone_number: string,
phone_country_code: string,
email?: string,
gender: "male" | "female" | "other" | "unknown",
birth_date: string (YYYY-MM-DD)
}Create Appointment
POST /clinical/appointments
Body (existing patient):
{
patient_id: string,
facility_id: string,
practitioner_id?: string,
start_time: ISO8601,
end_time?: ISO8601,
appointment_type: "walk_in" | "fixed" | "telemedicine",
note?: string,
payment_option?: "BEFORE" | "AFTER" | "NO"
}
Body (new patient):
{
facility_id: string,
patient_params: {
first_name: string,
last_name: string,
phone_number: string,
country_code: string,
email?: string,
gender: string,
dob?: string
},
practitioner_id?: string,
start_time: ISO8601,
end_time?: ISO8601,
appointment_type: "walk_in" | "fixed" | "telemedicine",
note?: string,
payment_option?: "BEFORE" | "AFTER" | "NO"
}Get Time Slots
GET /clinical/facilities/{facility_id}/practitioners/{practitioner_id}/slots
Params:
- date: YYYY-MM-DD
- appointment_type: "fixed" | "telemedicine"
Response:
{
slots: [{ start_at: ISO8601, end_at: ISO8601, status: "available" | "booked" }],
timezone: "Asia/Kolkata"
}8. BUG REPORTING TEMPLATE
### Bug #[N]: [Short Description]
| Field | Value |
|-------|-------|
| **Severity** | 🟡 High / 🟠 Medium / 🟢 Low |
| **Test Case** | [TC-ID] |
| **Area** | Add Patient / Appointment Booking |
| **Component** | [Component name] |
| **API** | [API endpoint] |
| **Status** | Open |
**Description**:
[Detailed description of the bug]
**Steps to Reproduce**:
1. [Step 1]
2. [Step 2]
3. [Step 3]
**Expected Behavior**:
[What should happen]
**Actual Behavior**:
[What actually happens]
**Evidence**:
[Screenshots / API responses / Console logs]Document Status: Ready for Testing Total Test Cases: 100+ Estimated Time: 3-4 hours