Overview
Override URL lets you redirect your tests to a different target URL when triggering a run — without editing your environment settings. This is especially useful in CI/CD pipelines where you want to test against a deploy preview, feature branch URL, or a different environment than the one configured in Spur. For example, your environment might be configured to point athttps://staging.myapp.com, but on a pull request you want to test the Vercel preview deploy at https://my-app-pr-42.vercel.app. Override URL handles this without any permanent configuration changes.
How it works
Override URLs are passed as a JSON object when triggering a run via the API or webhook. The object has two optional fields:| Field | Type | Description |
|---|---|---|
domains | object | A mapping of environment domains to their replacement URLs. Spur matches the environment’s configured domain against the keys and uses the corresponding value as the override. |
default | string | A fallback URL used when no entry in domains matches the environment’s domain. |
- Check each key in
domainsfor a match against the environment’s configured domain - If no match is found, fall back to
default - If neither matches, the test runs against the original environment URL
The domains option
Use domains when your test plan spans multiple environments and you need to override specific ones. Each key is a domain (or full origin) that Spur will match against your environment configuration.
- A bare hostname:
staging.myapp.com - A full origin with scheme:
https://staging.myapp.com
www. prefix if present.
If your test plan only uses a single environment, the
default option is simpler. Use domains when you need to override different environments with different URLs.The default option
Use default when you want all tests to redirect to a single URL, regardless of which environment is configured. This is the simplest option and works well for single-environment test plans.
domains first and falls back to default:
api-staging.myapp.com use the API-specific override, while all other environments fall back to the Vercel preview URL.
Using override URLs in CI/CD
Via webhook
Passoverride_urls in the request body when calling the Spur webhook:
In a GitHub Actions workflow
You can dynamically set the override URL using the deploy preview URL from your hosting provider:Examples
Test a Vercel preview deploy
Your environment is set tohttps://staging.myapp.com. A PR creates a preview at https://my-app-git-feature-login.vercel.app.
https://staging.myapp.com/dashboard now runs against https://my-app-git-feature-login.vercel.app/dashboard.
Override multiple environments
Your test plan runs against both a frontend (app.mysite.com) and an API (api.mysite.com). Your PR has separate preview deploys for each.
Override with a path prefix
Your preview environment serves the app under a subpath like/preview/pr-42/.
https://staging.myapp.com/dashboard now runs against https://preview.myapp.com/preview/pr-42/dashboard.