Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Dec 31, 2025

What

Part of #315.

Adds E2E tests covering all SCF field types.

Why

E2E tests for field types validate:

  • Field creation and configuration in the admin UI
  • Field rendering and data entry in the post editor
  • Value persistence and correct frontend output
  • Complex field interactions (Select2, media modals, drag-and-drop)

How

Test Coverage (24 field types)

Category Field Types Tests
Basic Text, Textarea, Number, Range, Email, URL, Password 14
Content WYSIWYG, oEmbed, Image, File, Gallery 10
Choice Select, Checkbox, Radio, Button Group, True/False 10
Relational Link, Post Object, Page Link, Relationship, Taxonomy, User 12
Advanced Google Map, Date Picker, DateTime Picker, Time Picker, Color Picker 10
Layout Group, Repeater, Flexible Content, Clone 8

Testing Instructions

Run all field type tests:

npm run test:e2e -- tests/e2e/field-type-*.spec.ts

@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props priethor.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@priethor priethor mentioned this pull request Dec 31, 2025
22 tasks
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.82%. Comparing base (f7cf76b) to head (b928886).
⚠️ Report is 2 commits behind head on trunk.

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #338      +/-   ##
============================================
+ Coverage     25.13%   27.82%   +2.68%     
  Complexity     4410     4410              
============================================
  Files           291      291              
  Lines         36916    36916              
============================================
+ Hits           9278    10271     +993     
+ Misses        27638    26645     -993     
Flag Coverage Δ
e2e 42.91% <ø> (+14.03%) ⬆️
javascript 6.53% <ø> (ø)
phpunit 24.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add comprehensive Playwright E2E tests covering all 24 SCF field types
across 7 categories, with a shared test helper plugin for output verification.

Field types tested:
- Basic: Text, Textarea, Number, Range, Email, URL, Password
- Content: WYSIWYG, oEmbed, Image, File, Gallery
- Choice: Select, Checkbox, Radio, Button Group, True/False
- Relational: Link, Post Object, Page Link, Relationship, Taxonomy, User
- Advanced: Google Map, Date Picker, DateTime Picker, Time Picker, Color Picker
- Layout: Group, Repeater, Flexible Content, Clone

Test infrastructure:
- field-helpers.js: Shared utilities for field group creation, Select2 interaction,
  layout expansion, and common test operations
- scf-test-all-field-types.php: Test plugin that outputs field values in
  identifiable HTML elements for E2E verification
- test-image.png: Asset for image/file/gallery field tests
@priethor priethor force-pushed the tests/e2e-all-field-types branch from 5e1d59f to b928886 Compare December 31, 2025 15:49
@priethor priethor merged commit fb6166e into trunk Dec 31, 2025
9 checks passed
@priethor priethor deleted the tests/e2e-all-field-types branch December 31, 2025 17:11
@priethor priethor added this to the 6.9.0 milestone Dec 31, 2025
@priethor priethor self-assigned this Dec 31, 2025
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.

2 participants