feat(e2e): Playwright tests for contact, testimonials, our-work, post, and category - #48
Merged
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
window.fetchpatch to avoid async route handler deadlock), success and error messages, BackToHome/SocialLinksE2E_HAS_CONTENT+E2E_POST_SLUGenv vars (no published posts yet)/design(pre-built Sanity category) as a known slug so all 5 tests run unconditionally without env var gatesKey decisions
__reactFiberhydration wait in everybeforeEach— fixes SSR timing failures where React hadn't attached event handlers yet when tests interacted with the pagewindow.fetchpatch viapage.evaluate()for the "submit disabled" test — asyncpage.route()handlers caused a deadlock:click()waited for the handler, the handler waited for a latch resolved infinallyafterclick(), so neither could proceedTest plan
npx playwright testpasses with 25 tests passing, 9 skipped (post/category content tests)E2E_HAS_CONTENT=1 E2E_POST_SLUG=<slug> npx playwright testruns the skipped post tests when a post is published