PageSourceSearch

https://playwright.dev/assets/js/3197234c.533b5536.js

js playwright.dev collected 2026-09-24 06:54:27 UTC 62,314 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkplaywright_dev=self.webpackChunkplaywright_dev||[]).push([["2258"],{31675(e,t,s){s.r(t),s.d(t,{metadata:()=>n,default:()=>h,frontMatter:()=>l,contentTitle:()=>o,toc:()=>c,assets:()=>a});var n=JSON.parse('{"id":"api/class-testinfo","title":"TestInfo","description":"TestInfo contains information about currently running test. It is available to test functions, test.beforeEach(), test.afterEach(), test.beforeAll() and test.afterAll() hooks, and test-scoped fixtures. TestInfo provides utilities to control test execution: attach files, update test timeout, determine which test is currently running and whether it was retried, etc.","source":"@site/docs/api/class-testinfo.mdx","sourceDirName":"api","slug":"/api/class-testinfo","permalink":"/docs/next/api/class-testinfo","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"class-testinfo","title":"TestInfo"},"sidebar":"api","previous":{"title":"TestConfig","permalink":"/docs/next/api/class-testconfig"},"next":{"title":"TestInfoError","permalink":"/docs/next/api/class-testinfoerror"}}'),i=s(74848),r=s(28453);s(13554),s(41647),s(83137);let l={id:"class-testinfo",title:"TestInfo"},o,a={},c=[{value:"Methods",id:"methods",level:2},{value:"attach",id:"test-info-attach",level:3},{value:"fail()",id:"test-info-fail-1",level:3},{value:"fail(condition)",id:"test-info-fail-2",level:3},{value:"fixme()",id:"test-info-fixme-1",level:3},{value:"fixme(condition)",id:"test-info-fixme-2",level:3},{value:"outputPath",id:"test-info-output-path",level:3},{value:"setTimeout",id:"test-info-set-timeout",level:3},{value:"skip()",id:"test-info-skip-1",level:3},{value:"skip(condition)",id:"test-info-skip-2",level:3},{value:"slow()",id:"test-info-slow-1",level:3},{value:"slow(condition)",id:"test-info-slow-2",level:3},{value:"snapshotPath",id:"test-info-snapshot-path",level:3},{value:"Properties",id:"properties",level:2},{value:"annotations",id:"test-info-annotations",level:3},{value:"attachments",id:"test-info-attachments",level:3},{value:"column",id:"test-info-column",level:3},{value:"config",id:"test-info-config",level:3},{value:"duration",id:"test-info-duration",level:3},{value:"error",id:"test-info-error",level:3},{value:"errors",id:"test-info-errors",level:3},{value:"expectedStatus",id:"test-info-expected-status",level:3},{value:"file",id:"test-info-file",level:3},{value:"fn",id:"test-info-fn",level:3},{value:"line",id:"test-info-line",level:3},{value:"outputDir",id:"test-info-output-dir",level:3},{value:"parallelIndex",id:"test-info-parallel-index",level:3},{value:"project",id:"test-info-project",level:3},{value:"repeatEachIndex",id:"test-info-repeat-each-index",level:3},{value:"retry",id:"test-info-retry",level:3},{value:"snapshotDir",id:"test-info-snapshot-dir",level:3},{value:"snapshotSuffix",id:"test-info-snapshot-suffix",level:3},{value:"status",id:"test-info-status",level:3},{value:"tags",id:"test-info-tags",level:3},{value:"testId",id:"test-info-test-id",level:3},{value:"timeout",id:"test-info-timeout",level:3},{value:"title",id:"test-info-title",level:3},{value:"titlePath",id:"test-info-title-path",level:3},{value:"workerIndex",id:"test-info-worker-index",level:3}];function d(e){let t={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"TestInfo"})," contains information about currently running test. It is available to test functions, ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-before-each",children:"test.beforeEach()"}),", ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-after-each",children:"test.afterEach()"}),", ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-before-all",children:"test.beforeAll()"})," and ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-after-all",children:"test.afterAll()"})," hooks, and test-scoped fixtures. ",(0,i.jsx)(t.code,{children:"TestInfo"})," provides utilities to control test execution: attach files, update test timeout, determine which test is currently running and whether it was retried, etc."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest('basic test', async ({ page }, testInfo) =>
1 {\n  expect(testInfo.title).toBe('basic test');\n  await page.screenshot(testInfo.outputPath('screenshot.png'));\n});\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(t.h3,{id:"test-info-attach",children:"attach"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.attach"}),"\n",(0,i.jsxs)(t.p,{children:["Attach a value or a file from disk to the current test. Some reporters show test attachments. Either ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach-option-path",children:"path"})," or ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach-option-body",children:"body"})," must be specified, but not both."]}),"\n",(0,i.jsx)(t.p,{children:"For example, you can attach a screenshot to the test:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest('basic test', async ({ page }, testInfo) => {\n  await page.goto('https://playwright.dev');\n  const screenshot = await page.screenshot();\n  await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' });\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:"Or you can attach files returned by your APIs:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\nimport { download } from './my-custom-helpers';\n\ntest('basic test', async ({}, testInfo) => {\n  const tmpPath = await download('a');\n  await testInfo.attach('downloaded', { path: tmpPath });\n});\n"})}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach",children:"testInfo.attach()"})," automatically takes care of copying attached files to a location that is accessible to reporters. You can safely remove the attachment after awaiting the attach call."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await testInfo.attach(name);\nawait testInfo.attach(name, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-attach-option-name"}),(0,i.jsx)("a",{href:"#test-info-attach-option-name",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Attachment name. The name will also be sanitized and used as the prefix of file name when saving to disk."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"body"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/buffer.html#buffer_class_buffer",title:"Buffer",children:"Buffer"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-attach-option-body"}),(0,i.jsx)("a",{href:"#test-info-attach-option-body",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Attachment body. Mutually exclusive with ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach-option-path",children:"path"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"contentType"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-attach-option-content-type"}),(0,i.jsx)("a",{href:"#test-info-attach-option-content-type",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Content type of this attachment to properly present in the report, for example ",(0,i.jsx)(t.code,{children:"'application/json'"})," or ",(0,i.jsx)(t.code,{children:"'image/png'"}),". If omitted, content type is inferred based on the ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach-option-path",children:"path"}),", or defaults to ",(0,i.jsx)(t.code,{children:"text/plain"})," for ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," attachments and ",(0,i.jsx)(t.code,{children:"application/octet-stream"})," for ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/buffer.html#buffer_class_buffer",title:"Buffer",children:"Buffer"})," attachments."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"path"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-attach-option-path"}),(0,i.jsx)("a",{href:"#test-info-attach-option-path",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Path on the filesystem to the attached file. Mutually exclusive with ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach-option-body",children:"body"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-attach-return"}),(0,i.jsx)("a",{href:"#test-info-attach-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-fail-1",children:"fail()"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.fail()"}),"\n",(0,i.jsxs)(t.p,{children:['Marks the currently running test as "should fail". Playwright Test runs this test and ensures that it is actually failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is fixed. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-fail",children:"test.fail()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.fail();\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-fail-2",children:"fail(condition)"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.fail(condition)"}),"\n",(0,i.jsxs)(t.p,{children:['Conditionally mark the currently running test as "should fail" with an optional description. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-fail",children:"test.fail()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.fail(condition);\ntestInfo.fail(condition, description);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"condition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-fail-2-option-condition"}),(0,i.jsx)("a",{href:"#test-info-fail-2-option-condition",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:['Test is marked as "should fail" when the condition is ',(0,i.jsx)(t.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-fail-2-option-description"}),(0,i.jsx)("a",{href:"#test-info-fail-2-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional description that will be reflected in a test report."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-fixme-1",children:"fixme()"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.fixme()"}),"\n",(0,i.jsxs)(t.p,{children:['Mark a test as "fixme", with the intention to fix it. Test is immediately aborted. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-fixme",children:"test.fixme()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.fixme();\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-fixme-2",children:"fixme(condition)"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.fixme(condition)"}),"\n",(0,i.jsxs)(t.p,{children:['Conditionally mark the currently running test as "fixme" with an optional description. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-fixme",children:"test.fixme()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.fixme(condition);\ntestInfo.fixme(condition, description);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"condition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-fixme-2-option-condition"}),(0,i.jsx)("a",{href:"#test-info-fixme-2-option-condition",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:['Test is marked as "fixme" when the condition is ',(0,i.jsx)(t.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-fixme-2-option-description"}),(0,i.jsx)("a",{href:"#test-info-fixme-2-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional description that will be reflected in a test report."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-output-path",children:"outputPath"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.outputPath"}),"\n",(0,i.jsxs)(t.p,{children:["Returns a path inside the ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-output-dir",children:"testInfo.outputDir"})," where the test can safely put a temporary file. Guarantees that tests running in parallel will not interfere with each other."]}
1),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\nimport fs from 'fs';\n\ntest('example test', async ({}, testInfo) => {\n  const file = testInfo.outputPath('dir', 'temporary-file.txt');\n  await fs.promises.writeFile(file, 'Put some data to the dir/temporary-file.txt', 'utf8');\n});\n"})}),"\n",(0,i.jsxs)(t.blockquote,{children:["\n",(0,i.jsxs)(t.p,{children:["Note that ",(0,i.jsx)(t.code,{children:"pathSegments"})," accepts path segments to the test output directory such as ",(0,i.jsx)(t.code,{children:"testInfo.outputPath('relative', 'path', 'to', 'output')"}),".\nHowever, this path must stay within the ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-output-dir",children:"testInfo.outputDir"})," directory for each test (i.e. ",(0,i.jsx)(t.code,{children:"test-results/a-test-title"}),"), otherwise it will throw."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.outputPath(...pathSegments);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"...pathSegments"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-output-path-option-path-segments"}),(0,i.jsx)("a",{href:"#test-info-output-path-option-path-segments",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Path segments to append at the end of the resulting path."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-output-path-return"}),(0,i.jsx)("a",{href:"#test-info-output-path-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-set-timeout",children:"setTimeout"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.setTimeout"}),"\n",(0,i.jsxs)(t.p,{children:["Changes the timeout for the currently running test. Zero means no timeout. Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-timeouts",children:"various timeouts"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Timeout is usually specified in the ",(0,i.jsx)(t.a,{href:"/docs/next/test-configuration",children:"configuration file"}),", but it could be useful to change the timeout in certain scenarios:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest.beforeEach(async ({ page }, testInfo) => {\n  // Extend timeout for all tests running this hook by 30 seconds.\n  testInfo.setTimeout(testInfo.timeout + 30000);\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.setTimeout(timeout);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-set-timeout-option-timeout"}),(0,i.jsx)("a",{href:"#test-info-set-timeout-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Timeout in milliseconds."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-skip-1",children:"skip()"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.skip()"}),"\n",(0,i.jsxs)(t.p,{children:["Unconditionally skip the currently running test. Test is immediately aborted. This is similar to ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-skip",children:"test.
1skip()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.skip();\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-skip-2",children:"skip(condition)"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.skip(condition)"}),"\n",(0,i.jsxs)(t.p,{children:["Conditionally skips the currently running test with an optional description. This is similar to ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-skip",children:"test.skip()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.skip(condition);\ntestInfo.skip(condition, description);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"condition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-skip-2-option-condition"}),(0,i.jsx)("a",{href:"#test-info-skip-2-option-condition",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["A skip condition. Test is skipped when the condition is ",(0,i.jsx)(t.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-skip-2-option-description"}),(0,i.jsx)("a",{href:"#test-info-skip-2-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional description that will be reflected in a test report."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-slow-1",children:"slow()"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.slow()"}),"\n",(0,i.jsxs)(t.p,{children:['Marks the currently running test as "slow", giving it triple the default timeout. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-slow",children:"test.slow()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.slow();\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-slow-2",children:"slow(condition)"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.slow(condition)"}),"\n",(0,i.jsxs)(t.p,{children:['Conditionally mark the currently running test as "slow" with an optional description, giving it triple the default timeout. This is similar to ',(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-slow",children:"test.slow()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.slow(condition);\ntestInfo.slow(condition, description);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"condition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-slow-2-option-condition"}),(0,i.jsx)("a",{href:"#test-info-slow-2-option-condition",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:['Test is marked as "slow" when the condition is ',(0,i.jsx)(t.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-slow-2-option-description"}),(0,i.jsx)("a",{href:"#test-info-slow-2-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional description that will be reflected in a test report."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-snapshot-path",children:"snapshotPath"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.snapshotPath"}),"\n",(0,i.jsxs)(t.p,{children:["Returns a path to a snapshot file with the given ",(0,i.jsx)(t.code,{children:"name"}),". Pass ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-snapshot-path-option-kind",children:"kind"})," to obtain a specific path:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"kind: 'screenshot'"})," for ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-pageassertions#page-assertions-to-have-screenshot-1",children:"expect(page).toHaveScreenshot()"}),";"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"kind: 'aria'"})," for ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot",children:"expect(locator).toMatchAriaSnapsh
1ot()"}),";"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"kind: 'snapshot'"})," for ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-snapshotassertions#snapshot-assertions-to-match-snapshot-1",children:"expect(value).toMatchSnapshot()"}),"."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await expect(page).toHaveScreenshot('header.png');\n// Screenshot assertion above expects screenshot at this path:\nconst screenshotPath = test.info().snapshotPath('header.png', { kind: 'screenshot' });\n\nawait expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.aria.yml' });\n// Aria snapshot assertion above expects snapshot at this path:\nconst ariaSnapshotPath = test.info().snapshotPath('main.aria.yml', { kind: 'aria' });\n\nexpect('some text').toMatchSnapshot('snapshot.txt');\n// Snapshot assertion above expects snapshot at this path:\nconst snapshotPath = test.info().snapshotPath('snapshot.txt');\n\nexpect('some text').toMatchSnapshot(['dir', 'subdir', 'snapshot.txt']);\n// Snapshot assertion above expects snapshot at this path:\nconst nestedPath = test.info().snapshotPath('dir', 'subdir', 'snapshot.txt');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"...name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-snapshot-path-option-name"}),(0,i.jsx)("a",{href:"#test-info-snapshot-path-option-name",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the same test file are expected to be the same."}),"\n",(0,i.jsxs)(t.p,{children:["When passing ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-snapshot-path-option-kind",children:"kind"}),", multiple name segments are not supported."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"kind"}),' "snapshot" | "screenshot" | "aria" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.53"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-snapshot-path-option-kind"}),(0,i.jsx)("a",{href:"#test-info-snapshot-path-option-kind",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["The snapshot kind controls which snapshot path template is used. See ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testconfig#test-config-snapshot-path-template",children:"testConfig.snapshotPathTemplate"})," for more details. Defaults to ",(0,i.jsx)(t.code,{children:"'snapshot'"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"test-info-snapshot-path-return"}),(0,i.jsx)("a",{href:"#test-info-snapshot-path-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h2,{id:"properties",children:"Properties"}),"\n",(0,i.jsx)(t.h3,{id:"test-info-annotations",children:"annotations"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.annotations"}),"\n",(0,i.jsxs)(t.p,{children:["The list of annotations applicable to the current test. Includes annotations from the test, annotations from all ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-describe",children:"test.describe()"})," groups the test belongs to and file-level annotations for the test file."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-annotations",children:"test annotations"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.annotations\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"}),">","\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"type"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})]}),"\n",(0,i.jsxs)(t.p,{children:["Annotation type, for example ",(0,i.jsx)(t.code,{children:"'skip'"})," or ",(0,i.jsx)(t.code,{children:"'fail'"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional description."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"location"})," ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-location",title:"Location",children:"Location"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional location in the source where the annotation is added."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-attachments",children:"attachments"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.attachments"}),"\n",(0,i.jsx)(t.p,{children:"The list of files or buffers attached to the current test. Some reporters show test attachments."}),"\n",(0,i.jsxs)(t.p,{children:["To add an attachment, use ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-attach",children:"testInfo.attach()"})," instead of directly pushing onto this array."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.attachments\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"}),">","\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})]}),"\n",(0,i.jsx)(t.p,{children:"Attachment name."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"contentType"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})]}),"\n",(0,i.jsxs)(t.p,{children:["Content type of this attachment to properly present in the report, for example ",(0,i.jsx)(t.code,{children:"'application/json'"})," or ",(0,i.jsx)(t.code,{children:"'image/png'"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"path"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional path on the filesystem to the attached file."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"body"})," ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/buffer.html#buffer_class_buffer",title:"Buffer",children:"Buffer"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional attachment body used instead of a file."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-column",children:"column"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.column"}),"\n",(0,i.jsx)(t.p,{children:"Column number where the currently running test is declared."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.column\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-config",children:"config"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.config"}),"\n",(0,i.jsxs)(t.p,{children:["Processed configuration from the ",(0,i.jsx)(t.a,{href:"/docs/next/test-configuration",children:"configuration file"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.config\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"/docs/next/api/class-fullconfig",title:"FullConfig",children:"FullConfig"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-duration",children:"duration"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.duration"}),"\n",(0,i.jsxs)(t.p,{children:["The number of milliseconds the test took to finish. Always zero before the test finishes, either successfully or not. Can be used in ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-after-each",children:"test.afterEach()"})," hook."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.duration\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-error",children:"error"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.error"}),"\n",(0,i.jsxs)(t.p,{children:["First error thrown during test execution, if any. This is equal to the first element in ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-errors",children:"testInfo.errors"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.error\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfoerror",title:"TestInfoError",children:"TestInfoError"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-errors",children:"errors"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.errors"}),"\n",(0,i.jsx)(t.p,{children:"Errors thrown during test execution, if any."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.errors\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfoerror",title:"TestInfoError",children:"TestInfoError"}),">"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-expected-status",children:"expectedStatus"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.expectedStatus"}),"\n",(0,i.jsxs)(t.p,{children:["Expected status for the currently running test. This is usually ",(0,i.jsx)(t.code,{children:"'passed'"}),", except for a few cases:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'skipped'"})," for skipped tests, e.g. with ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-skip",children:"test.
1skip()"}),";"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'failed'"})," for tests marked as failed with ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-fail",children:"test.fail()"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["Expected status is usually compared with the actual ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-status",children:"testInfo.status"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest.afterEach(async ({}, testInfo) => {\n  if (testInfo.status !== testInfo.expectedStatus)\n    console.log(`${testInfo.title} did not run as expected!`);\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.expectedStatus\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:'"passed" | "failed" | "timedOut" | "skipped" | "interrupted"'}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-file",children:"file"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.file"}),"\n",(0,i.jsx)(t.p,{children:"Absolute path to a file where the currently running test is declared."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.file\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-fn",children:"fn"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.fn"}),"\n",(0,i.jsxs)(t.p,{children:["Test function as passed to ",(0,i.jsx)(t.code,{children:"test(title, testFunction)"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.fn\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-line",children:"line"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.line"}),"\n",(0,i.jsx)(t.p,{children:"Line number where the currently running test is declared."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.line\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-output-dir",children:"outputDir"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.outputDir"}),"\n",(0,i.jsx)(t.p,{children:"Absolute path to the output directory for this specific test run. Each test run gets its own directory so they cannot conflict."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.outputDir\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-parallel-index",children:"parallelIndex"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.parallelIndex"}),"\n",(0,i.jsxs)(t.p,{children:["The index of the worker between ",(0,i.jsx)(t.code,{children:"0"})," and ",(0,i.jsx)(t.code,{children:"workers - 1"}),". It is guaranteed that workers running at the same time have a different ",(0,i.jsx)(t.code,{children:"parallelIndex"}),". When a worker is restarted, for example after a failure, the new worker process has the same ",(0,i.jsx)(t.code,{children:"parallelIndex"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Also available as ",(0,i.jsx)(t.code,{children:"process.env.TEST_PARALLEL_INDEX"}),". Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-parallel",children:"parallelism and sharding"})," with Playwright Test."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.parallelIndex\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-project",children:"project"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.project"}),"\n",(0,i.jsxs)(t.p,{children:["Processed project configuration from the ",(0,i.jsx)(t.a,{href:"/docs/next/test-configuration",children:"configuration file"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.project\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"/docs/next/api/class-fullproject",title:"FullProject",children:"FullProject"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-repeat-each-index",children:"repeatEachIndex"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.repeatEachIndex"}),"\n",(0,i.jsxs)(t.p,{children:['Specifies a unique repeat index when running in "repeat each" mode. This mode is enabled by passing ',(0,i.jsx)(t.code,{children:"--repeat-each"})," to the ",(0,i.jsx)(t.a,{href:"/docs/next/test-cli",children:"command line"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.repeatEachIndex\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-retry",children:"retry"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.retry"}),"\n",(0,i.jsxs)(t.p,{children:["Specifies the retry number when the test is retried after a failure. The first test run has ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-retry",children:"testInfo.retry"}
1)," equal to zero, the first retry has it equal to one, and so on. Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-retries#retries",children:"retries"}),"."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest.beforeEach(async ({}, testInfo) => {\n  // You can access testInfo.retry in any hook or fixture.\n  if (testInfo.retry > 0)\n    console.log(`Retrying!`);\n});\n\ntest('my test', async ({ page }, testInfo) => {\n  // Here we clear some server-side state when retrying.\n  if (testInfo.retry)\n    await cleanSomeCachesOnTheServer();\n  // ...\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.retry\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-snapshot-dir",children:"snapshotDir"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.snapshotDir"}),"\n",(0,i.jsx)(t.p,{children:"Absolute path to the snapshot output directory for this specific test. Each test suite gets its own directory so they cannot conflict."}),"\n",(0,i.jsxs)(t.p,{children:["This property does not account for the ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testproject#test-project-snapshot-path-template",children:"testProject.snapshotPathTemplate"})," configuration."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.snapshotDir\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-snapshot-suffix",children:"snapshotSuffix"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.snapshotSuffix"}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Use of ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-snapshot-suffix",children:"testInfo.snapshotSuffix"})," is discouraged. Please use ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testconfig#test-config-snapshot-path-template",children:"testConfig.snapshotPathTemplate"})," to configure snapshot paths."]})}),"\n",(0,i.jsxs)(t.p,{children:["Suffix used to differentiate snapshots between multiple test configurations. For example, if snapshots depend on the platform, you can set ",(0,i.jsx)(t.code,{children:"testInfo.snapshotSuffix"})," equal to ",(0,i.jsx)(t.code,{children:"process.platform"}),". In this case ",(0,i.jsx)(t.code,{children:"expect(value).toMatchSnapshot(snapshotName)"})," will use different snapshots depending on the platform. Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-snapshots",children:"snapshots"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.snapshotSuffix\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-status",children:"status"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.status"}),"\n",(0,i.jsxs)(t.p,{children:["Actual status for the currently running test. Available after the test has finished in ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-test#test-after-each",children:"test.afterEach()"})," hook and fixtures."]}),"\n",(0,i.jsxs)(t.p,{children:["Status is usually compared with the ",(0,i.jsx)(t.a,{href:"/docs/next/api/class-testinfo#test-info-expected-status",children:"testInfo.expectedStatus"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest.afterEach(async ({}, testInfo) =>
1 {\n  if (testInfo.status !== testInfo.expectedStatus)\n    console.log(`${testInfo.title} did not run as expected!`);\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.status\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:'"passed" | "failed" | "timedOut" | "skipped" | "interrupted"'}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-tags",children:"tags"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.43"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.tags"}),"\n",(0,i.jsxs)(t.p,{children:["Tags that apply to the test. Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-annotations#tag-tests",children:"tags"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsx)(t.p,{children:"Any changes made to this list while the test is running will not be visible to test reporters."})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.tags\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-test-id",children:"testId"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.32"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.testId"}),"\n",(0,i.jsx)(t.p,{children:"Test id matching the test case id in the reporter API."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.testId\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-timeout",children:"timeout"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.timeout"}),"\n",(0,i.jsxs)(t.p,{children:["Timeout in milliseconds for the currently running test. Zero means no timeout. Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-timeouts",children:"various timeouts"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Timeout is usually specified in the ",(0,i.jsx)(t.a,{href:"/docs/next/test-configuration",children:"configuration file"})]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"import { test, expect } from '@playwright/test';\n\ntest.beforeEach(async ({ page }, testInfo) => {\n  // Extend timeout for all tests running this hook by 30 seconds.\n  testInfo.setTimeout(testInfo.timeout + 30000);\n});\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.timeout\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-title",children:"title"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.title"}),"\n",(0,i.jsxs)(t.p,{children:["The title of the currently running test as passed to ",(0,i.jsx)(t.code,{children:"test(title, testFunction)"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.title\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-title-path",children:"titlePath"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.titlePath"}),"\n",(0,i.jsx)(t.p,{children:"The full title path starting with the test file name."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.titlePath\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">"]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"test-info-worker-index",children:"workerIndex"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,i.jsx)("x-search",{children:"testInfo.workerIndex"}),"\n",(0,i.jsxs)(t.p,{children:["The unique index of the worker process that is running the test. When a worker is restarted, for example after a failure, the new worker process gets a new unique ",(0,i.jsx)(t.code,{children:"workerIndex"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Also available as ",(0,i.jsx)(t.code,{children:"process.env.TEST_WORKER_INDEX"}),". Learn more about ",(0,i.jsx)(t.a,{href:"/docs/next/test-parallel",children:"parallelism and sharding"})," with Playwright Test."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"testInfo.workerIndex\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Type"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]);

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.