Skip to content

test(e2e): repeatable Playwright suite for the content-ops features - #65

Merged
snowopsdev merged 2 commits into
mainfrom
feat/content-ops-e2e
Aug 31, 2026
Merged

test(e2e): repeatable Playwright suite for the content-ops features#65
snowopsdev merged 2 commits into
mainfrom
feat/content-ops-e2e

Conversation

@snowopsdev

@snowopsdev snowopsdev commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Turns the manual browser walk of the #63 features into a repeatable Playwright suite, cms/tests/e2e/contentOps.e2e.spec.ts, seeded through the Payload local API like the existing e2e helpers.

Covered

  • Webhooks global renders its enabled/url/secret form.
  • Review page renders stage metadata ("Stage 5 of 5: Publish", owner/label copy) from the shared status table.
  • Publishing from the review UI delivers a signed webhook to an in-process listener; the spec verifies the HMAC with verifyWebhookSignature, the approved → published body, the acting user, and that the public article page then serves.
  • The read-only status gate rejects a title edit on a drafted article with its admin error message.
  • The reports page shows the pipeline-runs panel.

Scheduled publishing is deliberately not here — its cron occurrence fires on a five-minute boundary, unfit for e2e; tests/int/publishDue.int.spec.ts covers the handler.

Suite fixes the new specs surfaced

  • Parallel spec files raced on the single shared test user (duplicate-email validation, mid-test logouts). The ops suite seeds its own user.
  • Parallel Playwright workers each boot Payload for seeding and hit the dev-push FK race already documented in payload.config.ts; test:e2e now sets DISABLE_DEV_PUSH, the same guard reasoning as vitest.
  • The dashboard spec pinned one onboarding step's heading copy and failed on any database mid-onboarding; it now asserts a rendered heading.

Verification: full e2e suite passes twice back to back (9/9) against a dev server on a migration-built worktree database (TEST_BASE_URL=http://127.0.0.1:3101 npm run test:e2e --workspace cms); npm run typecheck and the 302-test integration suite unaffected.

Turns the manual browser walk of the #63 features into five specs:
webhooks global form, review-page stage metadata from the shared status
table, publish-with-signed-webhook-delivery (in-process listener, HMAC
verified, public page served), the read-only status gate's admin error,
and the reports pipeline-runs panel. Scheduled publishing stays covered
by its int spec; a five-minute cron boundary is unfit for e2e.

Two suite-level fixes this surfaced: parallel spec files racing on one
shared test user (the ops suite now seeds its own), and parallel
Playwright workers hitting the documented dev-push FK race when each
boots Payload for seeding — test:e2e now sets DISABLE_DEV_PUSH, the
same reasoning as the vitest guard. Also made the dashboard spec assert
a rendered heading instead of pinning one onboarding step's copy, which
failed on any database mid-onboarding.

Full suite passes twice back to back (9/9); int suite and typecheck
unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpSZts1YiNwWeUzisL9Hb2
@snowopsdev
snowopsdev marked this pull request as ready for review August 31, 2026 21:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T21:49:34.997817Z 1b11f41 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b11f41a62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cms/tests/e2e/contentOps.e2e.spec.ts
Comment thread cms/tests/helpers/seedContentOps.ts Outdated
… teardown

Two Codex review findings: the suite clobbered the singleton webhook
global (teardown left it disabled with null url/secret), and the
published fixture stayed publicly routable because archived rows are
not excluded from published queries.

Teardown now snapshots the global before mutating and restores it, and
retireArticles() withdraws published fixtures back to approved while
archiving. Verified against a database with a pre-existing webhook
config: the suite passes and the config survives byte-for-byte, and a
follow-up run leaves zero published e2e rows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpSZts1YiNwWeUzisL9Hb2
@snowopsdev
snowopsdev merged commit 147215e into main Aug 31, 2026
7 checks passed
@snowopsdev
snowopsdev deleted the feat/content-ops-e2e branch August 31, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant