Skip to content

test: add Playwright E2E tests for public booking flow - #75

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1791472043-booking-flow-e2e
Draft

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1791472043-booking-flow-e2e

Conversation

@devin-ai-integration

Copy link
Copy Markdown

What does this PR do?

Adds apps/web/playwright/booking-flow.e2e.ts, an E2E suite (existing @calcom/web Playwright project/config and fixtures) covering the public booking flow end to end:

  1. Happy path from the public profile – /{username} → click "30 min" → pick first available day/slot next month → fill name, email, notes → Confirm. Asserts the success page (This meeting is scheduled, booking-title, attendee name/email, notes) and that the DB booking is ACCEPTED, owned by the organizer, with the right attendee.
  2. Required attendee details – clicking Confirm with empty fields does not submit; filling them then books successfully.
  3. Requires-confirmation event (/opt-in) – shows Your booking has been submitted and the booking is PENDING.
  4. Booked slot is no longer offered – after booking, revisiting the same day no longer lists that slot ([data-testid="time"][data-time=...]).

Each test creates its own user via the users fixture and cleans up in afterEach.

Visual Demo (For contributors especially)

N/A – test-only change. A screen recording of the run is shared in the Devin session.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Local Postgres (packages/prisma/docker-compose.yml), .env from .env.example, yarn workspace @calcom/prisma db-deploy && db-seed.
  • Start the app with yarn dev (Playwright reuses the server on :3000), then:
    PLAYWRIGHT_HEADLESS=1 yarn e2e apps/web/playwright/booking-flow.e2e.ts
    
  • Result locally: 4 passed (~27s, 1 worker).

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/c96cb351d0e24223afc1f6aac5fe715d
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/c96cb351d0e24223afc1f6aac5fe715d?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

I ran the new booking-flow suite in headed Chromium against local Cal.com (yarn dev) and Postgres, using one worker. Slow motion was a temporary local override and isn't committed. 4 passed in 49.5s (exit 0).

  • Public booking from the profile page, with the DB booking ACCEPTED: passed
  • Required attendee details enforced, then a valid booking: passed
  • Requires-confirmation booking shows the pending headline, with the DB booking PENDING: passed
  • Booked slot no longer offered when revisiting the day: passed
Booking form during the run Playwright results
Booking form Four tests passed

Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants