> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spurtest.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Spur is an AI-powered QA engineer that lets teams create and run automated end-to-end tests for web and mobile apps using natural language.
> When answering questions about Spur, cite the relevant page from docs.spurtest.com.

# Common Pitfalls When Writing Tests in Spur

> Avoid these common authoring mistakes to ensure your tests run reliably and clearly communicate intent.

<AccordionGroup>
  <Accordion title="1. Mixing Actions Inside “Verify” Steps">
    **What happens:**\
    Tests become semantically unclear or are misinterpreted.

    **Bad example:**

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at11.01.54AM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=e5c7db29dbea4d44789bc33f3bbaa564" alt="Screenshot2025 07 05at11 01 54AM Pn" width="1524" height="146" data-path="images/Screenshot2025-07-05at11.01.54AM.png" />

    **Good example:**

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at10.53.16AM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=d35962ab1fd95fa6c4cd9a288f0713ec" alt="Screenshot2025 07 05at10 53 16AM Pn" width="1524" height="240" data-path="images/Screenshot2025-07-05at10.53.16AM.png" />

    **Rule of thumb:**

    * **Actions** = things the test *does* (e.g., click, scroll)
    * **Verifications** = things the test *checks* (e.g., visible, present)

    Keep them in separate steps.
  </Accordion>

  <Accordion title="2. Non-Scenario Table Tests in Scenario Table Test Suite">
    **What happens:**\
    Static tests placed inside a scenario table suite will execute once per scenario row, potentially causing duplicate confirmations or side effects.

    **Bad example:**

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at12.23.12PM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=9e26a135d9b59cb74960ab1d6597e39c" alt="Screenshot2025 07 05at12 23 12PM Pn" width="2186" height="666" data-path="images/Screenshot2025-07-05at12.23.12PM.png" />

    **Good practice:**\
    Keep tests that do not rely on scenario table variables in a separate test or suite. This prevents static verifications from running multiple times.

    <img src="https://mintcdn.com/spur/M9lHLoA7TzDZQpbJ/images/image.png?fit=max&auto=format&n=M9lHLoA7TzDZQpbJ&q=85&s=43c513db07a46b16e55b110ef243b3b0" alt="image.png" width="2776" height="1410" data-path="images/image.png" />
  </Accordion>

  <Accordion title="3. Using “Go to URL” Inside Test Steps">
    **What happens:**\
    Spur can’t interpret `Go to URL` commands mid-test, causing scripts to fail.

    **Bad example:**

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at11.54.00AM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=7d5b48f9f6dd86fe759d3df91cc77cc3" alt="Screenshot2025 07 05at11 54 00AM Pn" width="1524" height="230" data-path="images/Screenshot2025-07-05at11.54.00AM.png" />

    **Good example:**

    1. Set the **Start URL** in your test’s settings:

           <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at11.54.57AM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=2622e9355d02b3ec22c9f802cf81755a" alt="Screenshot2025 07 05at11 54 57AM Pn" width="1524" height="132" data-path="images/Screenshot2025-07-05at11.54.57AM.png" />
    2. Use actions for in-test navigation:

           <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at11.58.12AM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=e687110bb21f4fc05050e21e59d6774b" alt="Screenshot2025 07 05at11 58 12AM Pn" width="1524" height="228" data-path="images/Screenshot2025-07-05at11.58.12AM.png" />
  </Accordion>

  <Accordion title="4. Tab/Browser Navigations">
    **What happens:**\
    Tests may break or misinterpret intent if you attempt to change tabs or navigate the browser without using supported actions.

    **What to do:**\
    Use browser action steps for any tab or navigation changes. For example:

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at12.03.35PM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=3a3a697c8ad4c64a9d141c916edab9b8" alt="Screenshot2025 07 05at12 03 35PM Pn" width="1524" height="228" data-path="images/Screenshot2025-07-05at12.03.35PM.png" />

    Or set the navigation using [Browser Actions](/authoring-tests/test-side-peek/step-types/browser/open-new-tab).

    <Tip>
      Always use the documented browser actions component for tab switches, window focus, and URL navigations.
    </Tip>
  </Accordion>

  <Accordion title="5. Scrolling">
    **What happens:**\
    The agent only interacts with elements in view unless instructed otherwise. Tests may fail to locate off-screen elements.

    **What to do:**\
    Explicitly include scroll steps before verifications or actions. For example:

    <img src="https://mintcdn.com/spur/qv5cvlrqcbi1P9nN/images/Screenshot2025-07-05at12.09.50PM.png?fit=max&auto=format&n=qv5cvlrqcbi1P9nN&q=85&s=856f762fe0c14793141910b292c62646" alt="Screenshot2025 07 05at12 09 50PM Pn" width="1524" height="228" data-path="images/Screenshot2025-07-05at12.09.50PM.png" />

    The agent will also scroll to find out-of-viewport items, but specifying scrolls improves test stability. See [Supported Actions: Scroll](/authoring-tests/test-side-peek/step-types/actions/scroll).

    <Tip>
      Remember that the agent sees only what a human sees. Include scroll instructions to ensure consistent element visibility.
    </Tip>
  </Accordion>

  <Accordion title="6. Accessing Restricted Domains via Preview Editor">
    **What happens:**\
    Direct navigation to restricted domains (e.g., spurmail.com) may be blocked due to IP restrictions.

    **What to do:**\
    Access these domains through the Preview Editor, which proxies requests and bypasses IP blocks. When you run the test normally, the agent routes via Preview Editor and executes steps successfully.

    <Tip>
      Use the Preview Editor view to interact with spurmail.com. Direct browser access may show a blocked IP error, but tests will pass when executed through Spur Preview.
    </Tip>
  </Accordion>
</AccordionGroup>

## ✅ Authoring Do’s & Don’ts

| ❌ Don’t                                                                    | ✅ Do                                                               |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Mix actions and verifications                                              | Keep actions and checks in separate steps                          |
| Use “Go to URL” mid-test                                                   | Set the start URL in test settings                                 |
| Combine static steps inside scenario loops                                 | Keep tables fully dynamic; extract shared setup                    |
| Attempt tab or browser navigations without <br />browser actions           | Use browser action steps for tab/window <br />navigation           |
| Omit scroll instructions                                                   | Explicitly include scroll steps before <br />actions/verifications |
| Rely on direct navigation to restricted <br />domains (e.g., spurmail.com) | Access via Preview Editor to bypass IP restrictions                |
