For your role
Cursor for QA Engineers: Tests, Coverage and Repros
QA engineers use Cursor to generate and maintain test suites, write reproductions from bug reports, expand edge-case coverage and review generated code for risk. Point it at the code under test, ask for the cases humans miss and always verify the tests fail before they pass.
On this page
- What do QA engineers use Cursor for?
- How do I trust Cursor-generated tests?
- How do I package a repeatable coverage workflow?
- How much of this should a two-person team bother with?
- Can Cursor drive a browser to test the UI?
- How do I run a coverage campaign on legacy code?
- What about accessibility and integration boundaries?
What do QA engineers use Cursor for?
Point Cursor at the code under test and most of the role opens up. It will draft a first suite for a module and push past the happy path into the boundary and error cases people skip. Hand it a bug report and you get back a failing test that reproduces it. The work that matters most is the last item on the list below: reading generated code for the risks a quick glance misses.
- Generate tests for a module, then refine the cases.
- Repro bugs by writing a failing test from a report.
- Expand coverage by asking for boundary and error-path cases.
- Review risk in AI-generated code (auth, data handling, edge cases).
Those four sit in rough order of how cheap they are to get wrong, though the ordering is mine rather than Cursor's. A thin generated suite announces itself eventually, when something breaks in production and nothing went red.
Reviewing generated code for risk is the expensive end, mostly a question of volume. Code arrives faster than it used to, review capacity did not move, and the careful read of the auth path is what gets dropped in between.
This is covered hands-on in Cursor Product Quality Engineer Interview Prep — 7 short modules, free to read.
How do I trust Cursor-generated tests?
A generated test that passes on its first run has told you nothing. The habit that earns trust is watching each test fail before the fix and pass after, so you know it's actually touching the code. The rest of it (a testing rule for style, an explicit ask for error paths, a read of what each test asserts) keeps the green checkmarks honest.
- Confirm each test fails before the fix and passes after (no tautologies).
- Add a testing rule so generated tests match your framework and style.
- Ask explicitly for edge cases and error paths, not just the happy path.
- Keep a human in the loop. Review what the tests actually assert.
Watching a test fail is the only one of those four you cannot delegate, which is why it sits at the top. The other three raise the odds of getting a good test; this is the one that tells you whether you got one. A suite that has only ever been green is compatible with almost any state of the code underneath it, including the state where the assertion sits inside a try block that quietly swallows the failure.
The cost of getting this wrong is one bad test, or that is how it looks the first time. What it actually costs is the next green run, which now gets read by hand because nobody trusts the last one, and reading a suite by hand is the work the generation was supposed to remove. Spend the extra minute on the first test in a batch rather than on the tenth.
Don't let the agent guess your test patterns from neighboring files. Put them in a Cursor rule (an .mdc file in .cursor/rules with YAML front matter) scoped to apply to your test directory, so the agent auto-pulls it in whenever it works near those files. A good backend-unit-testing.mdc carries the framework choice (pytest), the required test structure, naming conventions, a sample per endpoint type, and how to run the suite. This matters most for the exotic conventions the agent can't infer: JSON-config test parameters, remote-deploy steps, team practices that live outside the test code.
The rules are the manuals or the city code that the construction worker has to obey.
If a rule is not being obeyed, work out whether it is loading at all before you rewrite it. Project rules only count when the file carries the .mdc extension, and the frontmatter has to match how you meant it to apply: a globs pattern that really matches your test paths, or a description if you are leaning on the agent to pull the rule in. Cursor's own best-practice list also says keep a rule under 500 lines and reference your canonical test file rather than pasting it in. The rules-not-following page has the rest of the checklist.
One piece of the standard rules advice does not transfer here. Cursor says to start simple and add a rule only after you have watched the agent make the same mistake repeatedly, which is good discipline for most work. Test conventions are the exception I would make up front: they are cheap to write down, and the mistake you are heading off is one you may not notice for a month.
How do I package a repeatable coverage workflow?
Wrap it in a skill. A "test coverage" skill holds instructions for both backend and frontend coverage, runs an underlying coverage.sh (a pytest-coverage command), then formats and outputs the report, including an HTML report.
Trigger it explicitly with /test coverage backend, or just ask "can you check my backend test coverage?" and let the agent discover and pull the skill in. If the agent is aware of the skill, it reaches for it where it's convenient. You never need to reference it directly.
How much of this should a two-person team bother with?
Less than a full setup list suggests, with one exception. On a small team you can hold in your head which tests actually assert something, and a rule file plus one coverage skill covers most of the rest. The exception is the fail-first check, which does not get cheaper when there are fewer people around to catch it.
The calculation changes once the people writing tests and the people trusting them are different people. A convention you can explain in a stand-up will not survive three teams, so it has to live where the agent reads it, which is what the rule file is for. On Team and Enterprise plans it can also be a Team Rule that an admin marks as required rather than something individuals switch off in Customize.
None of it decides what correct means. Somebody still has to state the expected output before a test can check for it, and that judgment does not get cheaper with more agents running. On a two-person team the person who does it is obvious. Once there are several teams it tends to end up unowned, usually because everyone assumes the suite already covers it.
Can Cursor drive a browser to test the UI?
Yes. Type @browser in a prompt and Cursor runs your built app in a browser pane inside the Agents window. Beyond viewing, you can hand it the controls: "test that the category slider works, take control and make sure it works." It scrolls, clicks and moves sliders on its own. The field team says this in-browser agent QA is how a lot of folks do QA at Cursor.
Cursor's docs describe the integrated browserCursor's built-in browser, driven by Playwright under the hood, so the agent can navigate, click, screenshot and capture each action's metadata while you watch. Press Enter for the full definition. as a secure web view the agent drives through MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. tools (click, navigate, type, screenshot, plus console and network reads), and Cursor's field team describes Playwright running underneath. Either way, the agent captures the metadata of each action. A banner shows it's using the browser, with a step log alongside. You can ask it to write each accessed element out to a log file. That action history is the substrate for turning a flow into a test.
Interactive diagram. Step through it with the Next and Previous controls below, or Tab to a region to read its detail.
Drive the flow once, then ask Cursor to codify the recorded actions into a reliable integration test you run in staging.
The standout move is to perform the flow once, then turn that exact action history into a durable test. No hand-writing selectors.
Based on this action create an integration test in our suite.
How do I run a coverage campaign on legacy code?
Use plan mode to do the thinking before any edits. One prompt can carry the whole sequence: "find all my FIXME and TODO comments, determine the top five most critical, create a detailed testing plan to keep behavior consistent, then migrate to the new functionality while making sure nothing else breaks." Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. Press Enter for the full definition. returns a Markdown plan with P0-P2 items, each with a problem statement and a per-item unit-test plan.
Append a final task to write the work back out. Over the Atlassian MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition.: "based on the to-do comments in the alerting module, create a set of Jira stories," and optionally update a Confluence doc. The ordering that works: run the plan-mode step first, then create the tickets from the plan rather than the other way around. Anything you'd do by hand in Atlassian, you can outline to the agent and make a skill of it if it repeats.
What about accessibility and integration boundaries?
Two more patterns worth knowing. For accessibility, the requirements doc is the test spec: put your standard a11y requirements in a Markdown file and ask the agent to run through them and verify each one is present. A large insurance customer used exactly this pattern to audit one of their UI products. No special tooling needed.
For end-to-end tests that hit external data (say, MuleSoft as the integration layer), there's usually a shared contract defining the request and response schemas. Have the agent fire the requests and validate responses against that schema. Cursor generates this contract test as easily as any other.
Use Pydantic or some model validator to make sure the request is as expected; if it's not, the test fails.
If you'd normally screen-record a repro, don't. A video file is too big to parse. Give Cursor written reproduction steps instead and it can reproduce the behavior in your app on its own.
Frequently asked questions
Can Cursor write tests for me?
Yes. Point it at the code under test and it will generate a suite. Refine the cases, confirm tests genuinely fail before passing and ask for edge/error paths the happy-path generation misses.
Is AI-generated test code reliable?
It is a strong starting point but needs review. Watch for tautological tests that always pass and verify each test fails before the fix. A testing rule keeps style and framework consistent.
Can Cursor run end-to-end browser tests?
Yes. Type @browser to run your app in a pane, where the agent clicks, navigates, types and screenshots on its own and records each action. Drive a flow once, then ask Cursor to turn its recorded actions into an integration test you run in staging.
How do I test accessibility with Cursor?
Put your accessibility requirements in a Markdown file and ask the agent to run through them and verify each one is present in the app. The requirements doc acts as the test spec. No special tooling required.
Why isn't my testing rule being applied?
Check that it is loading before you rewrite it. Project rules must use the .mdc extension, and a plain .md file in .cursor/rules is ignored because it has no frontmatter. Then check the frontmatter matches how you meant the rule to apply: a globs pattern that matches your test paths, or a description if the agent is meant to pull it in.
Sources & last verified
Cursor ships frequently. Last updated July 28, 2026.