1"use strict";(self.webpackChunktestplane_docs=self.webpackChunktestplane_docs||[]).push([["2587"],{76292(e,n,s){s.r(n),s.d(n,{metadata:()=>i,default:()=>p,frontMatter:()=>o,contentTitle:()=>a,toc:()=>d,assets:()=>c});var i=JSON.parse('{"id":"basic-guides/configuration","title":"Configuration","description":"- Where Testplane looks for the configuration file","source":"@site/docs/basic-guides/configuration.mdx","sourceDirName":"basic-guides","slug":"/basic-guides/configuration","permalink":"/docs/basic-guides/configuration","draft":false,"unlisted":false,"editUrl":"https://github.com/gemini-testing/testplane-docs/tree/master/docs/basic-guides/configuration.mdx","tags":[],"version":"current","frontMatter":{},"sidebar":"mainSidebar","previous":{"title":"Component Testing","permalink":"/docs/basic-guides/component-testing"},"next":{"title":"Custom Commands","permalink":"/docs/basic-guides/custom-commands"}}'),t=s(74848),r=s(28453),l=s(77444);let o={},a="Configuration",c={},d=[{value:"Introduction",id:"introduction",level:2},{value:"Configuration file",id:"config-location",level:2},{value:"Setting parameters",id:"config-sources",level:2},{value:"Overriding via environment variables",id:"env-override",level:3},{value:"Overriding via CLI",id:"cli-override",level:3},{value:"Parameter priority",id:"priority",level:3},{value:"Parameter inheritance",id:"inheritance",level:2},{value:"Inheritance example",id:"inheritance-example",level:3},{value:"Basic parameters",id:"basic-params",level:2},{value:"Retries (retry)",id:"retry",level:3},{value:"Test file locations",id:"test-files",level:3},{value:"Dev Server",id:"dev-server",level:3},{value:"Execution parallelism",id:"parallelism",level:3},{value:"Timeouts",id:"timeouts",level:2},{value:"Connecting plugins",id:"plugins",level:2},{value:"Example with html-reporter",id:"html-reporter-example",level:3},{value:"Setting defaults for commands",id:"command-defaults",level:2},{value:"assertViewOpts",id:"assert-view-opts",level:3},{value:"expectOpts",id:"expect-opts",level:3},{value:"stateOpts",id:"state-opts",level:3}];function h(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"configuration",children:"Configuration"})}),"\n",(0,t.jsx)(l.A,{type:"info",title:"What you will learn",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Where Testplane looks for the configuration file"}),"\n",(0,t.jsx)(n.li,{children:"How to override settings without modifying the configuration file"}),"\n",(0,t.jsx)(n.li,{children:"How settings inheritance works"}),"\n",(0,t.jsx)(n.li,{children:"How to configure parallel test execution and timeouts"}),"\n",(0,t.jsx)(n.li,{children:"How to connect plugins"}),"\n"]})}),"\n",(0,t.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,t.jsx)(n.p,{children:"Testplane is configured in three ways: through a configuration file, environment variables, and command-line arguments."}),"\n",(0,t.jsx)(n.p,{children:"The configuration file is the primary source of settings: it specifies browsers, test paths, parallelism, plugins, and timeouts. Environment variables and CLI arguments allow you to override individual parameters without modifying the file, which is convenient for CI/CD or local experiments."}),"\n",(0,t.jsxs)(n.p,{children:["For a complete reference of parameters, see the ",(0,t.jsx)(n.a,{href:"/docs/reference/config/main",children:"configuration documentation"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"config-location",children:"Configuration file"}),"\n",(0,t.jsx)(n.p,{children:"When launched, Testplane looks for a configuration file in the current working directory. The following file names are supported (in order of priority):"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:".testplane.conf.ts"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:".testplane.conf.js"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"testplane.config.ts"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"testplane.config.js"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"testplane.config.cts"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"testplane.config.cjs"})}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["If you need to use a config from a different location, specify the path using the ",(0,t.jsx)(n.code,{children:"--config"})," option:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx testplane --config ./configs/testplane.local.ts\n"})}),"\n",(0,t.jsx)(n.h2,{id:"config-sources",children:"Setting parameters"}),"\n",(0,t.jsx)(n.p,{children:"Testplane configuration parameters can be set in three ways:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Configuration file: the primary method, suitable for most settings"}),"\n",(0,t.jsx)(n.li,{children:"Environment variables: convenient for CI/CD and sensitive data"}),"\n",(0,t.jsx)(n.li,{children:"CLI arguments: for quick overrides at runtime"}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"env-override",children:"Overriding via environment variables"}),"\n",(0,t.jsx)(n.p,{children:"Any configuration parameter can be overridden via environment variables. The variable name is formed from the parameter name in the config:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Replace ",(0,t.jsx)(n.code,{children:"camel
1Case"})," with ",(0,t.jsx)(n.code,{children:"snake_case"})," (e.g., ",(0,t.jsx)(n.code,{children:"baseUrl"})," \u2192 ",(0,t.jsx)(n.code,{children:"base_url"}),")"]}),"\n",(0,t.jsxs)(n.li,{children:["For nested parameters, join all levels with ",(0,t.jsx)(n.code,{children:"_"})]}),"\n",(0,t.jsxs)(n.li,{children:["Add the ",(0,t.jsx)(n.code,{children:"testplane_"})," prefix"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# gridUrl in config \u2192 testplane_grid_url\ntestplane_grid_url=local npx testplane\n\n# browsers.firefox.headless in config \u2192 testplane_browsers_firefox_headless\ntestplane_browsers_firefox_headless=false npx testplane\n"})}),"\n",(0,t.jsx)(n.h3,{id:"cli-override",children:"Overriding via CLI"}),"\n",(0,t.jsx)(n.p,{children:"Parameters can also be overridden via CLI arguments:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Replace ",(0,t.jsx)(n.code,{children:"camelCase"})," with ",(0,t.jsx)(n.code,{children:"kebab-case"})," (e.g., ",(0,t.jsx)(n.code,{children:"baseUrl"})," \u2192 ",(0,t.jsx)(n.code,{children:"base-url"}),")"]}),"\n",(0,t.jsx)(n.li,{children:"For nested parameters, join all levels with hyphens"}),"\n",(0,t.jsxs)(n.li,{children:["Add ",(0,t.jsx)(n.code,{children:"--"})," at the beginning"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# gridUrl in config \u2192 --grid-url in CLI\nnpx testplane --grid-url local\n\n# browsers.firefox.headless in config \u2192 --browsers-firefox-headless in CLI\nnpx testplane --browsers-firefox-headless false\n"})}),"\n",(0,t.jsx)(n.h3,{id:"priority",children:"Parameter priority"}),"\n",(0,t.jsx)(n.p,{children:"When values conflict, the following priority applies (from highest to lowest):"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Priority"}),(0,t.jsx)(n.th,{children:"Source"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"1"}),(0,t.jsx)(n.td,{children:"CLI argument"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"--base-url http://example.com"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"2"}),(0,t.jsx)(n.td,{children:"Environment variable"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"testplane_base_url=http://example.com"})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"3"}),(0,t.jsx)(n.td,{children:"Configuration file"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'baseUrl: "http://example.com"'})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"4"}),(0,t.jsx)(n.td,{children:"Default value"}),(0,t.jsx)(n.td,{children:"\u2014"})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"inheritance",children:"Parameter inheritance"}),"\n",(0,t.jsx)(n.p,{children:"Testplane supports cascading parameter inheritance: settings defined at the root level of the config apply to all browsers. Browsers can override these values."}),"\n",(0,t.jsx)(n.h3,{id:"inheritance-example",children:"Inheritance example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";\n\nexport default {\n // Root settings \u2014 apply to all browsers\n baseUrl: "http://localhost:3000",\n retry: 2,\n sessionsPerBrowser: 3,\n browsers: {\n chrome: {\n // Inherits retry: 2 and sessionsPerBrowser: 3\n desiredCapabilities: {\n browserName: "chrome",\n },\n },\n firefox: {\n // Overrides retry, inherits sessionsPerBrowser: 3\n retry: 5,\n desiredCapabilities: {\n browserName: "firefox",\n },\n },\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.p,{children:"In this example:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Chrome will get ",(0,t.jsx)(n.code,{children:"retry: 2"})," and ",(0,t.jsx)(n.code,{children:"sessionsPerBrowser: 3"})," (inheritance)"]}),"\n",(0,t.jsxs)(n.li,{children:["Firefox will get ",(0,t.jsx)(n.code,{children:"retry: 5"})," (override) and ",(0,t.jsx)(n.code,{children:"sessionsPerBrowser: 3"})," (inheritance)"]}),"\n"]}),"\n",(0,t.jsx)(l.A,{type:"info",children:(0,t.jsxs)(n.p,{children:["The only parameter that cannot be moved to the root level is ",(0,t.jsx)(n.code,{children:"desiredCapabilities"}),". It must be\ndefined for each browser separately."]})}),"\n",(0,t.jsx)(n.h2,{id:"basic-params",children:"Basic parameters"}),"\n",(0,t.jsx)(n.h3,{id:"retry",children:"Retries (retry)"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.a,{href:"/docs/reference/config/browsers#retry",children:(0,t.jsx)(n.code,{children:"retry"})})," parameter determines how many times Testplane will restart a failed test."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";
1\n\nexport default {\n // Global value for all browsers\n retry: 2,\n browsers: {\n chrome: {\n // Can be increased for an unstable browser\n retry: 5,\n desiredCapabilities: { browserName: "chrome" },\n },\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.h3,{id:"test-files",children:"Test file locations"}),"\n",(0,t.jsxs)(n.p,{children:["Test file sets and browsers for running them are specified in the ",(0,t.jsx)(n.code,{children:"sets"})," section:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";\n\nexport default {\n sets: {\n desktop: {\n // Paths to tests\n files: ["tests/desktop/**/*.test.ts"],\n browsers: ["chrome", "firefox"],\n },\n mobile: {\n files: ["tests/mobile/**/*.test.ts"],\n // Files can be excluded\n ignoreFiles: ["tests/mobile/**/*.skip.ts"],\n browsers: ["iphone", "android"],\n },\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.p,{children:"Running a specific set:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx testplane --set desktop\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For more details about sets, see the ",(0,t.jsx)(n.a,{href:"/docs/reference/config/sets",children:"sets documentation"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"dev-server",children:"Dev Server"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"devServer"})," section allows you to automatically start a development server before tests:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";\n\nconst SERVER_PORT = 3000;\n\nexport default {\n devServer: {\n command: "npm run dev",\n env: { PORT: SERVER_PORT },\n reuseExisting: true,\n readinessProbe: {\n url: `http://localhost:${SERVER_PORT}/health`,\n },\n },\n baseUrl: "http://localhost:3000",\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.p,{children:"Testplane will run the command and wait for the server to be ready at the specified URL."}),"\n",(0,t.jsx)(l.A,{type:"warning",children:(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"devServer"})," section only starts the server. Don't forget to also configure ",(0,t.jsx)(n.code,{children:"baseUrl"}),"."]})}),"\n",(0,t.jsx)(l.A,{type:"tip",children:(0,t.jsxs)(n.p,{children:["When using ",(0,t.jsx)(n.code,{children:"reuseExisting: true"}),", be sure to specify ",(0,t.jsx)(n.code,{children:"readinessProbe.url"}),": Testplane will check\nif the server is running and won't start a new one."]})}),"\n",(0,t.jsxs)(n.p,{children:["For more details, see the ",(0,t.jsx)(n.a,{href:"/docs/reference/config/dev-server",children:"devServer documentation"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"parallelism",children:"Execution parallelism"}),"\n",(0,t.jsxs)(n.p,{children:["Testplane runs tests in parallel, which significantly speeds up the test run. Two main parameters are used to configure parallelism: ",(0,t.jsx)(n.code,{children:"sessionsPerBrowser"})," and ",(0,t.jsx)(n.code,{children:"workers"}),"."]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"sessionsPerBrowser"})," determines the maximum number of parallel browser sessions for each browser"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"workers"})," determines the number of Node.js worker processes for parallel test execution"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";\n\nexport default {\n browsers: {\n chrome: {\n sessionsPerBrowser: 5,\n desiredCapabilities: {\n browserName: "chrome",\n },\n },\n firefox: {\n sessionsPerBrowser: 3,\n desiredCapabilities: {\n browserName: "firefox",\n },\n },\n },\n system: {\n workers: 4,\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.p,{children:"In this example, Testplane can run up to 5 parallel Chrome sessions and up to 3 Firefox sessions and distributes tests among 4 worker processes."}),"\n",(0,t.jsx)(n.h2,{id:"timeouts",children:"Timeouts"}),"\n",(0,t.jsx)(n.p,{children:"Testplane allows you to configure timeouts to control operation execution time:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"httpTimeout"})," \u2014 timeout for HTTP requests to WebDriver"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"testTimeout"})," \u2014 maximum execution time for a single test"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pageLoadTimeout"})," \u2014 page load timeout in the browser"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"waitTimeout"})," \u2014 timeout for wait commands (",(0,t.jsx)(n.code,{children:"waitFor*"}),")"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";
1\n\nexport default {\n // Global timeouts\n pageLoadTimeout: 20000,\n httpTimeout: 20000,\n testTimeout: 90000,\n browsers: {\n chrome: {\n // Timeouts can be overridden for a specific browser\n pageLoadTimeout: 30000,\n waitTimeout: 5000,\n desiredCapabilities: { browserName: "chrome" },\n },\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsxs)(n.p,{children:["For a complete list of timeouts and their descriptions, see the ",(0,t.jsx)(n.a,{href:"/docs/reference/config/browsers#timeouts",children:"documentation"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"plugins",children:"Connecting plugins"}),"\n",(0,t.jsxs)(n.p,{children:["Plugins are connected and configured in the ",(0,t.jsx)(n.code,{children:"plugins"})," section of the configuration file. Each key is the npm package name of the plugin, and the value is an object with its parameters."]}),"\n",(0,t.jsx)(n.h3,{id:"html-reporter-example",children:"Example with html-reporter"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"/docs/html-reporter/html-reporter-setup",children:"html-reporter"})," is a plugin for generating HTML test reports."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Installation:"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install html-reporter --save-dev\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Connection:"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",metastring:'title="testplane.config.ts"',children:'import type { ConfigInput } from "testplane";\n\nexport default {\n plugins: {\n "html-reporter/testplane": {\n enabled: true,\n path: "testplane-report",\n defaultView: "all",\n diffMode: "3-up-scaled",\n },\n },\n // ...\n} satisfies ConfigInput;\n'})}),"\n",(0,t.jsx)(n.p,{children:"Plugin parameters can be overridden via environment variables:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Disable the plugin\nhtml_reporter_enabled=false npx testplane\n\n# Change the report path\nhtml_reporter_path=./custom-report npx testplane\n"})}),"\n",(0,t.jsx)(n.p,{children:"Similarly, parameters can be passed via command line:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Change the report path\nnpx testplane --html-reporter-path=./custom-report\n\n# Change the diff display mode\nnpx testplane --html-reporter-diff_mode=only-diff\n"})}),"\n",(0,t.jsx)(n.p,{children:"If a parameter is specified in multiple places, the value with the highest priority is applied:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"CLI \u2014 highest priority"}),"\n",(0,t.jsx)(n.li,{children:"Environment variables"}),"\n",(0,t.jsx)(n.li,{children:"Configuration file \u2014 lowest priority"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This allows flexible control of plugin behavior in CI/CD without modifying the config."}),"\n",(0,t.jsx)(n.h2,{id:"command-defaults",children:"Setting defaults for commands"}),"\n",(0,t.jsx)(n.p,{children:"Testplane allows you to set default values for parameters of certain commands. Instead of passing the same options with each call, you can specify them once in the configuration."}),"\n",(0,t.jsx)(n.h3,{id:"assert-view-opts",children:"assertViewOpts"}),"\n",(0,t.jsx)(n.p,{children:"Default settings for screenshot testing. Allows you to specify which elements to ignore, acceptable pixel difference, delay before capture, and other screenshot comparison parameters."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:'export default {\n assertViewOpts: {\n ignoreElements: [".ads", ".dynamic-banner"],\n ignoreDiffPixelCount: "0.5%",\n },\n // ...\n};\n'})}),"\n",(0,t.jsxs)(n.p,{children:["For a complete list of parameters, see the ",(0,t.jsx)(n.a,{href:"/docs/commands/browser/assertView",children:"assertView"})," documentation."]}),"\n",(0,t.jsx)(n.h3,{id:"expect-opts",children:"expectOpts"}),"\n",(0,t.jsx)(n.p,{children:"Settings for asynchronous assertions with waiting."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:"export default {\n system: {\n expectOpts: {\n wait: 5000, // max wait time (ms)\n interval: 200, // check interval (ms)\n },\n },\n // ...\n};\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For a complete list of parameters, see the ",(0,t.jsx)(n.a,{href:"/docs/commands/expect/overview",children:"expect matchers"})," documentation."]}),"\n",(0,t.jsx)(n.h3,{id:"state-opts",children:"stateOpts"}),"\n",(0,t.jsx)(n.p,{children:"Settings for browser state save and restore commands. Defines what to save (cookie
1s, localStorage, sessionStorage), where to save, and whether to delete the file after tests."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typescript",children:'export default {\n stateOpts: {\n path: "./tmp/auth-state.json",\n cookies: true,\n localStorage: true,\n sessionStorage: false,\n },\n // ...\n};\n'})}),"\n",(0,t.jsxs)(n.p,{children:["For a complete list of parameters, see the ",(0,t.jsx)(n.a,{href:"/docs/commands/browser/saveState",children:"saveState"})," and ",(0,t.jsx)(n.a,{href:"/docs/commands/browser/restoreState",children:"restoreState"})," documentation."]})]})}function p(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},77444(e,n,s){s.d(n,{A:()=>C});var i=s(74848),t=s(96540),r=s(34164),l=s(30568),o=s(88287);function a({type:e,className:n,children:s,id:t}){return(0,i.jsx)("div",{className:(0,r.A)(o.G.common.admonition,o.G.common.admonitionType(e),"admonition_xJq3",n),id:t,children:s})}function c({icon:e,title:n}){return(0,i.jsxs)("div",{className:"admonitionHeading_Gvgb",children:[(0,i.jsx)("span",{className:"admonitionIcon_Rf37",children:e}),n]})}function d({children:e}){return e?(0,i.jsx)("div",{className:"admonitionContent_BuS1",children:e}):null}function h(e){let{type:n,icon:s,title:t,children:r,className:l,id:o}=e;return(0,i.jsxs)(a,{type:n,className:l,id:o,children:[t||s?(0,i.jsx)(c,{title:t,icon:s}):null,(0,i.jsx)(d,{children:r})]})}let p={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function m(e){return(0,i.jsx)(h,{...p,...e,className:(0,r.A)("alert alert--secondary",e.className),children:e.children})}let u={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function x(e){return(0,i.jsx)(h,{...u,...e,className:(0,r.A)("alert alert--success",e.className),children:e.children})}let f={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function j(e){return(0,i.jsx)(h,{...f,...e,className:(0,r.A)("alert alert--info",e.className),children:e.children})}function g(e){return(0,i.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}let v={icon:(0,i.jsx)(g,{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},b={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},w={icon:(0,i.jsx)(g,{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})},y={note:m,tip:x,info:j,warning:function(e){return(0,i.jsx)(h,{...v,...e,className:(0,r.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,i.jsx)(h,{...b,...e,className:(0,r.A)("alert alert--danger",e.className),children:e.children})},secondary:e=>(0,i.jsx)(m,{title:"secondary",...e}),important:e=>(0,i.jsx)(j,{title:"important",...e}),success:e=>(0,i.jsx)(x,{title:"success",...e}),caution:function(e){return(0,i.jsx)(h,{...w,...e,className:(0,r.A)("alert alert--warning",e.className),children:e.children})}};function C(e){var n;let s,r=function(e){var n;let s,r,l,{mdxAdmonitionTitle:o,rest:a}=(n=e.children,r=(s=t.Children.toArray(n)).find(e=>t.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),l=s.filter(e=>e!==r),{mdxAdmonitionTitle:r?.props.children,rest:l.length>0?(0,i.jsx)(i.Fragment,{children:l}):null}),c=e.title??o;return{...e,...c&&{title:c},children:a}}(e),l=(s=y[n=r.type])||(console.warn(`No admonition component found for admonition type "${n}". Using Info as fallback.`),y.info);return(0,i.jsx)(l,{...r})}},28453(e,n,s){s.d(n,{R:()=>l,x:()=>o});var i=s(96540);let t={},r=i.createContext(t);function l(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.