Skip to content

test(e2e): browser coverage for Inertia v3 client features via dev-host fixture pages - #820

Merged
antosubash merged 4 commits into
mainfrom
test/inertia-e2e-coverage
Nov 4, 2026
Merged

antosubash merged 4 commits into
mainfrom
test/inertia-e2e-coverage

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Browser e2e coverage for the Inertia v3 client features that no framework page exercises today. Before this PR, tests/e2e covered page URLs, titles, i18n, error pages and mutating flows. Deferred props, once props, merge, infinite scroll, error bags, history encryption, WhenVisible, polling, prefetch and the asset-version reload were tested only at the protocol level, if at all.

The fixtures are ported from the inertia_lab feature lab (a fresh smpy new app) that also produced #818.

Fixture pages (dev host only)

  • host/e2e_inertia/ defines routes under /__e2e/inertia.
    • Every route requires Authenticated().
    • host/main.py mounts them only when settings.is_development, which is the mode the CI e2e-smoke job runs in. host/tests/test_e2e_inertia_gating.py proves a 404 outside development and a 401 for anonymous users.
    • Probe counters at /_probes let the tests prove which lazy loaders ran.
  • The pages are host/client_app/pages/E2eInertia/*.tsx, marked i18n-exempt as fixtures.
    • pages.ts globs them only under import.meta.env.DEV, so production bundles drop them. Verified with a vite build: no fixture chunk.

Tests (tests/e2e/inertia/, directory-scoped conftest)

The conftest provides a signed-in page that fails on any console or page error, and an autouse probe reset. Existing e2e tests keep Playwright's plain page. The tests cover:

  • Partial reloads: only, except, and a dotted only.
  • Deferred props: groups and rescue.
  • Merge: merge, prepend, deep_merge, match_on, and reset.
  • Once props: cache reuse across visits, expiry and explicit refresh.
  • Infinite scroll: the URL page param, no duplicate items, and reset.
  • useForm: the default bag and a named errorBag. The JSON-body validation case is marked xfail, not strict; fix(hosting,inertia): Inertia body validation redirects back with field errors; faster first loads #818 fixes it.
  • Redirects: 302→303 after PUT/PATCH/DELETE, an empty 200 redirecting back, back(), the fragment 409 and the external location 409.
  • History: encryptHistory, clearHistory, and preserveFragment across a redirect, plus a control that loses the hash without the flag. The test was verified failing when the flag is removed.
  • Visibility, polling and prefetch: WhenVisible, usePoll, and prefetch on hover.
  • Asset versions: a stale X-Inertia-Version gives a 409 and a full reload.

Verification

  • tests/e2e (full, local stack on 8411/5411): 96 passed, 1 xfailed (before the last two test-only commits); the history file was re-run after them: 6 passed.
  • make lint ✓, make test-js ✓ (891), host/tests ✓ (38), make test-py ✓.
    • test_clean_target_is_not_in_repo fails locally only when the sandbox leaves a /tmp/.git placeholder; it passes once that is removed.
  • /ship: Codex correctness review (2 passes) and a Sonnet maintainability review. Fixes made:
    • fixtures moved to a directory conftest, which drops a ruff F811 ignore;
    • fixture pages excluded from production builds;
    • E2E_USERNAME honoured;
    • the preserveFragment test made meaningful.

https://claude.ai/code/session_01FXHA3ZJ5EgoJN4zXTAhBR2

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 956de1d
Status: ✅  Deploy successful!
Preview URL: https://2478faa0.simple-module-python.pages.dev
Branch Preview URL: https://test-inertia-e2e-coverage.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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
🔒 Security Review ✅ Completed 2026-11-04T15:06:03.065471Z 956de1d PR opened
ℹ️ 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.

@antosubash
antosubash merged commit e6954e9 into main Nov 4, 2026
16 checks passed
@antosubash
antosubash deleted the test/inertia-e2e-coverage branch November 4, 2026 15:35
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