TC-AUTH-001Authentication, User Switcher & Password Security
👤 Tested With User: Yes (Staff: Admin)
● PASS - VERIFIED (100%)
Staff User Authentication (Free-Text Login)
🎯 Business Objective: Verify that clinic staff/admin can log in using free-text credentials without selecting from a pre-populated list.
⚙️ Preconditions
Application is running; user is on the login screen or clicks `#login-btn`.
📋 Step-by-Step Actions
1. Open the application URL or click `#login-btn` in the header. 2. In the `#app-login-username` field, type `Admin`. 3. In the `#app-login-password` field, type `password`. 4. Click `#btn-modal-login-submit` ("Sign In").
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - HTTP `200 OK` from `POST /api/login`.
- User is authenticated with role `Admin` or `Staff`.
- Header displays active user badge and full staff navigation tabs (including `#tab-setup`). Pass/Fail: Login succeeds; user is granted staff privileges.
---
📸 Visual UI Snapshot / Live ProofLogin Modal with Free-Text Username/Password fields
TC-AUTH-002Authentication, User Switcher & Password Security
👤 Tested With User: Yes (Patient: Portal User)
● PASS - VERIFIED (100%)
Patient Portal Authentication (Free-Text Email)
🎯 Business Objective: Verify that a registered patient can log in using their email address and portal password.
⚙️ Preconditions
Patient exists in database (e.g. `john.smith@example.com` or `akshi.mishra.bui@gmail.com`).
📋 Step-by-Step Actions
1. Click `#login-btn` to open the authentication modal. 2. In `#app-login-username`, type the patient's registered email (e.g. `akshi.mishra.bui@gmail.com`). 3. In `#app-login-password`, type the patient's portal password. 4. Click `#btn-modal-login-submit`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - HTTP `200 OK` from `POST /api/login` with `role: "Patient"`.
- UI automatically displays `#patient-portal-hub-section` ("Welcome to Your Patient Portal").
- Setup tab (`#tab-setup`) and practice configuration are strictly hidden. Pass/Fail: Patient authenticates successfully and enters restricted patient view.
---
📸 Visual UI Snapshot / Live ProofPatient Portal Hub isolated from clinic administrative controls
TC-AUTH-003Authentication, User Switcher & Password Security
👤 Tested With User: No (System Audit)
● PASS - VERIFIED (100%)
Privacy & RBAC Protection on User Endpoints
🎯 Business Objective: Ensure confidential patient names and emails are never exposed in staff user listings.
⚙️ Preconditions
MariaDB and mock stores contain both staff users and registered patients.
📋 Step-by-Step Actions
1. Dispatch `GET /api/users`. 2. Inspect the returned JSON array of users.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Response contains only practice personnel (Admin, Doctor, Staff).
- No patient names, patient IDs, or patient email addresses appear in the response. Pass/Fail: Zero patient records leaked via `/api/users`.
---
📸 Visual UI Snapshot / Live ProofUser Dropdown audited - zero confidential patient accounts leaked
TC-AUTH-004Authentication, User Switcher & Password Security
👤 Tested With User: Yes (Registered User: OTP Request)
● PASS - VERIFIED (100%)
Password Reset - 6-Digit Email OTP Dispatch
🎯 Business Objective: Verify that requesting a password reset generates a 6-digit OTP and delivers it via Brevo HTTPS email.
⚙️ Preconditions
Patient or staff email exists in system.
📋 Step-by-Step Actions
1. Open `#change-password-modal` via `#link-forgot-password` or User menu. 2. Enter registered email address in `#change-pwd-user-input`. 3. Click `#btn-request-otp` ("📧 Send OTP").
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Endpoint `POST /api/auth/request-otp` returns `{"status": "success", "message": "Verification code sent to ..."}`.
- Brevo HTTPS API dispatches the email to the recipient with a 6-digit numeric code.
- UI button transitions to disabled countdown state; confirmation badge displays masked recipient email. Pass/Fail: 6-digit OTP generated in memory/database with a 10-minute expiry; email delivered.
---
📸 Visual UI Snapshot / Live ProofFormatted credentials email with Brevo HTTPS 6-digit verification code
TC-AUTH-005Authentication, User Switcher & Password Security
👤 Tested With User: No (Intruder / Invalid Entry)
● PASS - VERIFIED (100%)
Password Reset - Invalid / Expired OTP Rejection
🎯 Business Objective: Verify that incorrect or expired verification codes are rejected.
⚙️ Preconditions
An active OTP has been requested for an account.
📋 Step-by-Step Actions
1. Enter `000000` or an incorrect code in `#change-pwd-otp`. 2. Enter a new password in `#change-pwd-new` and confirm it in `#change-pwd-confirm`. 3. Click `#btn-submit-change-password`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Backend returns HTTP `400 Bad Request` with message "Invalid verification code".
- Attempt counter increments; password remains unchanged. Pass/Fail: Password update is blocked; user receives clear error toast.
---
📸 Visual UI Snapshot / Live ProofSystem blocks incorrect OTP with 400 Bad Request
TC-AUTH-006Authentication, User Switcher & Password Security
👤 Tested With User: Yes (Registered User: Password Update)
🎯 Business Objective: Verify that submitting the correct OTP updates the password across memory, MariaDB, and persistent storage.
⚙️ Preconditions
Valid 6-digit code received via email.
📋 Step-by-Step Actions
1. Enter the valid 6-digit OTP in `#change-pwd-otp`. 2. Enter new password `NewSecurePass@2026` in `#change-pwd-new` and `#change-pwd-confirm`. 3. Click `#btn-submit-change-password`. 4. Attempt login with old password (must fail). 5. Attempt login with `NewSecurePass@2026` (must succeed).
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Endpoint `POST /api/auth/reset-password-otp` returns `HTTP 200 OK`.
- Modal closes with success notification.
- Login with new password succeeds immediately. Pass/Fail: Old password invalidated; new password active across all storage tiers.
---
📸 Visual UI Snapshot / Live ProofPassword updated across memory, MariaDB, and storage
TC-AUTH-007Top Navigation Bar & Module Tabs
👤 Tested With User: Yes (Authenticated Session: Sign Out)
● PASS - VERIFIED (100%)
User Logout & Session State Teardown
🎯 Business Objective: Verify that logging out clears credentials, resets role, and cleanses the active view.
⚙️ Preconditions
Logged in as Staff or Patient.
📋 Step-by-Step Actions
1. Click `#btn-logout` ("🚪 Sign Out").
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Session tokens/cookies cleared.
- Role badge resets to Guest/Signed Out.
- UI redirects to the default initial view without residual patient data. Pass/Fail: Complete session termination without data bleed.
---
## Section 2: Top Navigation Bar & Module Tabs
📸 Visual UI Snapshot / Live ProofSession cleared and role reset to guest
TC-NAV-001Top Navigation Bar & Module Tabs
👤 Tested With User: Yes (Staff: Admin)
● PASS - VERIFIED (100%)
Staff Module Navigation
🎯 Business Objective: Verify that clicking top navigation tabs switches active module views correctly.
Expected: - Active tab CSS class updates; corresponding DOM section becomes visible.
- Previous section hides without layout distortion. Pass/Fail: All 7 tabs switch seamlessly within 100ms.
---
📸 Visual UI Snapshot / Live ProofTop Navigation Bar switching across all 7 practice modules
🎯 Business Objective: Verify that patient accounts cannot see or access `#tab-setup` or administrative tools.
⚙️ Preconditions
Logged in as a Patient.
📋 Step-by-Step Actions
1. Inspect the top navigation bar. 2. Attempt to execute `window.navigateToModule('setup')` in the browser console.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Setup tab is hidden (`display: none` or omitted from DOM).
- Calling navigation function redirects or rejects with permission alert ("Access restricted to practice staff"). Pass/Fail: Zero unauthorized module access for patient role.
---
## Section 3: Patient Selection & Directory Management
📸 Visual UI Snapshot / Live ProofSetup tab hidden; permission check restricts patient to personal record
🎯 Business Objective: Verify real-time search filtering in the Patient Directory.
⚙️ Preconditions
Multiple patients loaded in the system.
📋 Step-by-Step Actions
1. Focus the search input `#global-patient-search`. 2. Type `John`. 3. Clear and type `501`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Table instantly filters to matching names or PatNum values.
- Irrelevant rows are hidden without full page reload. Pass/Fail: Search results update smoothly under 200ms debounce.
---
📸 Visual UI Snapshot / Live ProofSearch bar real-time debounce filtering patient rows
🎯 Business Objective: Verify that clicking a patient row sets global patient context across all modules.
⚙️ Preconditions
Patient directory is displayed.
📋 Step-by-Step Actions
1. Click on patient row for `John Smith (PatNum #1)`. 2. Switch to `#tab-chart`, `#tab-billing`, and `#tab-appointment`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Global context `currentSelectedPatient.pat_num` equals `1`.
- Tooth Chart loads tooth notes for John Smith.
- Billing ledger displays John Smith's transactions and balance. Pass/Fail: Context remains synced across tab transitions.
---
📸 Visual UI Snapshot / Live ProofPatient #1 John Smith context bound across Chart, Sched, Billing
TC-DIR-003Patient Selection & Directory Management
👤 Tested With User: Yes (Staff: New Registration)
● PASS - VERIFIED (100%)
New Patient Registration & Welcome Email Dispatch
🎯 Business Objective: Verify creating a new patient automatically provisions portal credentials and dispatches welcome email.
⚙️ Preconditions
Staff member has `#new-patient-modal` open.
📋 Step-by-Step Actions
1. Enter First Name `Alexander`, Last Name `Wright`, Email `alex.wright@example.com`, Phone `555-0199`. 2. Click Submit.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - HTTP `200/201` from `POST /api/patient/create`.
- Patient is assigned next PatNum in sequence.
- Brevo HTTPS API dispatches portal welcome email containing temporary password.
- UI displays Credentials Modal with "Copy Credentials" button. Pass/Fail: Record persisted; credentials delivered via email.
---
📸 Visual UI Snapshot / Live ProofWelcome registration email formatted with stacked username & temporary password pills
TC-DIR-004Patient Profile Summary & Clinical Export
👤 Tested With User: Yes (Staff: International Patient)
● PASS - VERIFIED (100%)
International Address Formatting & Country Selector
🎯 Business Objective: Verify international patients support country-specific postal codes and addresses.
⚙️ Preconditions
Patient registration or edit modal open.
📋 Step-by-Step Actions
1. Toggle `#btn-international-toggle`. 2. Select Country `United Kingdom`. 3. Enter Address `10 Downing Street`, City `London`, Postcode `SW1A 2AA`. 4. Save patient.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Patient record stores country `United Kingdom` and UK postal format.
- Profile header and clinical report display `10 Downing Street, London SW1A 2AA • United Kingdom`. Pass/Fail: International address saved without US zip code validation errors.
---
## Section 4: Patient Profile Summary & Clinical Export
📸 Visual UI Snapshot / Live ProofInternational address and country format displayed without errors
🎯 Business Objective: Verify emailing the official Clinical Report directly to the patient via Brevo.
⚙️ Preconditions
Patient #1 selected; Brevo API key configured.
📋 Step-by-Step Actions
1. Click `#btn-email-clinic-report` on the Patient Profile Summary bar. 2. Confirm recipient email in prompt modal (e.g. `akshi.mishra.bui@gmail.com`). 3. Click OK.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Button transitions to `⏳ Sending Email...`.
- Backend endpoint `POST /api/patient/1/email-clinic-report` returns `status: success`.
- Brevo dispatches certified clinical summary email with responsive styling.
- Alert displays `✅ Official Clinical Report successfully emailed!`. Pass/Fail: Email arrives in recipient inbox with correct demographics and medical register.
---
📸 Visual UI Snapshot / Live ProofCertified clinical record email delivered via Brevo HTTPS
TC-CLIN-003Medical History & Safety Register
👤 Tested With User: Yes (Staff: Resend Credentials)
● PASS - VERIFIED (100%)
Resend Patient Portal Welcome Email
🎯 Business Objective: Verify manual re-dispatch of portal credentials from the Patient Profile bar.
Expected: - Backend executes `POST /api/patient/{pat_num}/resend-email`.
- Generates/refreshes credentials and sends welcome email via Brevo.
- UI displays alert with target username. Pass/Fail: HTTP 200 returned; welcome email received.
---
## Section 5: Medical History & Safety Register
📸 Visual UI Snapshot / Live ProofFormatted credentials email with stacked username and password pills
TC-MED-001Medical History & Safety Register
👤 Tested With User: Yes (Clinical Staff: Add Allergy)
● PASS - VERIFIED (100%)
Allergy Entry & Active Status Highlighting
🎯 Business Objective: Verify adding an allergy with reaction and active status highlighting.
⚙️ Preconditions
Patient Info tab active; Medical History card visible.
📋 Step-by-Step Actions
1. Click `#btn-add-allergy`. 2. Enter Allergen `Amoxicillin`, Reaction `Severe rash & facial swelling`. 3. Ensure `#allergy-status-badge` is set to `Active`. 4. Click `#btn-save-medical-history`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Allergy record saved.
- Active allergen displays with bold red styling and clinical alert icon.
- Included in subsequent Clinical Report exports. Pass/Fail: Record persisted in MariaDB / database mock.
---
📸 Visual UI Snapshot / Live ProofActive allergen with severe reaction highlighted with red safety pill
TC-MED-002Medical History & Safety Register
👤 Tested With User: Yes (Clinical Staff: Safety Check)
● PASS - VERIFIED (100%)
NKDA Fallback Display
🎯 Business Objective: Verify that patients with no recorded allergies display "No Known Drug Allergies (NKDA)".
⚙️ Preconditions
Patient with empty allergy list selected.
📋 Step-by-Step Actions
1. View Medical History card and generate Clinic Report.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Allergy table displays formatted note: `No known allergies recorded (NKDA)`. Pass/Fail: Clear indicator displayed; no blank tables.
---
📸 Visual UI Snapshot / Live ProofNo Known Drug Allergies (NKDA) confirmation note
🎯 Business Objective: Verify selecting dates in the calendar reloads daily operatory bookings.
⚙️ Preconditions
In `#tab-appointment`.
📋 Step-by-Step Actions
1. Pick a date using `#appt-calendar-picker`. 2. Click `#btn-today-appt` ("Today").
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Operatory columns (Chairs 1–5) update with scheduled consultations for the selected day.
- Clicking "Today" restores current calendar day view. Pass/Fail: Calendar grid synchronizes with database query for target date.
---
📸 Visual UI Snapshot / Live ProofOperatory columns 1 to 5 synchronized with selected calendar date
🎯 Business Objective: Verify toggling primary teeth switches arch between 1–32 and A–T.
⚙️ Preconditions
In `#tab-chart`.
📋 Step-by-Step Actions
1. Click `#btn-toggle-primary-teeth`.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Tooth labels transform to pediatric letter system (`A` through `T`).
- Clicking again restores adult numbered system (`1` through `32`). Pass/Fail: Complete numbering toggle without rendering crash.
---
📸 Visual UI Snapshot / Live ProofPrimary teeth toggle switching between adult 1-32 and pediatric A-T
TC-CHART-003Invoice & Billing Ledger Operations
👤 Tested With User: Yes (Dental Provider: Record Proc)
● PASS - VERIFIED (100%)
Record Procedure & Ledger Synchronization
🎯 Business Objective: Verify recording a completed procedure posts to both tooth chart history and financial ledger.
In `#tab-billing` for a patient with open charges.
📋 Step-by-Step Actions
1. Review the aging cards atop the billing module.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Aging boxes sum transactions based on date age.
- Net balance equals `Total Balance - Est Ins Pending = Patient Portion Due`. Pass/Fail: Totals match individual transaction sums.
---
📸 Visual UI Snapshot / Live ProofAging summary cards: 0-30, 31-60, 61-90, 90+ days calculation
TC-BILL-002Invoice & Billing Ledger Operations
👤 Tested With User: Yes (Billing Staff: Post Payment)
● PASS - VERIFIED (100%)
Post Patient Payment
🎯 Business Objective: Verify applying a payment reduces total balance and records payment entry.
⚙️ Preconditions
In `#tab-billing`.
📋 Step-by-Step Actions
1. Click `#btn-billing-payment` ("💳 Payment ▾"). 2. Enter Amount `$150.00`, Payment Type `Credit Card`, Note `Copay payment`. 3. Submit payment.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - `POST /api/account/payment` returns `HTTP 200`.
- Payment appears in ledger in green credit text (`-$150.00`).
- Total balance reflects the credit immediately. Pass/Fail: Ledger recalculates balance due accurately.
---
📸 Visual UI Snapshot / Live ProofPayment entry (-$150.00) posted in green credit text; balance updated
🎯 Business Objective: Verify that selecting Email channel in the statement modal delivers email and logs statement.
⚙️ Preconditions
Statement modal `#statement-modal` open.
📋 Step-by-Step Actions
1. Check `#stmt-mode-email` (checked by default). 2. Select Statement Category `Standard Account Statement`. 3. Enter custom note `Thank you for choosing our practice`. 4. Click `#btn-statement-submit` ("Send Statement").
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Statement email dispatched via Brevo HTTPS API to patient's email.
- Statement logged in database ledger table with `DateSent`, `Type: Standard Statement via Email`, and `Note`.
- Modal closes with success alert. Pass/Fail: Statement logged in ledger and delivered to inbox.
---
📸 Visual UI Snapshot / Live ProofStatement modal with Email channel checked; statement logged to ledger
🎯 Business Objective: Verify that patient users land on the dedicated self-service hub without access to practice administration.
⚙️ Preconditions
Authenticated with Patient credentials.
📋 Step-by-Step Actions
1. Observe dashboard layout upon login.
🎯 Expected Outcome & Pass/Fail Criteria
Expected: - Displays `#patient-portal-hub-section` with welcoming message and portal module cards:
1. My Profile & Address
2. My Medical Info & Allergies
3. My Scheduled Appointments
4. Generate Clinic Report
- Practice Management modules grid is hidden.
- Setup tab is completely removed from navigation. Pass/Fail: Strict RBAC confinement to personal health record.
---
📸 Visual UI Snapshot / Live ProofRestricted self-service hub with personal profile, med info, appointments