Skip to content

feat(e2e): Playwright tests for contact, testimonials, our-work, post, and category - #48

Merged
petercr merged 1 commit into
mainfrom
feat/playwright-e2e-tests
Apr 24, 2026
Merged

feat(e2e): Playwright tests for contact, testimonials, our-work, post, and category#48
petercr merged 1 commit into
mainfrom
feat/playwright-e2e-tests

Conversation

@petercr

@petercr petercr commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • contact: full form coverage — validation errors, error clearing, submit disabled state (using a browser-side window.fetch patch to avoid async route handler deadlock), success and error messages, BackToHome/SocialLinks
  • testimonials / our-work: heading, card content, external link attributes, BackToHome/SocialLinks
  • post: 404 always runs; content-dependent tests skip without E2E_HAS_CONTENT + E2E_POST_SLUG env vars (no published posts yet)
  • category: uses /design (pre-built Sanity category) as a known slug so all 5 tests run unconditionally without env var gates

Key decisions

  • __reactFiber hydration wait in every beforeEach — fixes SSR timing failures where React hadn't attached event handlers yet when tests interacted with the page
  • window.fetch patch via page.evaluate() for the "submit disabled" test — async page.route() handlers caused a deadlock: click() waited for the handler, the handler waited for a latch resolved in finally after click(), so neither could proceed
  • Closes Add Playwright e2e tests for Contact, Testimonials, Our Work, Post, and Category pages #47

Test plan

  • npx playwright test passes with 25 tests passing, 9 skipped (post/category content tests)
  • E2E_HAS_CONTENT=1 E2E_POST_SLUG=<slug> npx playwright test runs the skipped post tests when a post is published

…post, and category pages

- contact: form validation, error clearing, submit disabled state, success/error
  messages, and BackToHome/SocialLinks presence; uses window.fetch patch to avoid
  async route handler deadlock that caused 30s timeouts
- testimonials/our-work: heading, card content, and component presence checks
- post: 404 not-found always runs; content-dependent tests skip without E2E_HAS_CONTENT
- category: uses /design (pre-built page) as known slug so all tests run unconditionally
- all beforeEach hooks wait for __reactFiber on a key element to confirm React
  hydration before interacting, fixing SSR timing failures

Entire-Checkpoint: ed2487fe17d9
@vercel

vercel Bot commented Apr 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ccw Ready Ready Preview, Comment Apr 23, 2026 9:12pm

@petercr
petercr merged commit f47a607 into main Apr 24, 2026
3 checks passed
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.

Add Playwright e2e tests for Contact, Testimonials, Our Work, Post, and Category pages

1 participant