Add E2E tests for appointment booking workflow - #16632
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Add E2E tests for appointment booking workflow#16632github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
- Add comprehensive test coverage for appointment booking flow - Test practitioner/service selection, date/slot picking - Verify tab navigation and sheet interactions - Handle empty states and closure scenarios - Use role-based selectors and faker for dynamic data Related to #16623
Deploying care-preview with
|
| Latest commit: |
01f6f20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5a5d8d58.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://daily-playwright-2026-08-04.care-preview-a7w.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive Playwright E2E tests for the appointment booking workflow, a critical healthcare feature that allows medical staff to schedule patient appointments with practitioners or healthcare services.
Test File:
tests/facility/appointments/appointmentBooking.spec.tsTest Coverage: 7 test cases covering the complete booking flow
Related Issue: #16623
What Was Tested
Core Booking Flow
UI Interactions
Why This Matters
Appointment booking is one of the most frequently used features in CARE for scheduling patient care. This workflow was completely untested until now, despite being critical to daily healthcare operations. These tests ensure that:
Testing Approach
Patterns Used
getByRole,getByLabel,getByTextfor accessibility complianceselectFromCommandfromtests/helper/ui.tsfor consistent component interactionsfakerfor unique appointment reasons to prevent test collisionstoBeVisible(),toHaveAttribute()for reliabilitytest.step()for clarity and debuggingAuthentication
Uses
tests/.auth/user.json(admin user) with necessary permissions to book appointments.Fixtures
Leverages existing fixtures via:
getFacilityId()- Test facility from setupgetPatientId()- Test patient from setupTest Quality Checklist
appointmentBooking.spec.tsHow to Run Locally
Coverage Progress
Before: Appointments had only listing page tests (7 tests)
After: Appointments now have listing + booking workflow (14 tests total)
Coverage Estimate: ~30% of appointment workflows
Next Steps
The natural progression from booking tests:
Related Links
tests/PLAYWRIGHT_GUIDE.mdTechnical Implementation Details
Component Structure Tested
The booking workflow involves several interconnected components:
Responsive Design Handling
The tests account for responsive differences:
selectFromCommandhelperEdge Cases Covered