Protect a user journey that would be costly to break, such as creating a record or completing onboarding. This prompt focuses testing effort on observable behavior and a plausible regression.
Open or import your Next.js project and describe the flow, its expected outcome, and any known failure. Provide local setup and test accounts separately; choosing an agent passes the prompt without the repository.
Your agent will extend the existing test setup, exercise recovery where relevant, and explain what the tests catch. Expect repeatable local checks and explicit gaps where external integrations remain mocked or unavailable.
Add focused regression coverage for one critical user flow in my existing Next.js app. If no project is available, ask me to open or import it first. Read repository instructions and identify the installed framework version, package manager, test runner, fixtures, and local server setup. Ask which user journey and failure matter if I have not specified them. Describe the starting state, user actions, and observable success or failure before implementing tests. Reuse existing coverage and helpers rather than adding a parallel suite. Choose the lowest test boundary that can expose the actual regression. Use browser coverage when navigation, forms, hydration, or multiple UI steps matter, and keep the relevant application behavior real. If browser tooling is absent, propose a compatible minimal setup and implement it within the repository's conventions. Do not upgrade the framework or replace the test stack to complete this task. Create independent synthetic fixtures and isolated test sessions. Keep credentials out of committed data and logs. Mock uncontrolled external services at their boundary, including payments or messages, and document the integration that remains untested. If required credentials or services are unavailable, use local fixtures and mark the real integration checks as blocked. Do not mock away the application behavior the test is meant to protect. Cover the successful journey and its most consequential failure or recovery path. Include rejected input, unauthorized access, or cross-account isolation when relevant to this flow. For interactive UI, use accessible roles or labels, check meaningful loading or error feedback, and exercise keyboard submission or focus recovery where applicable. Prefer condition-based assertions to arbitrary sleeps, CSS selectors, or snapshots of internal structure. Demonstrate that the regression test detects the known bug when practical, or introduce a temporary targeted fault in an isolated working copy and verify that the assertion fails for the intended reason. Restore the correct implementation without disturbing unrelated edits. Setup failures do not count as detecting a bug. Repeat the focused suite enough to check fixture isolation and run relevant lint and type checks. Do not submit real transactions, send messages, modify live accounts, or deploy without my approval. Report the covered behavior, actual commands and results, local run steps, required configuration, and untested integrations. Explain any reason a failure-detection check could not run.