PageSourceSearch

https://playwright.dev/assets/js/0baafdb1.478024c2.js

js playwright.dev collected 2026-09-24 06:56:28 UTC 6,328 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkplaywright_dev=self.webpackChunkplaywright_dev||[]).push([["5319"],{6962(e,r,n){n.r(r),n.d(r,{metadata:()=>s,default:()=>h,frontMatter:()=>o,contentTitle:()=>a,toc:()=>c,assets:()=>t});var s=JSON.parse('{"id":"api/class-workerinfo","title":"WorkerInfo","description":"WorkerInfo contains information about the worker that is running tests and is available to worker-scoped fixtures. WorkerInfo is a subset of [TestInfo] that is available in many other places.","source":"@site/versioned_docs/version-stable/api/class-workerinfo.mdx","sourceDirName":"api","slug":"/api/class-workerinfo","permalink":"/docs/api/class-workerinfo","draft":false,"unlisted":false,"tags":[],"version":"stable","frontMatter":{"id":"class-workerinfo","title":"WorkerInfo"},"sidebar":"api","previous":{"title":"TestStepInfo","permalink":"/docs/api/class-teststepinfo"},"next":{"title":"Reporter","permalink":"/docs/api/class-reporter"}}'),i=n(74848),l=n(28453);n(13554),n(41647),n(83137);let o={id:"class-workerinfo",title:"WorkerInfo"},a,t={},c=[{value:"Properties",id:"properties",level:2},{value:"config",id:"worker-info-config",level:3},{value:"parallelIndex",id:"worker-info-parallel-index",level:3},{value:"project",id:"worker-info-project",level:3},{value:"workerIndex",id:"worker-info-worker-index",level:3}];function d(e){let r={a:"a",code:"code",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.p,{children:[(0,i.jsx)(r.code,{children:"WorkerInfo"})," contains information about the worker that is running tests and is available to worker-scoped fixtures. ",(0,i.jsx)(r.code,{children:"WorkerInfo"})," is a subset of ",(0,i.jsx)(r.a,{href:"/docs/api/class-testinfo",title:"TestInfo",children:"TestInfo"})," that is available in many other places."]}),"\n",(0,i.jsx)(r.hr,{}),"\n",(0,i.jsx)(r.h2,{id:"properties",children:"Properties"}),"\n",(0,i.jsx)(r.h3,{id:"worker-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:"workerInfo.config"}),"\n",(0,i.jsxs)(r.p,{children:["Processed configuration from the ",(0,i.jsx)(r.a,{href:"/docs/test-configuration",children:"configuration file"}),"."]}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Usage"})}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-js",children:"workerInfo.config\n"})}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Type"})}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.a,{href:"/docs/api/class-fullconfig",title:"FullConfig",children:"FullConfig"})}),"\n"]}),"\n",(0,i.jsx)(r.hr,{}),"\n",(0,i.jsx)(r.h3,{id:"worker-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:"workerInfo.parallelIndex"}),"\n",(0,i.jsxs)(r.p,{children:["The index of the worker between ",(0,i.jsx)(r.code,{children:"0"})," and ",(0,i.jsx)(r.code,{children:"workers - 1"}),". It is guaranteed that workers running at the same time have a different ",(0,i.jsx)(r.code,{children:"parallelIndex"}),". When a worker is restarted, for example after a failure, the new worker process has the same ",(0,i.jsx)(r.code,{children:"parallelIndex"}),"."]}),"\n",(0,i.jsxs)(r.p,{children:["Also available as ",(0,i.jsx)(r.code,{children:"process.env.TEST_PARALLEL_INDEX"}),". Learn more about ",(0,i.jsx)(r.a,{href:"/docs/test-parallel",children:"parallelism and sharding"})," with Playwright Test."]}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Usage"})}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-js",children:"workerInfo.parallelIndex\n"})}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Type"})}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})}),"\n"]}),"\n",(0,i.jsx)(r.hr,{}),"\n",(0,i.jsx)(r.h3,{id:"worker-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:"workerInfo.project"}),"\n",(0,i.jsxs)(r.p,{children:["Processed project configuration from the ",(0,i.jsx)(r.a,{href:"/docs/test-configuration",children:"configuration file"}),"."]}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Usage"})}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-js",children:"workerInfo.project\n"})}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Type"})}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.a,{href:"/docs/api/class-fullproject",title:"FullProject",children:"FullProject"})}),"\n"]}),"\n",(0,i.jsx)(r.hr,{}),"\n",(0,i.jsx)(r.h3,{id:"worker-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:"workerInfo.workerIndex"}),"\n",(0,i.jsxs)(r.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)(r.code,{children:"workerIndex"}),"."]}),"\n",(0,i.jsxs)(r.p,{children:["Also available as ",(0,i.jsx)(r.code,{children:"process.env.TEST_WORKER_INDEX"}),". Learn more about ",(0,i.jsx)(r.a,{href:"/docs/test-parallel",children:"parallelism and sharding"})," with Playwright Test."]}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Usage"})}),"\n",(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-js",children:"workerInfo.workerIndex\n"})}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"Type"})}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:(0,i.jsx)(r.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:r}={...(0,l.R)(),...e.components};return r?(0,i.jsx)(r,{...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.