test(e2e): full blog-loop canary — login → author → publish → render - #442
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.make e2e-blog-loopfor one-shot local runs and.github/workflows/e2e-blog-loop.ymlfor PR-scoped CI (advisory viacontinue-on-error: trueuntil three consecutive greens).docs/19-e2e-testing.md§19.6, including why it lives alongsideinstall-and-publish.spec.tsrather 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).make up+E2E_ALLOW_DESTRUCTIVE=1; CI exercises the end-to-end path on every PR touchingapps/**orpackages/**.Test plan
e2e-blog-loopworkflow runs green on this PR.make up && make e2e-blog-loopruns the canary to completion.continue-on-error: trueand require the check in branch protection.🤖 Generated with Claude Code