Who is this for?
- QA engineers who want to scale test creation without sacrificing quality
- Developers who want to validate their changes before merging
- Teams looking to shift testing left into the sprint cycle
Prerequisites
- Spur MCP set up in Claude Code
- A GitHub or Jira MCP connected (for PR/ticket context)
- Claude Code with access to your project codebase
The Workflow
Step-by-Step
Feed your agent a PR or ticket
Start by pointing Claude Code at the change you want to test. This can be a pull request, a Jira ticket, or even a commit hash.Claude reads the PR description, code diffs, and changed files to understand what was modified. Even PRs with minimal descriptions work well — the code diff itself provides rich context about what changed and what needs testing.
Claude identifies test areas from code context
With access to your full codebase, Claude goes beyond the PR diff. It examines the surrounding code, related components, and existing test coverage to identify what should be tested.For example, Claude might identify:Claude analyzes your codebase structure, identifies critical user flows, and ranks them by importance — giving you a prioritized list of test cases to create.
- The primary flow (search term clears on modal close)
- Edge cases (what if the search had active results?)
- Related areas (does the search state persist across navigation?)
Generate test steps
Claude outputs structured test steps that map directly to what Spur expects. Each test case includes a clear description, preconditions, and step-by-step actions with expected outcomes.Example output:
Create the test in Spur
Once you are happy with the test steps, copy them into Spur to create the test. As Spur MCP adds CRUD tools, this step will become fully automated — Claude will create and update tests directly via MCP without manual intervention.
CRUD operations for test creation and editing via MCP are coming soon. This will let Claude create and update tests programmatically, eliminating the manual copy step.
Run the test
Use the Spur MCP to trigger the test directly from your editor:Claude calls
run_test with the correct environment and monitors the run. You stay in your editor the entire time.Analyze and iterate on failures
When a test fails, Claude pulls the full debugging context automatically:
get_test_run_overview— What failed and at which stepget_test_run_console_logs— JavaScript errors or warningsget_test_run_network_logs— Failed API calls or unexpected responsesget_test_run_screenshots— Visual state of the browser at failure
Scaling with Code-to-Test Mapping
As your test suite grows, you can maintain a mapping between code areas and their corresponding Spur tests. This lets you (or your CI pipeline) automatically identify which tests to run when specific code changes.How it works
- Map code areas to tests — Maintain a reference (in your repo or in Spur) that links code paths to test IDs
- When a PR touches a file — Claude checks the mapping and identifies which Spur tests cover the affected area
- Run only relevant tests — Instead of running the full suite, you run targeted tests that correspond to the change
list_tests to confirm coverage, then runs the relevant subset with run_tests.
Example mapping
Pairing with Other MCPs
This workflow becomes even more powerful when you combine multiple MCPs:| MCP | What it adds |
|---|---|
| GitHub | PR diffs, commit history, changed files |
| Jira / Linear | Ticket context, acceptance criteria, sprint priorities |
CI/CD Integration
To fully close the loop, you can trigger Spur tests from your CI pipeline on deploy previews:- Your CI builds a deploy preview for the PR
- A GitHub Action triggers Spur tests against the preview URL
- Spur runs the relevant tests using environment URL overrides
- Results feed back to the PR as a status check
Tips from Real Usage
Start broad, then narrow
Start broad, then narrow
Ask Claude to survey your codebase for high-priority test areas first. Then work through them systematically — one area at a time (cart, then navigation, then checkout). This is more productive than trying to test everything at once.
Use relative URLs in test steps
Use relative URLs in test steps
When authoring tests, use relative paths instead of hardcoded domains. This makes it easy to run the same tests across staging, production, and deploy previews by overriding the base URL in your environment configuration.
Let Claude's memory improve over time
Let Claude's memory improve over time
As you iterate with Claude Code, it learns your patterns — what step types to use, how to structure verifications, and what edge cases matter for your app. The more you use it, the less iteration you need.
Keep test steps focused
Keep test steps focused
Each test should validate one flow. Avoid combining multiple scenarios into a single test — it makes failures harder to diagnose and steps harder to maintain.
Use the feedback loop
Use the feedback loop
The most efficient workflow is: generate, create, run, analyze failure, fix steps, run again. Claude can drive this entire loop, only pausing for your approval before running tests.
