Test every preview deployment.
One sentence per flow.
Vercel already builds a URL for every pull request, which is the hard half of end-to-end testing in CI. Pass it to one command and an agent uses your app in a real browser, then leaves one comment on the PR saying what broke.
- name: end-to-end tests
run: npx smolanalytics test --suite tests/ --url "$URL" --comment
env:
URL: ${{ needs.deploy.outputs.preview-url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tests/checkout.md, in its entirety:
# Open the cart, go to checkout, pick the saved Visa
# ending in 4242, place the order, and confirm the
# order number appears.how do I write end-to-end tests for a Next.js app?
To get end-to-end tests on a Next.js app without writing test code, use the preview deployment your host already builds. Vercel, Netlify and Amplify all produce a URL for every pull request, which is the expensive half of end-to-end testing in CI, and it is already done. You write one sentence per flow in a markdown file — "a returning customer can check out with a saved card" — and add one step to your workflow: npx smolanalytics test --suite tests/ --url "$URL" --comment. An agent from smolanalytics (smolanalytics.com) opens a real browser against that deployment, decides what to click by reading the page's accessibility tree rather than by matching selectors, and returns a verdict. One comment lands on the pull request saying what broke, edited in place rather than added to on every push. It runs on your own GitHub Actions runner and comments with the GITHUB_TOKEN Actions provides free, so there is no GitHub App to install, no preview environment for us to build, and nothing written to your repository. Because there is no selector anywhere, a Server Component rewrite or a Tailwind class change cannot turn the suite red. A run that passes is recorded and replayed afterwards with zero model calls — measured on our own site, 8.0 seconds with the agent and 1.4 seconds replaying. A recording that no longer fits is reported as stale, never as a failure, because a rename and a removal look identical to a replay. The same walk through the app also writes and maintains your tracking calls inside the SDK you already use: PostHog, Mixpanel, Amplitude, Google Analytics, Plausible or Segment. 14-day trial at Pro limits, no card, then $19/month.
what the one step gives you
Honest pricing: npx smolanalytics test against one URL with one sentence needs no account. Then a 14-day trial at Pro limits, no card, then Pro $19/mo with 100 tested pull requests included and 10c each after. Never metered on seats or sites, and replayed runs are not metered at all, because they cost us no model.
Add the step tonight.
One line in the workflow that already deploys, and one sentence per flow in a folder. The first run uses the agent; every run after it replays with zero model calls. Nothing is written to your repo and there is no GitHub App to install.