Repository navigation
Testing E2e Lifecycle
The September 2026 pattern sweep exposed two test-harness failures that initially looked like navigation and CORS problems.
insertPatternBySlug() used one asynchronous page.evaluate() for both fetching
the pattern registry and parsing/inserting the chosen pattern. The browser could
report Protocol error (Runtime.callFunctionOn): Promise was collected even
though the blocks had already appeared in the editor. Playwright rewrote that
protocol error as Execution context was destroyed, most likely because of a navigation. Browser lifecycle instrumentation confirmed that no document or
execution context was destroyed at that point.
Tracing changed the timing and concealed the failure. Repeating the same checks with tracing disabled reproduced it. The helper now resolves the pattern content first, then parses and inserts it in a separate, synchronous evaluation. It does not retry insertion: repeating an operation that already inserted content could duplicate blocks.
tests/e2e/pattern-insertion.spec.js covers initial and cached lookups, the exact
number of inserted blocks, unique client IDs, validation, and missing-pattern
errors without content changes.
The Mobile Safari failure involved the editor's /wp/v2/pages?context=edit
request. A trace showed that request returning HTTP 200, followed by later
requests to the same endpoint being canceled when the test navigated the editor
tab to the published frontend. The original failure surfaced an access-control
error during this transition.
The pattern sweep now uses openFrontendPage() to review the published frontend
in a separate page in the same browser context. Editor requests can finish.
Errors from both pages remain assertions, with editor/frontend labels for
triage. The frontend listener is attached before navigation so startup errors
are captured.
tests/e2e/editor-lifecycle.spec.js holds a real browser request pending while
opening the frontend. Same-tab navigation failed the check because the request
was canceled; separate-page navigation lets it complete with HTTP 200. A second
check verifies that frontend JavaScript exceptions remain observable.
With wp-env running:
npx playwright test tests/e2e/pattern-insertion.spec.js tests/e2e/editor-lifecycle.spec.js --workers=2 --trace=offUse --trace=off when reproducing the collected-promise failure. Traces remain
useful for examining request URLs, status codes, and navigation timing, but a
passing traced run alone does not rule out that race.
Auto-generated from
docs/testing/E2E-LIFECYCLE.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Interactive Blocks
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes