Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Nov 27, 2025

What

Add comprehensive e2e tests for SCF Post Type Abilities.

Why

Ensures the Post Type abilities work correctly through the WordPress Abilities API

How

  • Added new test file tests/e2e/abilities-post-types.spec.ts
  • Tests all 8 post type abilities
  • Tests call REST API endpoints directly (no UI interaction or MCP)
  • Each test includes success cases and error handling (404 not found, 400 invalid input)
  • Tests skip automatically on WordPress versions without the Abilities API

Testing Instructions

  1. Run npm run test:e2e tests/e2e/abilities-post-types.spec.ts
  2. All tests should pass on WordPress 6.9+ or with the Abilities API plugin installed
  3. Tests should skip gracefully on older WordPress versions or without the plugin

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

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, cbravobernal.

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

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7.96%. Comparing base (6ed176c) to head (cfb46d3).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##             trunk    #256      +/-   ##
==========================================
+ Coverage     7.47%   7.96%   +0.48%     
  Complexity    4285    4285              
==========================================
  Files          265     265              
  Lines        33080   33076       -4     
==========================================
+ Hits          2474    2635     +161     
+ Misses       30606   30441     -165     
Flag Coverage Δ
e2e 21.79% <ø> (ø)
phpunit 4.31% <ø> (+0.61%) ⬆️

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.

Copy link
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added small nitpicks. Tests are always beneficial 🚀

@priethor
Copy link
Contributor Author

@cbravobernal, apart from cleaning up the comments, I've changed the e2e matrix to test PRs against trunk, as with versions lower than 6.9 the Abilities tests are skipped because there is no Abilities API.

This made some repeater field tests fail; could you check if it is just flakiness or something changed?

@priethor
Copy link
Contributor Author

This made some repeater field tests fail; could you check if it is just flakiness or something changed?

Addressed in #257

@priethor priethor force-pushed the add/post-type-abilities-e2e-tests branch from 48dc3e2 to ba61099 Compare November 27, 2025 16:07
@priethor
Copy link
Contributor Author

Rebased the PR to get the changes from #257; all tests now pass, without being skipped, against WP trunk.

@priethor priethor merged commit 8545a98 into trunk Nov 27, 2025
8 checks passed
@priethor priethor deleted the add/post-type-abilities-e2e-tests branch November 27, 2025 17:01
@priethor priethor added this to the 6.7.0 milestone Nov 28, 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.

3 participants