// next.js testing
AI end-to-end testing for Next.js. No scripts.
Add one line to your next.config, run next dev, and an AI scan of your Next.js app is one click away — right inside the app, on localhost. The browser runs on your own machine, so there’s no deploy, no staging URL, and no tunnel to fall over on a big app.
$ npm install -D @aegisrunner/next
// next.config.mjs
import withAegisRunner from '@aegisrunner/next'
const nextConfig = { /* your config */ }
export default withAegisRunner(nextConfig)
# then, as usual — the shield appears in your app:
$ npm run dev dev-only. a pure pass-through in `next build` and production.
// the flow
From next dev to a real test suite — on your machine.
Wrap your next.config
One line: withAegisRunner(nextConfig). It attaches in the dev phase only — a pure pass-through in next build and production.
Run next dev
A floating AegisRunner shield appears in your app. The browser runs on your own machine and scans localhost directly — no tunnel, no deploy.
AI explores your app
The agent drives your routes like a user — App Router or Pages, forms, dynamic segments — and signs in if you set a credential.
Tests come back
A generated end-to-end suite plus accessibility, SEO and functional findings — keyed to your real pages, before you push.
// why aegisrunner for next.js
Built for the way you ship Next.js.
App Router & Pages
Works with the App Router and the Pages Router — Server Components, layouts, dynamic routes and all.
Runs on your machine
The browser drives localhost directly — no tunnel, no cloud relay. Fast even on large apps, and nothing leaves your network.
Shield in your app
Click Test this page or Test the whole site right inside your running app — live progress, link to results.
Zero test code
No Playwright scripts, no selectors to maintain. The AI decides what to test from your live app.
Export to Playwright
Own the output: export any generated suite to Playwright and run it with npx playwright test.
Signs in for you
Set a username/password (or a saved role) and the AI maps it onto your login form — credentials stay on your machine.
// faq
Next.js testing, answered
How do I add AegisRunner to a Next.js app?
Install @aegisrunner/next, then wrap your config: `export default withAegisRunner(nextConfig)`. On `next dev` a shield appears in your app; click it to scan. No deploy, no staging URL — the browser runs on your own machine against localhost.
Does it work with the App Router and Server Components?
Yes. The AI drives your app in a real browser, so it tests the rendered result — App Router or Pages Router, Server Components, streaming, dynamic routes — exactly as a user would see it. It never needs to read your source.
Does it work with Turbopack (Next 16)?
Yes. Scans, the [a] keypress and the widget endpoints all work under Turbopack. Turbopack can’t auto-inject the floating shield, so either add `<script async src="/__aegis/widget.js">` to your root layout (dev only) or run `next dev --webpack` to have it injected for you.
Do I have to deploy to a staging URL first?
No. Local execution runs a real headless browser on your machine (via @aegisrunner/scan-runner — no Docker) and scans localhost directly. Nothing is exposed to the internet; only the findings come back.
How does it test pages behind authentication?
Set AEGIS_USERNAME / AEGIS_PASSWORD (or a saved --role) and the local browser signs in itself — credentials never leave your machine. The AI maps your username onto whatever the form calls its identity field.
Can I run the generated tests in CI?
Yes. Export any suite to Playwright and run it in your pipeline, or trigger a full AegisRunner scan/run from CI with a JUnit report. The same CI token powers the plugin and your pipeline.
Test your Next.js app in two minutes
Wrap your config, run next dev, click the shield. Watch the AI explore your app and hand you tests before you deploy.