Opened 5 weeks ago
Last modified 4 weeks ago
#65772 new enhancement
Add an end-to-end test for scheduled post publishing (future to publish via WP-Cron)
| Reported by: | csmcneill | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
No end-to-end test exercises the actual future-to-publish transition through WP-Cron — existing coverage stops at "the post is scheduled".
A spec covering the real transition is open as a PR: https://github.com/WordPress/wordpress-develop/pull/12668
It schedules a post by the server's own clock, waits out the scheduled time, then drives wp-cron.php explicitly and asserts the status flip; a second test covers the Scheduled view of the posts list. Comments in the spec document the cron-lock and loopback behaviors that make the explicit drive deterministic in containerized environments, including this repository's own Docker environment. Green across the full CI matrix.
Part of a series adding e2e coverage for classic admin surfaces — see #52895.
Change History (2)
This ticket was mentioned in PR #12668 on WordPress/wordpress-develop by @csmcneill.
4 weeks ago
#1
- Keywords has-unit-tests added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Adds end-to-end coverage for scheduled post publishing: a true future-to-publish transition through WP-Cron, plus the Scheduled view of the posts list.
As far as I can tell, no e2e test currently exercises the actual cron transition — existing coverage stops at "the post is scheduled". The transition test schedules a post 60 seconds out by the server's own clock (read from an HTTP Date header, so host/container clock skew doesn't matter), lets the scheduled time pass, then drives wp-cron.php explicitly and asserts the status flip.
Two environment realities shaped the design and are documented in the spec:
Trac ticket: https://core.trac.wordpress.org/ticket/65772
Trac ticket: https://core.trac.wordpress.org/ticket/52895
## Verification
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude (Claude Code via Craft Agents)
Agent(s): Fable 5
Used for: Test authoring and cross-environment verification, with human review; reviewed and submitted by the author.