Skip to content

test(e2e): full blog-loop canary — login → author → publish → render - #442

Merged
tayebmokni merged 4 commits into
mainfrom
test/e2e-real-blog-loop
May 25, 2026
Merged

test(e2e): full blog-loop canary — login → author → publish → render#442
tayebmokni merged 4 commits into
mainfrom
test/e2e-real-blog-loop

Conversation

@tayebmokni

Copy link
Copy Markdown
Contributor

Summary

  • Adds tools/e2e/tests/full-blog-loop.spec.ts — the canary spec that exercises the entire "write a blog post" loop end-to-end: log in, navigate to /posts/new, write a title with italic accent, insert paragraph + heading + 3-item list blocks, set status to Publish via the Document tab, publish, capture the slug from the success notification (with banner + anchor fallbacks), wipe cookies to log out, visit the public URL, and assert title (h1), all three block bodies, canonical link, og:title, and og:description.
  • Adds make e2e-blog-loop for one-shot local runs and .github/workflows/e2e-blog-loop.yml for PR-scoped CI (advisory via continue-on-error: true until three consecutive greens).
  • Documents the canary in docs/19-e2e-testing.md §19.6, including why it lives alongside install-and-publish.spec.ts rather than replacing it: the smoke proves the harness works; the canary proves the product works as a CMS.

Why a second spec

The PR #424 skeleton (install-and-publish.spec.ts) landed before the routes were mounted. PR #428 mounted them. Rather than rewrite the skeleton (which would lose the scaffold's blame and break references), the canary lives next to it with its own CI hook. Independent specs = independent failure modes.

Verification (local)

  • cd tools/e2e && pnpm typecheck → clean.
  • cd tools/e2e && pnpm exec playwright test --list → spec discovered across all three projects (chromium, firefox, webkit).
  • Full run is gated on make up + E2E_ALLOW_DESTRUCTIVE=1; CI exercises the end-to-end path on every PR touching apps/** or packages/**.

Test plan

  • CI: e2e-blog-loop workflow runs green on this PR.
  • Local: make up && make e2e-blog-loop runs the canary to completion.
  • Inspect the Playwright trace on failure (auto-uploaded artefact) for the failing step.
  • After three consecutive green runs across unrelated PRs, drop continue-on-error: true and require the check in branch protection.

🤖 Generated with Claude Code

tib0o0o and others added 4 commits May 25, 2026 19:41
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
Findings:
- tools/e2e harness exists with fixtures/server.ts + lib/test-helpers.ts
  (loginAs, freshDatabase, seedAdminUser, tryGonextInit).
- install-and-publish.spec.ts (PR #424) covers similar territory but
  was the canary aspirational spec. We add a sibling full-blog-loop
  spec that adds: italic-accent render assertion, document-tab
  status toggle, slug capture via notification or URL, cookie-only
  logout, 3 blocks (paragraph + heading + 3-item list).
- Login form (apps/admin/src/app/(public)/login/page.tsx) is a stub
  pending wire-up; spec is resilient to label/placeholder shape.
- /posts/new + editor route not yet present; spec navigates to the
  CTA href to mirror PostListClient.tsx ('/posts/new').
- Public site lives at apps/web/src/app/[...slug]/page.tsx — handles
  the slug render path the spec asserts against.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
The canary proves GoNext works as a CMS: a fresh install can log in,
author a post with three block types, publish it, log out, view it on
the public site, and serve correct SEO meta.

Key differences from install-and-publish.spec.ts (PR #424):
- Italic-accent assertion on the title's <em> in the public h1.
- Document-tab status toggle before publish.
- Slug captured from notification, banner, or anchor fallback.
- Three list items (vs two), exercising list-item splitting.
- Cookie wipe logout via context.clearCookies().

Wires up:
- make e2e-blog-loop — local one-shot runner.
- .github/workflows/e2e-blog-loop.yml — PR-scoped, advisory (it runs
  but does not gate merges until three consecutive greens land).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
Adds section 19.6 to docs/19-e2e-testing.md covering:
- What the canary is and how it differs from install-and-publish.
- How to run it locally (make e2e-blog-loop).
- The CI workflow (e2e-blog-loop.yml) and its advisory status.
- A short table explaining why the smoke and the canary co-exist:
  the smoke proves the harness wiring works; the canary proves the
  product works as a CMS.

Verified that the spec parses (tsc --noEmit), lists via
'playwright test --list', and matches the testMatch glob.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Mohamed Tayeb Mokni <tayeb.mokni@gmail.com>
@tayebmokni
tayebmokni merged commit c8d18f4 into main May 25, 2026
12 of 15 checks passed
@tayebmokni
tayebmokni deleted the test/e2e-real-blog-loop branch May 25, 2026 18:07
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.

2 participants