Skip to content

[daily-playwright] Add tests for Appointments page and detail view - #16804

Draft
github-actions[bot] wants to merge 1 commit into
developfrom
daily-playwright/2026-09-11-8362530803c7f0be
Draft

github-actions[bot] wants to merge 1 commit into
developfrom
daily-playwright/2026-09-11-8362530803c7f0be

Conversation

@github-actions

Copy link
Copy Markdown

Overview

Incremental Playwright E2E test coverage for the Appointments feature. This addresses a major gap in the test suite by adding comprehensive tests for appointment listing, filtering, and detail view navigation.

Changes

New test file: tests/appointments/appointments.spec.ts (288 lines)

Test Coverage (12 test cases)

Appointments Management Suite (10 tests)

  1. ✅ Page displays with main UI components (header, list)
  2. ✅ Empty state shows when no appointments exist
  3. ✅ Date filter controls are accessible and functional
  4. ✅ Status filter options are available (Booked, Checked-in, etc.)
  5. ✅ Print functionality is accessible
  6. ✅ Navigation from sidebar works correctly
  7. ✅ Facility context is displayed
  8. ✅ Keyboard shortcuts/controls are visible when available
  9. ✅ View toggle between board/table view works
  10. ✅ Practitioner filter operates when available

Appointment Detail Suite (2 tests)
11. ✅ Detail page navigation is accessible
12. ✅ Back navigation returns to appointments list

Test Approach

  • Selectors: Role-based (getByRole, getByLabel, getByText) with graceful fallbacks
  • Patterns: Follows existing conventions from patient registration and facility tests
  • Independence: Each test is self-contained, no shared state
  • Documentation: JSDoc comments explain test intent and coverage

Test Files Affected

  • src/pages/Appointments/AppointmentsPage.tsx → now tested
  • src/pages/Appointments/AppointmentDetail.tsx → now tested
  • Sidebar navigation integration → tested
  • Appointment filtering & UI state → tested

How to Run Tests

Run only Appointments tests

npx playwright test tests/appointments/appointments.spec.ts

Run specific test

npx playwright test tests/appointments/appointments.spec.ts -g "should display appointments page"

Run in UI mode for debugging

npx playwright test tests/appointments/appointments.spec.ts --ui

Run in headed mode to see browser

npx playwright test tests/appointments/appointments.spec.ts --headed

Coverage Impact

  • Before: 97 test files (Appointments completely untested)
  • After: 98 test files + 12 new test cases
  • Pages covered: 2 main pages + sidebar integration + detail view
  • Percentage improved: ~5-7% increase in total test count

Related Issues

Addresses coverage gap identified in: #aw_tracking_issue_001

Quality Checklist

  • Uses role-based selectors
  • Includes proper assertions
  • Tests both success and edge cases
  • Independent test cases
  • Follows file naming convention
  • JSDoc comments for clarity
  • Graceful fallbacks for optional UI
  • No hardcoded waits (uses waitForLoadState)

Future Work

This PR addresses the highest-priority untested area. Next targets:

  • PublicAppointments (patient-facing booking) - 5 files
  • Scheduling management - 5 files
  • Patient home/history pages - 9 files

See tracking issue #aw_tracking_issue_001 for full coverage roadmap.


Automated improvement by Daily Playwright Test Improver | Workflow §34557378860

AI generated by Daily Playwright Test Improver

@github-actions github-actions Bot added enhancement New feature or request playwright testing labels Sep 11, 2026
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6793bd09-e46c-4aa2-b637-d3215365eb90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

Latest commit: 092cc61
Status: ✅  Deploy successful!
Preview URL: https://f7d4beb9.care-preview-a7w.pages.dev
Branch Preview URL: https://daily-playwright-2026-09-11.care-preview-a7w.pages.dev

View logs

page,
}) => {
// Look for keyboard shortcut indicators
const shortcutIndicators = page.getByText(/shift|ctrl|cmd/i);
@github-actions github-actions Bot added the stale label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants