Run tests against staging, preview, and other environments
Environments let you run tests and suites against different base URLs — like
staging or preview deployments — without modifying your test configurations.
Once you’ve created environments, a dropdown appears on the Run button
for both individual tests and suites:
Individual tests — Click the Run Test dropdown and select an
environment. The test runs against that environment’s URL instead of the
original.
Suites — Click the play button on a suite row and choose an
environment, or select Default (original URLs) to run with the
original test URLs.
Create separate environments for each deployment target your team uses
(staging, QA, preview branches). Any test or suite can be run against any
environment on demand — no configuration changes needed.
Tokens are key-value pairs passed to your tests as environment-specific
configuration. Common uses include:
API keys that differ between environments
Auth tokens for service-to-service authentication
Feature flags or configuration overrides
Add tokens when creating or editing an environment by clicking Add Token
and entering a key and value.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Decipher AI Docs","colors":{"primary":"#181d27","light":"#a8a8c7","dark":"#181d27"},"logo":{"light":"https://mintcdn.com/decipherai/dLwBqZJ3d9fGHmsO/logo/icon.png?fit=max\u0026auto=format\u0026n=dLwBqZJ3d9fGHmsO\u0026q=85\u0026s=a0154d758fb21dd1f7b340bb04fd7273","dark":"https://mintcdn.com/decipherai/dLwBqZJ3d9fGHmsO/logo/icon.png?fit=max\u0026auto=format\u0026n=dLwBqZJ3d9fGHmsO\u0026q=85\u0026s=a0154d758fb21dd1f7b340bb04fd7273"},"favicon":"https://mintcdn.com/decipherai/dLwBqZJ3d9fGHmsO/logo/icon.png?fit=max\u0026auto=format\u0026n=dLwBqZJ3d9fGHmsO\u0026q=85\u0026s=a0154d758fb21dd1f7b340bb04fd7273","navbar":{"links":[{"href":"mailto:team@getdecipher.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.getdecipher.com"}},"footer":{"socials":{"x":"https://x.com/decipher_ai","github":"https://github.com/decipherai","linkedin":"https://www.linkedin.com/company/decipher-ai"}},"integrations":{"posthog":{"apiKey":"phc_h7LvsgsTESodwr6a8VYnNJzWp4cuVRpqMBV15Mrlp4f","apiHost":"https://o3017525720594717.ingest.getdecipher.com/posthog/7563983771934952"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"decipherai","hasAudioNarration":false,"actualSubdomain":"decipherai","customDomains":["docs.getdecipher.com"],"gitSource":{"type":"github","owner":"decipherai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e613044dd579e9b57135","collectionId":"75003225-8bb7-49b0-9c88-d7d03f62c525","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e613044dd579e9b57135:success","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Testing","count":34},{"language":"default","tag":"Monitoring","count":25},{"language":"default","tag":"API Reference","count":13},{"language":"default","tag":"Managing Tests","count":9},{"language":"default","tag":"Advanced","count":5},{"language":"default","tag":"Local Browser","count":4},{"language":"default","tag":"Behavior","count":3},{"language":"default","tag":"Test Results \u0026 Alerts","count":3},{"language":"default","tag":"Testing Integrations","count":3},{"language":"default","tag":"General","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"pages/features/testing/environments","slug":"/pages/features/testing/environments","pageMetadata":{"title":"Environments","description":"Run tests against staging, preview, and other environments","icon":"globe","href":"/pages/features/testing/environments"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Run tests against staging, preview, and other environments\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Environments let you run tests and suites against different base URLs — like\nstaging or preview deployments — without modifying your test configurations.`}),`\n`,_jsx(Heading,{level:`2`,id:`creating-an-environment`,children:`Creating an Environment`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Go to the `,_jsx(_components.a,{href:`https://app.getdecipher.com/tests`,children:_jsx(_components.strong,{children:`Tests`})}),` page and navigate\nto `,_jsx(_components.strong,{children:`Environments`})]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`New Environment`})]}),`\n`,_jsxs(_components.li,{children:[`Fill in the details:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Name`}),` — A label for this environment (e.g., “Staging”, “Preview”)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`URL`}),` — The base URL (e.g., `,_jsx(_components.code,{children:`https://staging.example.com`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Tokens`}),` (optional) — Key-value pairs for API keys or auth tokens\nneeded in this environment`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Create`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`running-tests-against-an-environment`,children:`Running Tests Against an Environment`}),`\n`,_jsxs(_components.p,{children:[`Once you’ve created environments, a dropdown appears on the `,_jsx(_components.strong,{children:`Run`}),` button\nfor both individual tests and suites:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Individual tests`}),` — Click the `,_jsx(_components.strong,{children:`Run Test`}),` dropdown and select an\nenvironment. The test runs against that environment’s URL instead of the\noriginal.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Suites`}),` — Click the play button on a suite row and choose an\nenvironment, or select `,_jsx(_components.strong,{children:`Default (original URLs)`}),` to run with the\noriginal test URLs.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Create separate environments for each deployment target your team uses\n(staging, QA, preview branches). Any test or suite can be run against any\nenvironment on demand — no configuration changes needed.`})}),`\n`,_jsx(Heading,{level:`2`,id:`managing-environments`,children:`Managing Environments`}),`\n`,_jsx(_components.p,{children:`From the Environments page, you can:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Edit`}),` — Click the pencil icon to update the name, URL, or tokens`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Delete`}),` — Click the trash icon to remove an environment`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`tokens`,children:`Tokens`}),`\n`,_jsx(_components.p,{children:`Tokens are key-value pairs passed to your tests as environment-specific\nconfiguration. Common uses include:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`API keys that differ between environments`}),`\n`,_jsx(_components.li,{children:`Auth tokens for service-to-service authentication`}),`\n`,_jsx(_components.li,{children:`Feature flags or configuration overrides`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Add tokens when creating or editing an environment by clicking `,_jsx(_components.strong,{children:`Add Token`}),`\nand entering a key and value.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Environments","description":"Run tests against staging, preview, and other environments","icon":"globe","href":"/pages/features/testing/environments"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Creating an Environment","slug":"creating-an-environment","depth":2,"children":[]},{"title":"Running Tests Against an Environment","slug":"running-tests-against-an-environment","depth":2,"children":[]},{"title":"Managing Environments","slug":"managing-environments","depth":2,"children":[]},{"title":"Tokens","slug":"tokens","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"decipherai","siteName":"Decipher AI Docs","title":"Environments - Decipher AI Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-02-12T01:25:18.818Z","originalFileLocation":"pages/features/testing/environments.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Run tests against staging, preview, and other environments\">\u003cmeta data-mint-head name=\"application-name\" content=\"Decipher AI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Environments - Decipher AI Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Run tests against staging, preview, and other environments\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Decipher AI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getdecipher.com/pages/features/testing/environments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://decipherai.mintlify.app/_mintlify/api/og/v2?division=Managing+Tests\u0026amp;title=Environments\u0026amp;description=Run+tests+against+staging%2C+preview%2C+and+other+environments\u0026amp;theme=8b88d9db91223a2c04172ec4\u0026amp;signature=0589806f48b3f4db5277d201fa4bbea096300620e13dd4085f2103d3eccc7152\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Environments - Decipher AI Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Run tests against staging, preview, and other environments\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://decipherai.mintlify.app/_mintlify/api/og/v2?division=Managing+Tests\u0026amp;title=Environments\u0026amp;description=Run+tests+against+staging%2C+preview%2C+and+other+environments\u0026amp;theme=8b88d9db91223a2c04172ec4\u0026amp;signature=0589806f48b3f4db5277d201fa4bbea096300620e13dd4085f2103d3eccc7152\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/decipherai/KAIMPSusSSmoeFOs/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Decipher AI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#181d27\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getdecipher.com/pages/features/testing/environments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/pages/features/testing/environments.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.getdecipher.com/#organization\",\"name\":\"Decipher AI Docs\",\"url\":\"https://docs.getdecipher.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/decipherai/dLwBqZJ3d9fGHmsO/logo/icon.png?fit=max\u0026auto=format\u0026n=dLwBqZJ3d9fGHmsO\u0026q=85\u0026s=a0154d758fb21dd1f7b340bb04fd7273\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getdecipher.com#website\",\"name\":\"Decipher AI Docs\",\"url\":\"https://docs.getdecipher.com\",\"publisher\":{\"@id\":\"https://docs.getdecipher.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getdecipher.com/pages/features/testing/environments#webpage\",\"url\":\"https://docs.getdecipher.com/pages/features/testing/environments\",\"name\":\"Environments\",\"description\":\"Run tests against staging, preview, and other environments\",\"dateModified\":\"2026-02-12T01:25:18.818Z\",\"isPartOf\":{\"@id\":\"https://docs.getdecipher.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getdecipher.com/pages/features/testing/environments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getdecipher.com/pages/features/testing/environments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Managing Tests\",\"item\":\"https://docs.getdecipher.com/pages/features/testing/suites\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Environments\",\"item\":\"https://docs.getdecipher.com/pages/features/testing/environments\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.getdecipher.com/pages/features/testing/environments#article\",\"headline\":\"Environments\",\"name\":\"Environments\",\"description\":\"Run tests against staging, preview, and other environments\",\"url\":\"https://docs.getdecipher.com/pages/features/testing/environments\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getdecipher.com/pages/features/testing/environments#webpage\"},\"dateModified\":\"2026-02-12T01:25:18.818Z\",\"publisher\":{\"@id\":\"https://docs.getdecipher.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getdecipher.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Decipher AI Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Decipher AI Docs","nav":{"global":null,"tabs":[{"tab":"Testing","groups":[{"group":"Introduction","pages":[{"title":"Welcome to Decipher","icon":"house","mode":"wide","href":"/pages/introduction/intro"}]},{"group":"Testing","pages":[{"title":"Recording a Test","icon":"flask-vial","iconType":"solid","href":"/pages/features/testing"},{"title":"Agentic Test Generation","icon":"wand-magic-sparkles","iconType":"solid","href":"/pages/features/testing/generate-with-claude"},{"title":"Step Types","icon":"layer-group","iconType":"solid","href":"/pages/features/testing/step-types"},{"title":"Login Identities","icon":"user-lock","iconType":"solid","href":"/pages/features/login-identities"}]},{"group":"Managing Tests","pages":[{"title":"Test Suites \u0026 Tags","icon":"folder-tree","href":"/pages/features/testing/suites"},{"title":"Updating Tests","icon":"pen-to-square","href":"/pages/features/testing/updating-tests"},{"title":"Variables","icon":"brackets-curly","href":"/pages/features/testing/variables"},{"title":"File Uploads","description":"Upload files in test steps to test file inputs on your pages","icon":"file-arrow-up","iconType":"solid","href":"/pages/features/testing/file-uploads"},{"title":"Environments","icon":"globe","href":"/pages/features/testing/environments"},{"title":"Custom Host Headers","description":"Bypass authentication on preview deployments by injecting custom HTTP headers","icon":"lock-open","href":"/pages/features/testing/preview-auth-headers"},{"title":"Owners","icon":"user-shield","href":"/pages/features/testing/owners"},{"title":"Code Execution","icon":"code","iconType":"solid","href":"/pages/features/testing/code-execution"},{"title":"Local Tunnel","icon":"terminal","iconType":"solid","href":"/pages/features/testing/local-tunnel"}]},{"group":"Local Browser","pages":[{"title":"Run in Local Browser","icon":"laptop-code","iconType":"solid","href":"/pages/features/testing/run-locally"},{"title":"TypeScript Wrapper","icon":"code","iconType":"solid","href":"/pages/features/testing/run-locally-wrapper"},{"title":"Python Wrapper","icon":"python","iconType":"solid","href":"/pages/features/testing/run-locally-python"},{"title":"Download Playwright Spec","icon":"download","iconType":"solid","href":"/pages/features/testing/download-playwright-spec"}]},{"group":"Test Results \u0026 Alerts","pages":[{"title":"Test Failures","icon":"circle-exclamation","href":"/pages/features/testing/test-failures"},{"title":"Test Alerts","icon":"bell","href":"/pages/features/testing/alerts"},{"title":"Agent Context","icon":"brain","href":"/pages/features/testing/agent-context"}]},{"group":"Testing Integrations","pages":[{"title":"GitHub integration","icon":"github","iconType":"solid","href":"/pages/features/testing/github-pr-integration"},{"title":"Claude Code Integration","icon":"robot","href":"/pages/features/testing/claude-code-integration"},{"title":"Linear integration","icon":"ticket","iconType":"solid","href":"/pages/features/testing/linear-integration"}]},{"group":"General","pages":[{"title":"Teams","icon":"users","href":"/pages/features/teams"}]}]},{"tab":"Monitoring","pages":[{"title":"Monitoring","href":"/pages/browser-quickstart"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Environments - Decipher AI Docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}