### Conditional step examples Source: https://docs.spurtest.com/getting-started/mobile-prompting Examples of conditional steps for common popups. These show how to decline email list and Bluetooth prompts. ```text If "Join our email list" is displayed, tap "No, thank you". Otherwise, skip this step. ``` ```text If "Turn On Bluetooth" is displayed, tap "Not now". Otherwise, skip this step. ``` -------------------------------- ### Recommended test starting template Source: https://docs.spurtest.com/getting-started/mobile-prompting Starting steps for most mobile tests to establish a consistent app state: wait for load, handle login, and verify sign-in. ```text Wait for the app to load If already logged in, skip this step. Otherwise, enter "user@email.com" as email and "Password1" as password and tap Continue Verify that the user is signed in ``` -------------------------------- ### Navigation reliability example Source: https://docs.spurtest.com/getting-started/mobile-prompting Example of a navigate step that includes a wait for the target screen, ensuring screenshots are captured after transition. ```text navigate to the Settings screen and wait for "Settings" to be displayed ``` -------------------------------- ### Example test steps output Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example structured test steps generated by Claude for a search modal test case. ```text Test: Search term clears on modal close 1. Navigate to the homepage 2. Click the search icon to open the search modal 3. Type "jacket" in the search field 4. Verify search results appear 5. Close the search modal 6. Reopen the search modal 7. Verify the search field is empty ``` -------------------------------- ### Prompt: Create test in Checkout suite Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example prompt to create a test in the Checkout suite using the staging URL key. ```text "Create this test in the Checkout suite using the staging URL key" ``` -------------------------------- ### Cursor MCP Install Deep Link Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Use this deep link to install the Spur MCP server in Cursor. Paste it into your browser address bar or click the install button. ```text cursor://anysphere.cursor-deeplink/mcp/install?name=Spur&config=eyJ1cmwiOiJodHRwczovL2FwcC5zcHVydGVzdC5jb20vYXBpL21jcCIsImhlYWRlcnMiOnt9fQ%3D%3D ``` -------------------------------- ### Prompt: Run test on staging Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example prompt to run a test on staging via the Spur MCP. ```text "Run the search modal test on staging" ``` -------------------------------- ### Example product_detail event payload Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Example JSON payload for a product view event, showing fields like event_name, product_id, product_name, price, currency, category, brand, color, size, and in_stock. ```json { "event_name": "product_detail", "product_id": "ABC-12345", "product_name": "Classic Oxford Shirt", "price": 68.00, "currency": "USD", "category": "Men > Shirts", "brand": "Main Brand", "color": "Blue", "size": "M", "in_stock": true } ``` -------------------------------- ### Get a full overview of a run Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Prompt Claude for a detailed run breakdown. Claude calls `get_test_plan_run_overview`, listing failures first with reasons and including a `task_id` for each failure. ```text "Give me a full breakdown of run 107272" ``` -------------------------------- ### Prompt: Update test step Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example prompt to update an existing test step. ```text "Update that test — change step 3 to click the 'Add to cart' button instead" ``` -------------------------------- ### Expect Toast Example Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/mobile/expect-toast Use this step to assert that a toast appears after a triggering action. The step passes if the toast appears and fails if it does not. The triggering action should be the step immediately before this one. ```text Tap the "Save" button Expect toast "Changes saved" ``` -------------------------------- ### Expect No Toast Example Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/mobile/expect-toast Use this step to assert that a toast does not appear after a triggering action. The step passes if the toast does not appear and fails if it does. The triggering action should be the step immediately before this one. ```text Submit the form with an invalid email Expect no toast "Profile updated" ``` -------------------------------- ### Multiple Assertions in a Single Verify Step Source: https://docs.spurtest.com/getting-started/web-prompting Use this example to combine multiple related assertions into one verify step. The agent checks all conditions against the same page state. ```text Verify that the product name is "Running Shoes", the price is displayed, and the "Add to Cart" button is visible ``` -------------------------------- ### GET /me with saved token Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Makes a GET request to /me, using the token from the saved response 'loginResponse' in the Authorization header. Expects a 200 status. ```text Make an API Call Method: GET URL: https://api.example.com/me Headers: Authorization = Bearer {{loginResponse.token}} Expect Status: 200 ``` -------------------------------- ### Deep Link Test Example Source: https://docs.spurtest.com/additional-resources/deep-links Example of a Spur test that uses a deep link to navigate directly to a product collection page. The deep link is triggered via a JavaScript injection step with the [Deeplink] label, using the URI scheme myapp:// and the path collections/womens-shop-all. Always add a wait or verify step after the deep link to allow the app to load the target screen. ```text Wait for the app to load If "Sign In" is displayed, tap Sign In and log in. Otherwise, skip this step. Navigate to the home page Cached Action: [Deeplink] {{ window.location = 'myapp://collections/womens-shop-all'; }} Wait 2 seconds Verify that "Women's Shop All" is displayed ``` -------------------------------- ### Example test-mapping.yaml Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing YAML mapping file linking code paths to Spur test IDs. Used to identify which tests to run when specific code changes. ```yaml # test-mapping.yaml homepage: paths: ["src/components/Home/**", "src/pages/index.*"] spur_tests: ["test_id_1", "test_id_2"] cart: paths: ["src/components/Cart/**", "src/context/CartContext.*"] spur_tests: ["test_id_3", "test_id_4", "test_id_5"] search: paths: ["src/components/Search/**"] spur_tests: ["test_id_6", "test_id_7"] ``` -------------------------------- ### Prompt: Generate test cases for PR #247 Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example prompt to feed Claude Code a PR description and request test case generation. ```text "Here's PR #247 — it updates the search modal to clear the search term on close. Can you generate test cases for this?" ``` -------------------------------- ### Combine form actions into a single step Source: https://docs.spurtest.com/getting-started/web-prompting Use this pattern to fill multiple fields on the same form in one action step, which speeds up test execution. The example shows entering first name, last name, and email in a single instruction. ```text Enter "John" in the First Name field, "Doe" in the Last Name field, and "john.doe@example.com" in the Email field ``` -------------------------------- ### Example test structure for product_detail validation Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams A numbered list of steps for a Spur test that navigates to a product detail page and uses Log steps to validate the product_detail event payload, checking required fields and data types. ```text 1. Navigate to a product detail page 2. Verify the product page loaded (UI check) 3. Log Confirm the product_detail event fired 4. Log Confirm product_detail contains product_id as a non-empty string 5. Log Confirm product_detail contains price as a number greater than 0 6. Log Confirm product_detail contains product_name, category, and brand ``` -------------------------------- ### Trigger a run Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Prompt Claude to run a specific test plan. Claude calls `run_test_plan` with the plan ID, queues the run, and confirms it has started. ```text "Run the Nightly Regression plan" ``` -------------------------------- ### Add Spur MCP server to Gemini CLI Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Run this command to add Spur to your user configuration. After adding, start Gemini CLI, run /mcp auth spur, and complete the OAuth flow in your browser. ```bash gemini mcp add --transport http --scope user spur https://app.spurtest.com/api/mcp ``` -------------------------------- ### Prompt: Prioritize test areas Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Example prompt asking Claude to identify highest-priority areas of the app for test coverage. ```text "What are the highest-priority areas of our app that need test coverage? Focus on cart, checkout, and navigation." ``` -------------------------------- ### API Call: fetch and save payload Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Makes a GET request to https://api.example.com/inbox, expects status 200, and saves the response as inboxData. ```text Make an API Call Method: GET URL: https://api.example.com/inbox Expect Status: 200 Save Response To: inboxData ``` -------------------------------- ### Dismiss popups and modals - text step Source: https://docs.spurtest.com/getting-started/web-prompting Use this plain-language step as the first action in a test to close any popups, cookie banners, or modals that appear on load, ensuring a clean starting state. ```text Close all pop-ups and modals ``` -------------------------------- ### Update a test plan prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to add a suite to an existing plan. Claude calls list_test_plans with the plan_id to get the current configuration, shows the change, and asks for approval before calling update_test_plan. The full new suite list replaces the existing one. ```text "Add the Search suite to the Nightly Regression plan" ``` -------------------------------- ### POST https://app.spurtest.com/api/run_test_plan Source: https://docs.spurtest.com/running-tests/CICD Trigger a single test plan by ID, for example to run a specific regression suite as part of a deployment pipeline. ```APIDOC ## [POST] https://app.spurtest.com/api/run_test_plan ### Description Trigger a single test plan by ID, for example to run a specific regression suite as part of a deployment pipeline. ### Method POST ### Endpoint https://app.spurtest.com/api/run_test_plan ### Headers - **Authorization** (string) - Required - Your authorization token. - **Content-Type** (string) - Required - Must be `application/json`. ### Request Body - **test_plan_id** (integer) - Required - Must be a JSON number, not a string. - **request_id** (string) - Required - Non-empty string used as the workflow or run request ID. - **override_urls** (object) - Optional - If present, must be a JSON object. Any other type (such as a string or array) is rejected. See Override URLs for configuration details. ### Request Example ```bash curl -X POST https://app.spurtest.com/api/run_test_plan \ -H "Authorization: " \ -H "Content-Type: application/json" \ -d '{ "test_plan_id": 789, "request_id": "550e8400-e29b-41d4-a716-446655440000", "override_urls": { "domains": { "staging.example.com": "https://preview-abc.example.com" }, "default": "https://staging.example.com" } }' ``` ### Response No response schema is documented in the source. ``` -------------------------------- ### API Call: use emailMsgId downstream Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Makes a GET request to https://api.example.com/messages/{{emailMsgId}}, expecting status 200, using the extracted value. ```text Make an API Call Method: GET URL: https://api.example.com/messages/{{emailMsgId}} Expect Status: 200 ``` -------------------------------- ### JavaScript action example: navigation, API call, and DOM manipulation Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/javascript Use this JavaScript code to navigate to a new page, refresh the current page, make an API call, and manipulate the DOM. Every JavaScript step must include a return statement; otherwise, the step completes silently and later steps that depend on the data will fail. ```javascript // Navigate to a new page window.location = "https://example.com" // Refresh the current page window.location.reload() // Make an API call const response = await fetch('https://api.example.com/data', { method: 'GET', headers: { 'Content-Type': 'application/json' } }); const data = await response.json(); // Manipulate DOM elements document.querySelector('.my-element').click() ``` -------------------------------- ### Access extracted variables in JavaScript with window.env or env Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/extract Shows how to reference an extracted variable in a JavaScript step using either `window.env.variable_name` or `env.variable_name`. For example, a variable named `Email_address` is accessed as `window.env.Email_address` or `env.Email_address`. ```javascript // Access an extracted variable window.env.variable_name // or env.variable_name ``` -------------------------------- ### Log step to validate product_detail event Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Plain-language Log step instructing the agent to confirm the product_detail event fired and contains product_id, product_name, and price as a number. ```text Log Confirm the product_detail event fired and contains product_id, product_name, and price as a number ``` -------------------------------- ### Create a new test plan prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to create a new test plan. Claude resolves suite and environment names to IDs via list_suites and list_environments, shows a summary, and waits for approval before calling create_test_plan. ```text "Create a test plan called 'Nightly Regression' with the Checkout and Cart suites on Staging" ``` -------------------------------- ### Discover test plans Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Prompt Claude to list all test plans. Claude calls `list_test_plans` and returns a list with plan IDs, suite counts, environment names, and last run time. ```text "What test plans do we have?" ``` -------------------------------- ### Default desktop user agent string Source: https://docs.spurtest.com/authoring-tests/test-side-peek/viewports The default user agent string for desktop viewport presets. Used when the desktop viewport is enabled without a custom user agent. ```text Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 ``` -------------------------------- ### Launch specific test plan with curl Source: https://docs.spurtest.com/running-tests/CICD Launch a specific test plan by ID using the run_test_plan endpoint. Requires an authorization token and a JSON body with test_plan_id (must be a number, not a string) and request_id. The override_urls object is optional and must be a JSON object. ```bash curl -X POST https://app.spurtest.com/api/run_test_plan \ -H "Authorization: " \ -H "Content-Type: application/json" \ -d '{ "test_plan_id": 789, "request_id": "550e8400-e29b-41d4-a716-446655440000", "override_urls": { "domains": { "staging.example.com": "https://preview-abc.example.com" }, "default": "https://staging.example.com" } }' ``` -------------------------------- ### Add and login to Spur MCP server with Codex Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Run these commands in your terminal to configure the Spur MCP server for Codex CLI and the Codex IDE extension. Complete the OAuth flow in your browser, then verify with 'codex mcp list' or /mcp in a Codex session. ```bash codex mcp add spur --url https://app.spurtest.com/api/mcp codex mcp login spur ``` -------------------------------- ### Combine domains and default options Source: https://docs.spurtest.com/running-tests/cicd/override-urls Combine domains and default options. Spur checks domains first and falls back to default, so tests targeting api-staging.myapp.com use the API-specific override while all other environments use the Vercel preview URL. ```json { "override_urls": { "domains": { "api-staging.myapp.com": "https://api-pr-42.myapp.com" }, "default": "https://my-app-pr-42.vercel.app" } } ``` -------------------------------- ### Conditional step format Source: https://docs.spurtest.com/getting-started/mobile-prompting Format for conditional steps that handle popups or optional UI. Use 'If is displayed, do . Otherwise, skip this step.' ```text If is displayed, do . Otherwise, skip this step. ``` -------------------------------- ### Configure override_urls with domains Source: https://docs.spurtest.com/running-tests/cicd/override-urls Use the domains option to override specific environments by matching domain keys. Keys can be bare hostnames or full origins with scheme, and must match the environment's configured domain exactly, including the www. prefix if present. ```json { "override_urls": { "domains": { "staging.myapp.com": "https://my-app-pr-42.vercel.app", "api-staging.myapp.com": "https://api-pr-42.myapp.com" } } } ``` -------------------------------- ### POST reset account with environment secret Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Makes a POST request to reset the test account, using an environment secret for the X-Api-Key header. Expects status 200 or 204. ```text Make an API Call Method: POST URL: https://api.example.com/test/reset-account Headers: X-Api-Key (environment secret — resolved automatically) Expect Status: 200, 204 ``` -------------------------------- ### Override multiple domains with separate preview deploys Source: https://docs.spurtest.com/running-tests/cicd/override-urls Override multiple domains individually, useful when test plans run against both frontend and API preview deployments. ```json { "override_urls": { "domains": { "app.mysite.com": "https://app-pr-99.mysite.dev", "api.mysite.com": "https://api-pr-99.mysite.dev" } } } ``` -------------------------------- ### Add Spur to Zed context_servers Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Add the spur entry to the existing context_servers object in your Zed settings file. Save the file and complete the OAuth flow in your browser. ```json { "context_servers": { "spur": { "url": "https://app.spurtest.com/api/mcp" } } } ``` -------------------------------- ### Triage all failures prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to list all failures from the latest run. Claude calls list_test_plans to find the plan, get_test_plan_runs to find the most recent run ID, then get_test_plan_run_overview to list every failure with its reason. ```text "What failed in the latest regression run?" ``` -------------------------------- ### Configure override_urls with default Source: https://docs.spurtest.com/running-tests/cicd/override-urls Use the default option to redirect all tests to a single URL regardless of the configured environment. This is the simplest option for single-environment test plans. ```json { "override_urls": { "default": "https://my-app-pr-42.vercel.app" } } ``` -------------------------------- ### Login and Dismiss Popup Source: https://docs.spurtest.com/getting-started/mobile-prompting Use this template to handle login and dismiss a popup in a mobile test. It waits for the app to load, optionally dismisses an email list popup, logs in if needed, and verifies the home screen is displayed. ```text Wait for the app to load If "Join our email list" is displayed, tap "No, thank you". Otherwise, skip this step. If already logged in, skip this step. Otherwise, enter "user@example.com" as email and "Password1!" as password and tap Continue Verify that "Home" is displayed ``` -------------------------------- ### Deep-dive into a specific failure prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to investigate a specific failure. Claude takes the task_id from the failed test in the plan overview and calls get_test_run_overview, get_test_run_screenshots, and get_test_run_console_logs to build a full picture of why it failed. ```text "Look into the checkout failure from that run" ``` -------------------------------- ### Completing a Flow Source: https://docs.spurtest.com/getting-started/prompt-library/high-level-instructions High-level prompt for creating and publishing a page, letting the agent determine the steps. Includes a verification point to confirm the Share button appears. ```text Create a new Page. You may have to scroll to find the entry point button. Enter random, valid values to fill out a new Page. Continue until you can publish the page. Once you have finished, publishing and all, Verify you can see a Share button on your new page. ``` -------------------------------- ### Search and Add to Cart Source: https://docs.spurtest.com/getting-started/mobile-prompting Use this template to search for an item, add it to the cart, and verify the cart count. It waits for the app to load, types a query, taps the first result, adds to cart, and checks the cart icon. ```text Wait for the app to load Type "KALLAX" into the search bar Tap the first result Tap "Add to cart" and wait for "Added" to be displayed Verify that the cart icon shows "1" item ``` -------------------------------- ### Apache: Require Spur IPs Source: https://docs.spurtest.com/additional-resources/ip-whitelisting Add these directives inside your `` or `` block to allow Spur's IP addresses. Replace `` and `` with the actual IPs provided by the Spur team. Reload your web server after making changes. ```apache Require ip Require ip # Add all IPs provided by the Spur team ``` -------------------------------- ### Dismiss Popups and Search - text template Source: https://docs.spurtest.com/getting-started/web-prompting Copy-and-paste template for a common web testing flow: dismiss popups, perform a search, and verify the product detail page. ```text Close all pop-ups and modals Click the search field at the top right of the page In the search field, enter "Running Shoes" Verify that search results are displayed Click the first product in the results Verify that the product detail page is displayed ``` -------------------------------- ### Default mobile user agent string Source: https://docs.spurtest.com/authoring-tests/test-side-peek/viewports The default user agent string for mobile viewport presets. Used when the mobile viewport is enabled without a custom user agent. ```text Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1 ``` -------------------------------- ### Investigate individual failures Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Prompt Claude to dig into a specific failure. Claude uses `get_test_run_overview` and `get_test_run_screenshots` with the `task_id` to provide step-level details and visual context. ```text "Dig into the cart failure — is it a product bug or a test issue?" ``` -------------------------------- ### POST login and save token Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Makes a POST request to authenticate and saves the response to the variable 'loginResponse'. The body uses the template variable '{{password}}' for the password. Expects a 200 status. ```text Make an API Call Method: POST URL: https://api.example.com/auth/login Body: { "email": "qa@example.com", "password": "{{password}}" } Expect Status: 200 Save Response To: loginResponse ``` -------------------------------- ### Add Spur to Windsurf mcp_config.json Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Add the spur entry to the existing mcpServers object in the raw mcp_config.json file. Save the file, connect to Spur, and complete the OAuth flow in your browser. ```json { "mcpServers": { "spur": { "serverUrl": "https://app.spurtest.com/api/mcp" } } } ``` -------------------------------- ### Return value stored as emailMsgId Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call The returned value from the JavaScript step, stored as emailMsgId. ```text "jzkrokxcnttvn16-1781018899-09738591515" ``` -------------------------------- ### Override URL with a path prefix Source: https://docs.spurtest.com/running-tests/cicd/override-urls Override the default URL when the preview environment serves the app under a subpath like /preview/pr-42/. ```json { "override_urls": { "default": "https://preview.myapp.com/preview/pr-42" } } ``` -------------------------------- ### Trigger a regression run prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to run a test plan and wait for results. Claude calls run_test_plan with the plan ID (discovered via list_test_plans) and polls get_test_plan_runs to monitor progress. ```text "Run the Regression test plan and let me know when it finishes" ``` -------------------------------- ### Workflow diagram (Mermaid) Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-in-sprint-testing Mermaid graph showing the end-to-end workflow from PR/ticket to test creation, running, and iteration on failures. ```mermaid graph LR A[PR or Ticket] --> B[Claude analyzes code context] B --> C[Generate test steps] C --> D[Create test in Spur] D --> E[Run test] E --> F{Pass?} F -->|Yes| G[Done] F -->|No| H[Analyze failure] H --> C ``` -------------------------------- ### User Demographic Persona Prompt Source: https://docs.spurtest.com/getting-started/prompt-library/persona-based-tests Simulates a user with poor eyesight and limited computer familiarity to test accessibility. The prompt instructs the agent to attempt to add an item to the cart and note any friction points. ```text You are a user with poor eyesight that makes screens hard to read. Computers feel unfamiliar - you know email basics but struggle with small text and confusing layouts. You often need help but are determined to stay connected. Attempt to add an item to your cart. Note any points of friction or difficulties specific to your situation. ``` -------------------------------- ### Override default URL for a Vercel preview deploy Source: https://docs.spurtest.com/running-tests/cicd/override-urls Override the default base URL to point to a preview deploy, e.g., for a PR. Tests that target the staging URL now hit the preview URL. ```json { "override_urls": { "default": "https://my-app-git-feature-login.vercel.app" } } ``` -------------------------------- ### Full triage loop prompt Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Use this prompt to have Claude work through every failed test from the last regression run. Claude iterates over each task_id from the plan overview, pulls artifacts, and returns a triage summary distinguishing test issues from product regressions. ```text "Go through each failed test from the last regression run and tell me whether it looks like a product bug or a test issue" ``` -------------------------------- ### Security Exploration Prompt Source: https://docs.spurtest.com/getting-started/prompt-library/exploratory-tests Use this prompt to instruct the agent to act as a white-hat hacker and explore your site for vulnerabilities. It sets a persona and gives free rein to test for security flaws. ```text You're a skilled white-hat hacker with a deep understanding of web technologies, authentication flows, and common vulnerabilities like XSS, SQL injection, and CSRF. You methodically test websites for flaws in logic, configuration, and code, using tools and manual techniques to uncover hidden risks. With a strong grasp of HTTP, JavaScript, and browser behavior, you think like an attacker but act to protect, helping developers patch weaknesses before they become threats. Continuously scroll through and act as you would, trying to break and find any vulnerabilities. Note any issues, and continue to do so for a while. Scroll if it seems clicking something doesn't do anything. ``` -------------------------------- ### Fetch API data in JavaScript step Source: https://docs.spurtest.com/getting-started/web-prompting Use a JavaScript step with a fetch request for API calls such as seeding test data, resetting state, or verifying backend responses. The action agent cannot interact with the browser directly, so this is a fallback when standard action or browser action steps cannot achieve the needed interaction. ```javascript const response = await fetch("https://api.example.com/orders/12345", { method: "GET", headers: { "Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json" } }); const data = await response.json(); return data; ``` -------------------------------- ### Generate a random email in a Type step Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/extract Natural-language instruction for a Type step that generates a unique email address. Spur produces a random email like `abcdefghij1@testdomain.com` on each run; add an Extract step afterward to save it as a variable for reuse. ```plaintext Type a random email address using a string of 10 random letters and a number that always increments by 1 with the domain of @testdomain.com ``` -------------------------------- ### Add Spur MCP server to Claude Code Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Run this command in your terminal to add the Spur MCP server to Claude Code. After running, open Claude Code, run /mcp, and complete the OAuth flow. ```bash claude mcp add --transport http Spur https://app.spurtest.com/api/mcp ``` -------------------------------- ### Responding to Messages Source: https://docs.spurtest.com/getting-started/prompt-library/high-level-instructions Prompt for autonomous multi-turn conversation handling, with a time limit of 15 minutes. Leverages natural language understanding without specifying UI elements. ```text Once a message appears in your inbox, send a reply. Everytime you receive a reply, send another message to carry the conversation on. Continue the conversation for up to 15 minutes. ``` -------------------------------- ### Nginx: Allow Spur IPs Source: https://docs.spurtest.com/additional-resources/ip-whitelisting Add these directives inside your `server` or `location` block to allow Spur's IP addresses. Replace `` and `` with the actual IPs provided by the Spur team. Reload your web server after making changes. ```nginx allow ; allow ; # Add all IPs provided by the Spur team ``` -------------------------------- ### Check run history Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Prompt Claude to show recent runs for a plan. Claude calls `get_test_plan_runs` and returns a table of run IDs, timestamps, and pass/fail/error counts. ```text "Show me the last 5 runs for that plan" ``` -------------------------------- ### Run Spur Tests with Override URLs Source: https://docs.spurtest.com/running-tests/cicd/github Use this YAML step in a GitHub Actions workflow to trigger Spur tests with a runtime override URL, such as a Vercel preview deploy. It sends a POST request to the Spur webhook with your API key and the preview URL from the deploy step. The override_urls parameter redirects tests without changing environment settings. ```yaml - name: Run Spur Tests run: | curl -X POST \ -H "Content-Type: application/json" \ -H "SPUR_GITHUB_KEY: ${{ secrets.SPUR_API_KEY }}" \ -d "{\"override_urls\": {\"default\": \"${{ steps.deploy.outputs.preview_url }}\"}}" \ "https://app.spurtest.com/api/webhook" ``` -------------------------------- ### Add to Cart and Checkout - text template Source: https://docs.spurtest.com/getting-started/web-prompting Copy-and-paste template for adding a product to the cart, verifying the cart, and proceeding to checkout. ```text Close all pop-ups and modals Click the first product on the page Verify that the product detail page is displayed Click the "Add to Cart" button Verify that the cart icon shows 1 item Click the cart icon in the top right Verify that the cart page displays the correct product Click "Proceed to Checkout" Verify that the checkout page is displayed ``` -------------------------------- ### Scroll to the footer of the page Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/actions/scroll Use this command to scroll directly to the footer or header of a page. ```text Scroll down to the footer of the page ``` -------------------------------- ### Scroll until an element is visible Source: https://docs.spurtest.com/getting-started/web-prompting Use this pattern to scroll until a specific element becomes visible. This is useful when the element's position is not fixed, and it improves test stability. ```text Scroll down until the "Submit" button is visible ``` -------------------------------- ### Scroll until the favorites section is visible Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/actions/scroll Use this command to scroll until a specific element comes into view. Useful when you need to reach a section but don't know exactly how far to scroll. ```text Scroll down until the "favorites" section is visible ``` -------------------------------- ### Affiliate and UTM Parameter Validation Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Confirms the request URL to the affiliate endpoint contains utm_source, utm_medium, and utm_campaign parameters. ```plaintext Log Confirm the request URL to the affiliate endpoint contains utm_source, utm_medium, and utm_campaign parameters ``` -------------------------------- ### POST https://app.spurtest.com/api/webhook Source: https://docs.spurtest.com/running-tests/CICD Trigger Spur test plans via a webhook. Useful for CI/CD providers other than GitHub or GitLab, or for more control over when tests are triggered. ```APIDOC ## [POST] https://app.spurtest.com/api/webhook ### Description Trigger Spur test plans via a webhook. Useful for CI/CD providers other than GitHub or GitLab, or for more control over when tests are triggered. ### Method POST ### Endpoint https://app.spurtest.com/api/webhook ### Headers - **Content-Type** (string) - Required - Must be `application/json`. - **SPUR_GITHUB_KEY** (string) - Required - Your API key, found on the GitHub Integration Settings page in Spur. ### Request Body - **override_urls** (object) - Optional - Redirect tests to a different URL (e.g., a deploy preview). See Override URLs for full configuration options. ### Request Example ```bash curl -X POST \ -H "Content-Type: application/json" \ -H "SPUR_GITHUB_KEY: " \ -d '{ "override_urls": { "default": "https://my-app-pr-42.vercel.app" } }' \ "https://app.spurtest.com/api/webhook" ``` ### Response No response schema is documented in the source. ``` -------------------------------- ### @-mention trigger with extra context Source: https://docs.spurtest.com/running-tests/cicd/github-agent Use this comment to re-trigger Spur with extra context via an @-mention. The entire comment is passed as context, so instructions before the trigger are included. ```text @spur re-trigger the tests, but let's log in as an admin user instead. ``` -------------------------------- ### Manual tracking QA workflow diagram (Mermaid) Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Mermaid diagram illustrating the typical manual process of validating analytics events using Chrome DevTools, from opening DevTools to filing a ticket. Highlights the repetitive and error-prone steps that Spur automates. ```mermaid graph TD A["Open Chrome DevTools"] --> B["Navigate to page / complete flow"] B --> C["Search console or network tab for events"] C --> D["Manually inspect each payload field"] D --> E["Screenshot as evidence"] E --> F["Cross-reference with analytics platform"] F --> G["Repeat for every region, brand, browser, environment"] G --> H["File a ticket if something is wrong"] style A fill:#fee,stroke:#c33 style G fill:#fee,stroke:#c33 ``` -------------------------------- ### Scroll to a section Source: https://docs.spurtest.com/getting-started/web-prompting Use this pattern to scroll to a specific section of the page when the target element is off-screen. The agent only interacts with visible elements, so an explicit scroll step is needed. ```text Scroll down to the "Reviews" section ``` -------------------------------- ### /-prefixed trigger with extra context Source: https://docs.spurtest.com/running-tests/cicd/github-agent Use this comment to re-trigger Spur with extra context using a /-prefixed trigger, which avoids sending a GitHub notification to the bot account. ```text /spurtest re-run against the new preview, log in as admin. ``` -------------------------------- ### Run Spur MCP via mcp-remote for other clients Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-setup Use this command for MCP clients that only support local command-based servers. It uses mcp-remote to connect to the remote Spur MCP server. ```bash npx -y mcp-remote@latest https://app.spurtest.com/api/mcp ``` -------------------------------- ### Trigger Spur webhook with curl Source: https://docs.spurtest.com/running-tests/CICD Trigger Spur test plans via the webhook endpoint. Requires your API key from the GitHub Integration Settings page. The override_urls body is optional; include it to redirect tests to a different URL such as a deploy preview. ```bash curl -X POST \ -H "Content-Type: application/json" \ -H "SPUR_GITHUB_KEY: " \ -d '{ "override_urls": { "default": "https://my-app-pr-42.vercel.app" } }' \ "https://app.spurtest.com/api/webhook" ``` -------------------------------- ### UI/UX Tester Persona Prompt Source: https://docs.spurtest.com/getting-started/prompt-library/persona-based-tests Gives the agent a design-focused persona to audit the interface for design flaws and usability issues. The prompt instructs the agent to scroll through the page and note any issues, nitpicks, and inconsistencies. ```text You're a sharp-eyed UI/UX tester who instinctively spots design flaws and usability issues. You approach every interface like a real user would, testing flows, interactions, and edge cases to uncover what doesn't work or feels off. Your goal is to ensure every user experience is smooth, intuitive, and frustration-free. Continuously scroll through the page until you reach the footer. Note any issues, nitpicks, and inconsistencies. Point out even small things. ``` -------------------------------- ### Extract order number after clicking dropdown Source: https://docs.spurtest.com/getting-started/web-prompting Use this extract step after performing any required interactions (e.g., clicking a dropdown) to ensure the target data is visible. The agent cannot capture content hidden in HTML, JavaScript variables, below the fold, or behind unperformed interactions. ```text Step 1: Click on the order details dropdown Step 2: Extract the order number as "order_id" ``` -------------------------------- ### Chatbot Conversation Prompt Source: https://docs.spurtest.com/getting-started/prompt-library/other-useful-prompts Use this prompt to simulate a human-like two-way conversation with a chatbot, waiting 30 seconds for each bot response. It validates that the bot's replies are sensible, polite, professional, and helpful. ```text Initiate a 2 way chat conversation simulating a human, ask questions wait for the bot to respond, continue to ask question (Always wait 30 secs for bot response). Verify that the responses from the bot makes sense, that it is polite, professional, and helpful. ``` -------------------------------- ### Deep link JavaScript injection Source: https://docs.spurtest.com/getting-started/mobile-prompting Use this Cached Action with [Deeplink] label to trigger a deep link via JavaScript injection. Follow with a wait or verify step to allow the target screen to load. ```text Cached Action: [Deeplink] {{ window.location = 'yourapp://path/to/screen'; }} ``` -------------------------------- ### Form Submission - text template Source: https://docs.spurtest.com/getting-started/web-prompting Copy-and-paste template for filling out a form with name and email fields, selecting a country, submitting, and verifying the confirmation message. ```text Close all pop-ups and modals Enter "John" in the First Name field, "Doe" in the Last Name field, and "john@example.com" in the Email field Select "United States" from the Country dropdown Click the Submit button Verify that the confirmation message is displayed ``` -------------------------------- ### Scroll up in the chat history Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/actions/scroll Use this natural language command to scroll within a scrollable container, such as a chat history. First hover on the container, then scroll, or describe the inner scroll directly. ```text Scroll up in the chat history to view the results ``` -------------------------------- ### Full triage loop Mermaid diagram Source: https://docs.spurtest.com/analysing-tests/mcp/spur-mcp-test-plans Mermaid diagram showing the complete triage workflow: run_test_plan, get_test_plan_runs, get_test_plan_run_overview, then per-task get_test_run_overview, screenshots, logs, and root cause. ```mermaid graph LR A[run_test_plan] --> B[get_test_plan_runs] B --> C[get_test_plan_run_overview] C --> D[Failures list with task_ids] D --> E[get_test_run_overview per task] E --> F[Screenshots / Logs] F --> G[Root cause] ``` -------------------------------- ### JavaScript: parse inboxData and return email id Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/api-call Parses window.env.inboxData, filters for the newest message with subject containing 'account activation', and returns its id. Throws an error if no match, which fails the step. ```javascript const inbox = JSON.parse(window.env.inboxData); const m = (inbox.messages || []) .filter(x => (x.subject || '').toLowerCase().includes('account activation')) .sort((a, b) => b.time - a.time)[0]; if (!m) throw new Error('No matching email'); return m.id; ``` -------------------------------- ### Type password into field Source: https://docs.spurtest.com/authoring-tests/test-side-peek/step-types/variables/encrypted-variables Shows a plaintext test step where a secret value is typed directly into a field, exposing sensitive information in the test definition, results page, and shared test results. ```plaintext Type "my-secret-password" into the password field ``` -------------------------------- ### Analytics Event Validation Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Confirms the purchase event contains order_id, revenue as a number, and items as an array with at least one entry. ```plaintext Log Confirm the purchase event contains order_id, revenue as a number, and items as an array with at least one entry ``` -------------------------------- ### Data Layer Validation Source: https://docs.spurtest.com/additional-resources/spur-for-data-science-teams Confirms the data layer contains user_segment and page_type with non-empty values. ```plaintext Log Confirm the data layer contains user_segment and page_type with non-empty values ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.