{
  "format": 3,
  "id": "0.1",
  "title": "Concept map of a Playwright test run",
  "layers": {
    "runner": {
      "label": "Runner"
    },
    "browser": {
      "label": "Browser"
    },
    "app": {
      "label": "App"
    },
    "client": {
      "label": "Client"
    },
    "server": {
      "label": "Server"
    },
    "page": {
      "label": "Page"
    }
  },
  "lanes": {
    "runner": {
      "label": "RUNNER PROCESS",
      "layer": "runner",
      "y": 6,
      "h": 128
    },
    "worker": {
      "label": "WORKER PROCESS",
      "layer": "runner",
      "y": 146,
      "h": 342
    },
    "browser": {
      "label": "BROWSER PROCESS",
      "layer": "browser",
      "y": 504,
      "h": 128
    },
    "app": {
      "label": "YOUR APP",
      "layer": "app",
      "y": 646,
      "h": 84
    }
  },
  "frames": {
    "fixtures": {
      "label": "FIXTURES",
      "showWith": [
        "pw",
        "request"
      ],
      "box": [
        12,
        272,
        396,
        158
      ]
    }
  },
  "nodes": {
    "cli": {
      "label": "npx playwright test",
      "layer": "runner",
      "lane": "runner",
      "mono": true,
      "box": [
        16,
        32,
        184,
        34
      ]
    },
    "config": {
      "label": "playwright.config",
      "layer": "runner",
      "lane": "runner",
      "mono": true,
      "box": [
        220,
        32,
        184,
        34
      ]
    },
    "files": {
      "label": "Test files → groups",
      "layer": "runner",
      "lane": "runner",
      "box": [
        16,
        86,
        184,
        34
      ]
    },
    "dispatch": {
      "label": "Dispatcher · worker slots",
      "layer": "runner",
      "lane": "runner",
      "box": [
        220,
        86,
        184,
        34
      ]
    },
    "test": {
      "label": "test('…', async ({ page }) => …)",
      "layer": "runner",
      "lane": "worker",
      "mono": true,
      "box": [
        16,
        172,
        388,
        34
      ]
    },
    "client": {
      "label": "client",
      "layer": "client",
      "lane": "worker",
      "mono": true,
      "box": [
        16,
        224,
        184,
        34
      ]
    },
    "server": {
      "label": "server",
      "layer": "server",
      "lane": "worker",
      "mono": true,
      "box": [
        220,
        224,
        184,
        34
      ]
    },
    "pw": {
      "label": "playwright",
      "layer": "runner",
      "lane": "worker",
      "tag": "worker · built-in",
      "mono": true,
      "box": [
        22,
        300,
        120,
        40
      ]
    },
    "request": {
      "label": "request",
      "layer": "runner",
      "lane": "worker",
      "tag": "test · built-in",
      "mono": true,
      "box": [
        151,
        300,
        120,
        40
      ]
    },
    "yours": {
      "label": "your fixtures",
      "layer": "runner",
      "lane": "worker",
      "tag": "test.extend",
      "custom": true,
      "box": [
        280,
        300,
        120,
        40
      ]
    },
    "browserFx": {
      "label": "browser",
      "layer": "runner",
      "lane": "worker",
      "tag": "worker · built-in",
      "mono": true,
      "box": [
        22,
        380,
        120,
        40
      ]
    },
    "contextFx": {
      "label": "context",
      "layer": "runner",
      "lane": "worker",
      "tag": "test · built-in",
      "mono": true,
      "box": [
        151,
        380,
        120,
        40
      ]
    },
    "pageFx": {
      "label": "page",
      "layer": "runner",
      "lane": "worker",
      "tag": "test · built-in",
      "mono": true,
      "box": [
        280,
        380,
        120,
        40
      ]
    },
    "Browser": {
      "label": "Browser",
      "layer": "browser",
      "lane": "browser",
      "box": [
        22,
        534,
        120,
        34
      ]
    },
    "Context": {
      "label": "Context",
      "layer": "page",
      "lane": "browser",
      "box": [
        151,
        534,
        120,
        34
      ]
    },
    "Page": {
      "label": "Page",
      "layer": "page",
      "lane": "browser",
      "box": [
        280,
        534,
        120,
        34
      ]
    },
    "app": {
      "label": "Your app · https://app.example",
      "layer": "app",
      "lane": "app",
      "box": [
        16,
        684,
        388,
        34
      ]
    },
    "cookies": {
      "label": "Context cookies",
      "layer": "page",
      "lane": "browser",
      "box": [
        151,
        594,
        249,
        34
      ]
    },
    "pageRequest": {
      "label": "page.request",
      "layer": "server",
      "lane": "worker",
      "mono": true,
      "box": [
        16,
        444,
        184,
        34
      ]
    },
    "apiCookies": {
      "label": "API cookies · own jar",
      "layer": "server",
      "lane": "worker",
      "box": [
        220,
        444,
        184,
        34
      ]
    }
  },
  "edges": {
    "cli_config": {
      "from": "cli",
      "to": "config",
      "path": "M200,49 H218",
      "badge": [
        209,
        49
      ]
    },
    "config_files": {
      "from": "config",
      "to": "files",
      "path": "M312,66 V76 H108 V84",
      "badge": [
        210,
        76
      ]
    },
    "files_dispatch": {
      "from": "files",
      "to": "dispatch",
      "path": "M200,103 H218",
      "badge": [
        209,
        103
      ]
    },
    "dispatch_test": {
      "from": "dispatch",
      "to": "test",
      "path": "M312,120 V170",
      "badge": [
        312,
        152
      ]
    },
    "pw_browser": {
      "from": "pw",
      "to": "browserFx",
      "path": "M82,340 V378",
      "badge": [
        82,
        360
      ]
    },
    "browser_ctx": {
      "from": "browserFx",
      "to": "contextFx",
      "path": "M142,400 H149"
    },
    "ctx_page": {
      "from": "contextFx",
      "to": "pageFx",
      "path": "M271,400 H278"
    },
    "pw_request": {
      "from": "pw",
      "to": "request",
      "path": "M142,320 H149"
    },
    "mk_browser": {
      "from": "browserFx",
      "to": "Browser",
      "dashed": true,
      "path": "M82,420 H8 V551 H20",
      "badge": [
        8,
        490
      ]
    },
    "mk_ctx": {
      "from": "contextFx",
      "to": "Context",
      "dashed": true,
      "path": "M211,420 V532",
      "badge": [
        211,
        470
      ]
    },
    "mk_page": {
      "from": "pageFx",
      "to": "Page",
      "dashed": true,
      "path": "M340,420 V532",
      "badge": [
        340,
        470
      ]
    },
    "test_client": {
      "from": "test",
      "to": "client",
      "path": "M108,206 V222"
    },
    "client_server": {
      "from": "client",
      "to": "server",
      "path": "M200,241 H218",
      "badge": [
        209,
        241
      ]
    },
    "server_page": {
      "from": "server",
      "to": "Page",
      "path": "M404,241 H412 V551 H402",
      "badge": [
        412,
        280
      ]
    },
    "page_app": {
      "from": "Page",
      "to": "app",
      "path": "M340,568 H408 V701 H406",
      "badge": [
        408,
        650
      ]
    },
    "server_app": {
      "from": "server",
      "to": "app",
      "path": "M404,241 H416 V701 H406",
      "badge": [
        416,
        560
      ]
    },
    "shared": {
      "from": "pageRequest",
      "to": "cookies",
      "label": {
        "at": [
          220,
          490
        ],
        "text": "shares context cookies"
      },
      "dashed": true,
      "path": "M200,461 H408 V611 H402",
      "badge": [
        408,
        500
      ]
    },
    "cookie_page": {
      "from": "cookies",
      "to": "Page",
      "path": "M275,594 V580 H340 V570",
      "badge": [
        310,
        580
      ]
    },
    "request_cookies": {
      "from": "request",
      "to": "apiCookies",
      "label": {
        "at": [
          219,
          375
        ],
        "text": "owns cookie jar"
      },
      "dashed": true,
      "path": "M211,340 V354 H416 V461 H406",
      "badge": [
        416,
        400
      ]
    }
  },
  "scenarios": [
    {
      "id": "web",
      "label": "Web",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "test": "test('…', async ({ page }) => …)"
      },
      "whole": {
        "title": "A web test, start to finish",
        "text": "The numbers on the map follow the run."
      },
      "steps": [
        {
          "id": "you-start-the-runner",
          "title": "You start the runner",
          "text": "`npx playwright test` is the entry point. It starts the runner, the Node process that manages the whole run.",
          "show": [
            "cli"
          ],
          "current": [
            "cli"
          ],
          "edges": [],
          "defs": [
            "runner"
          ],
          "sources": [
            {
              "label": "program.ts:41",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/program.ts#L41"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "the-runner-loads-the-config",
          "title": "The runner loads the config",
          "text": "The runner loads `playwright.config` and validates it. Command-line options override config values. webServer and global setup run before any test.",
          "show": [
            "config"
          ],
          "current": [
            "config"
          ],
          "edges": [
            "cli_config"
          ],
          "defs": [
            "config"
          ],
          "sources": [
            {
              "label": "testActions.ts:27-31",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/cli/testActions.ts#L27-L31"
            },
            {
              "label": "configLoader.ts:106-109",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/configLoader.ts#L106-L109"
            },
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "it-finds-tests-and-groups-them",
          "title": "It finds tests and groups them",
          "text": "The runner keeps the test files that match `testMatch`. Tests with the same project and worker fixtures, from one file, form a group.",
          "show": [
            "files"
          ],
          "current": [
            "files"
          ],
          "edges": [
            "config_files"
          ],
          "defs": [
            "group"
          ],
          "sources": [
            {
              "label": "projectUtils.ts:147-160",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/projectUtils.ts#L147-L160"
            },
            {
              "label": "testGroups.ts:68-81",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testGroups.ts#L68-L81"
            },
            {
              "label": "suiteUtils.ts:76-78",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L76-L78"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "the-dispatcher-starts-a-worker",
          "title": "The dispatcher starts a worker",
          "text": "The dispatcher has one slot per worker (the `workers` option). It forks a worker process and gives it a group of tests.",
          "show": [
            "dispatch",
            "test"
          ],
          "current": [
            "dispatch",
            "test"
          ],
          "edges": [
            "files_dispatch",
            "dispatch_test"
          ],
          "defs": [
            "worker"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:236-240",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L236-L240"
            },
            {
              "label": "processHost.ts:54-63",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/processHost.ts#L54-L63"
            },
            {
              "label": "workerHost.ts:40-51",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/workerHost.ts#L40-L51"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "your-test-asks-for-fixtures",
          "title": "Your test asks for fixtures",
          "text": "The worker runs its tests one after another. Your test names what it needs in its first argument: `async ({ page })`. Each name is a fixture.",
          "show": [],
          "current": [
            "test"
          ],
          "edges": [],
          "defs": [
            "fixture"
          ],
          "sources": [
            {
              "label": "workerMain.ts:242-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/workerMain.ts#L242-L250"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "fixtures-start-dependencies-firs",
          "title": "Fixtures start, dependencies first",
          "text": "Before the test body, Playwright collects automatic fixtures and the ones you named. Dependencies start first: `playwright` → `browser` → `context` → `page`. Fixtures you add with `test.extend` join the same graph.",
          "show": [
            "pw",
            "browserFx",
            "contextFx",
            "pageFx",
            "yours",
            "request"
          ],
          "current": [
            "pw",
            "browserFx",
            "contextFx",
            "pageFx"
          ],
          "edges": [
            "pw_browser",
            "browser_ctx",
            "ctx_page"
          ],
          "defs": [
            "builtin",
            "custom",
            "scope"
          ],
          "sources": [
            {
              "label": "fixtureRunner.ts:236-258",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L236-L258"
            },
            {
              "label": "fixtureRunner.ts:203-210",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L203-L210"
            },
            {
              "label": "index.ts:474",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L474"
            },
            {
              "label": "index.ts:494-499",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L494-L499"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.5 Options reset values, autos choose when to start",
              "href": "/4-runner/4-5-option-and-auto-fixtures/"
            }
          ]
        },
        {
          "id": "browser-launches-a-browser-proce",
          "title": "browser launches a browser process",
          "text": "The `browser` fixture launches a browser, a separate process. It has worker scope: one browser serves every test in this worker.",
          "show": [
            "Browser"
          ],
          "current": [
            "browserFx",
            "Browser"
          ],
          "edges": [
            "mk_browser"
          ],
          "defs": [
            "browser"
          ],
          "sources": [
            {
              "label": "index.ts:238-262",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L238-L262"
            },
            {
              "label": "browserType.ts:210-225",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L210-L225"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            }
          ]
        },
        {
          "id": "each-test-gets-a-new-context-and",
          "title": "Each test gets a new context and page",
          "text": "`context` and `page` have test scope, the default. Every test gets a new context in the shared browser, and a page in that context.",
          "show": [
            "Context",
            "Page"
          ],
          "current": [
            "contextFx",
            "pageFx",
            "Context",
            "Page"
          ],
          "edges": [
            "mk_ctx",
            "mk_page"
          ],
          "defs": [
            "context",
            "page"
          ],
          "sources": [
            {
              "label": "fixtures.ts:127",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L127"
            },
            {
              "label": "index.ts:474-492",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L474-L492"
            },
            {
              "label": "index.ts:494-499",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L494-L499"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            }
          ]
        },
        {
          "id": "page-goto-travels-to-your-app",
          "title": "page.goto travels to your app",
          "text": "`await page.goto('/')` becomes a message from client to server. Both live in the worker process. The server tells the browser to navigate, and the page loads your app.",
          "show": [
            "client",
            "server",
            "app"
          ],
          "current": [
            "client",
            "server",
            "Page",
            "app"
          ],
          "edges": [
            "test_client",
            "client_server",
            "server_page",
            "page_app"
          ],
          "defs": [
            "client"
          ],
          "log": [
            "navigating to \"https://app.example/\", waiting until \"load\""
          ],
          "sources": [
            {
              "label": "inprocess.ts:27-41",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L27-L41"
            },
            {
              "label": "crPage.ts:617-619",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/chromium/crPage.ts#L617-L619"
            }
          ],
          "deeper": [
            {
              "title": "1.1 A failed call comes back with its name and its call log",
              "href": "/1-messages/1-1-one-call-two-processes/"
            }
          ]
        },
        {
          "id": "after-the-test-teardown-runs-in",
          "title": "After the test, teardown runs in reverse",
          "text": "Fixtures tear down in reverse order: `page`, then `context`. The browser stays for the next test in this worker and closes when the worker stops.",
          "show": [],
          "current": [
            "pageFx",
            "contextFx"
          ],
          "edges": [],
          "defs": [],
          "sources": [
            {
              "label": "fixtureRunner.ts:213-215",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L213-L215"
            },
            {
              "label": "index.ts:257-262",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L257-L262"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "cli",
          "step": "you-start-the-runner",
          "log": []
        },
        {
          "node": "config",
          "step": "the-runner-loads-the-config",
          "log": [],
          "edge": "cli_config"
        },
        {
          "node": "files",
          "step": "it-finds-tests-and-groups-them",
          "log": [],
          "edge": "config_files"
        },
        {
          "node": "dispatch",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "files_dispatch"
        },
        {
          "node": "test",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "dispatch_test"
        },
        {
          "node": "test",
          "step": "your-test-asks-for-fixtures",
          "log": []
        },
        {
          "node": "browserFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "pw_browser"
        },
        {
          "node": "contextFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "browser_ctx"
        },
        {
          "node": "pageFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "ctx_page"
        },
        {
          "node": "Browser",
          "step": "browser-launches-a-browser-proce",
          "log": [],
          "edge": "mk_browser"
        },
        {
          "node": "Context",
          "step": "each-test-gets-a-new-context-and",
          "log": [],
          "edge": "mk_ctx"
        },
        {
          "node": "Page",
          "step": "each-test-gets-a-new-context-and",
          "log": [],
          "edge": "mk_page"
        },
        {
          "node": "client",
          "step": "page-goto-travels-to-your-app",
          "log": [],
          "edge": "test_client"
        },
        {
          "node": "server",
          "step": "page-goto-travels-to-your-app",
          "log": [],
          "edge": "client_server"
        },
        {
          "node": "Page",
          "step": "page-goto-travels-to-your-app",
          "log": [],
          "edge": "server_page"
        },
        {
          "node": "app",
          "step": "page-goto-travels-to-your-app",
          "log": [
            "navigating to \"https://app.example/\", waiting until \"load\""
          ],
          "edge": "page_app"
        },
        {
          "node": "pageFx",
          "step": "after-the-test-teardown-runs-in",
          "log": []
        }
      ]
    },
    {
      "id": "api",
      "label": "API",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "test": "test('…', async ({ request }) => …)"
      },
      "whole": {
        "title": "An API test, start to finish",
        "text": "The numbers on the map follow the run."
      },
      "steps": [
        {
          "id": "you-start-the-runner",
          "title": "You start the runner",
          "text": "`npx playwright test` is the entry point. It starts the runner, the Node process that manages the whole run.",
          "show": [
            "cli"
          ],
          "current": [
            "cli"
          ],
          "edges": [],
          "defs": [
            "runner"
          ],
          "sources": [
            {
              "label": "program.ts:41",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/program.ts#L41"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "the-runner-loads-the-config",
          "title": "The runner loads the config",
          "text": "The runner loads `playwright.config` and validates it. Command-line options override config values. webServer and global setup run before any test.",
          "show": [
            "config"
          ],
          "current": [
            "config"
          ],
          "edges": [
            "cli_config"
          ],
          "defs": [
            "config"
          ],
          "sources": [
            {
              "label": "testActions.ts:27-31",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/cli/testActions.ts#L27-L31"
            },
            {
              "label": "configLoader.ts:106-109",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/configLoader.ts#L106-L109"
            },
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "it-finds-tests-and-groups-them",
          "title": "It finds tests and groups them",
          "text": "The runner keeps the test files that match `testMatch`. Tests with the same project and worker fixtures, from one file, form a group.",
          "show": [
            "files"
          ],
          "current": [
            "files"
          ],
          "edges": [
            "config_files"
          ],
          "defs": [
            "group"
          ],
          "sources": [
            {
              "label": "projectUtils.ts:147-160",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/projectUtils.ts#L147-L160"
            },
            {
              "label": "testGroups.ts:68-81",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testGroups.ts#L68-L81"
            },
            {
              "label": "suiteUtils.ts:76-78",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L76-L78"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "the-dispatcher-starts-a-worker",
          "title": "The dispatcher starts a worker",
          "text": "The dispatcher has one slot per worker (the `workers` option). It forks a worker process and gives it a group of tests.",
          "show": [
            "dispatch",
            "test"
          ],
          "current": [
            "dispatch",
            "test"
          ],
          "edges": [
            "files_dispatch",
            "dispatch_test"
          ],
          "defs": [
            "worker"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:236-240",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L236-L240"
            },
            {
              "label": "processHost.ts:54-63",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/processHost.ts#L54-L63"
            },
            {
              "label": "workerHost.ts:40-51",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/workerHost.ts#L40-L51"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "your-test-asks-for-request",
          "title": "Your test asks for request",
          "text": "The worker runs its tests one after another. This test names one fixture: `async ({ request })`.",
          "show": [],
          "current": [
            "test"
          ],
          "edges": [],
          "defs": [
            "fixture"
          ],
          "sources": [
            {
              "label": "workerMain.ts:242-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/workerMain.ts#L242-L250"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "request-needs-no-browser",
          "title": "request needs no browser",
          "text": "`request` depends only on `playwright`. The browser, context and page fixtures do not run, so no browser starts.",
          "show": [
            "pw",
            "request",
            "browserFx",
            "contextFx",
            "pageFx",
            "yours"
          ],
          "current": [
            "pw",
            "request"
          ],
          "edges": [
            "pw_request"
          ],
          "defs": [
            "request",
            "builtin",
            "scope"
          ],
          "code": "request",
          "sources": [
            {
              "label": "index.ts:191-205",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L205"
            },
            {
              "label": "fixtureRunner.ts:236-258",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L236-L258"
            }
          ],
          "deeper": [
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            },
            {
              "title": "4.5 Options reset values, autos choose when to start",
              "href": "/4-runner/4-5-option-and-auto-fixtures/"
            }
          ]
        },
        {
          "id": "node-sends-the-http-request",
          "title": "Node sends the HTTP request",
          "text": "`request.post('/api/login')` goes from client to server like a page call. The server sends the HTTP request from Node, with http or https.",
          "show": [
            "client",
            "server",
            "app"
          ],
          "current": [
            "client",
            "server",
            "app"
          ],
          "edges": [
            "test_client",
            "client_server",
            "server_app"
          ],
          "defs": [
            "client"
          ],
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "sources": [
            {
              "label": "fetch.ts:269-285",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L269-L285"
            },
            {
              "label": "networkDispatchers.ts:235-238",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L235-L238"
            },
            {
              "label": "fetch.ts:351-352",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L351-L352"
            }
          ],
          "deeper": [
            {
              "title": "1.1 A failed call comes back with its name and its call log",
              "href": "/1-messages/1-1-one-call-two-processes/"
            },
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        },
        {
          "id": "the-request-fixture-owns-its-coo",
          "title": "The request fixture owns its cookie jar",
          "text": "The response cookie goes into this API context’s own jar. Optionally, `storageState()` copies its cookies into a new browser context once; the two jars then stay separate. This API test itself needs no browser.",
          "show": [
            "apiCookies"
          ],
          "current": [
            "apiCookies",
            "request"
          ],
          "edges": [
            "request_cookies"
          ],
          "defs": [
            "ownCookies"
          ],
          "code": "state",
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "sources": [
            {
              "label": "fetch.ts:750-761",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L750-L761"
            },
            {
              "label": "fetch.ts:812-818",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L812-L818"
            },
            {
              "label": "browserContext.ts:666-680",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserContext.ts#L666-L680"
            }
          ],
          "deeper": [
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            },
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            }
          ]
        },
        {
          "id": "after-the-test-the-api-context-i",
          "title": "After the test, the API context is disposed",
          "text": "When the test ends, the `request` fixture disposes its API context, with its cookies.",
          "show": [],
          "current": [
            "request"
          ],
          "edges": [],
          "defs": [],
          "sources": [
            {
              "label": "index.ts:191-205",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L205"
            }
          ],
          "deeper": [
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "cli",
          "step": "you-start-the-runner",
          "log": []
        },
        {
          "node": "config",
          "step": "the-runner-loads-the-config",
          "log": [],
          "edge": "cli_config"
        },
        {
          "node": "files",
          "step": "it-finds-tests-and-groups-them",
          "log": [],
          "edge": "config_files"
        },
        {
          "node": "dispatch",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "files_dispatch"
        },
        {
          "node": "test",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "dispatch_test"
        },
        {
          "node": "test",
          "step": "your-test-asks-for-request",
          "log": []
        },
        {
          "node": "request",
          "step": "request-needs-no-browser",
          "log": [],
          "edge": "pw_request"
        },
        {
          "node": "client",
          "step": "node-sends-the-http-request",
          "log": [],
          "edge": "test_client"
        },
        {
          "node": "server",
          "step": "node-sends-the-http-request",
          "log": [],
          "edge": "client_server"
        },
        {
          "node": "app",
          "step": "node-sends-the-http-request",
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "edge": "server_app"
        },
        {
          "node": "apiCookies",
          "step": "the-request-fixture-owns-its-coo",
          "log": [],
          "edge": "request_cookies"
        },
        {
          "node": "request",
          "step": "after-the-test-the-api-context-i",
          "log": []
        }
      ]
    },
    {
      "id": "combined",
      "label": "Combined",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "test": "test('…', async ({ page }) => …)"
      },
      "whole": {
        "title": "page.request, start to finish",
        "text": "The numbers on the map follow the run."
      },
      "steps": [
        {
          "id": "you-start-the-runner",
          "title": "You start the runner",
          "text": "`npx playwright test` is the entry point. It starts the runner, the Node process that manages the whole run.",
          "show": [
            "cli"
          ],
          "current": [
            "cli"
          ],
          "edges": [],
          "defs": [
            "runner"
          ],
          "sources": [
            {
              "label": "program.ts:41",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/program.ts#L41"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "the-runner-loads-the-config",
          "title": "The runner loads the config",
          "text": "The runner loads `playwright.config` and validates it. Command-line options override config values. webServer and global setup run before any test.",
          "show": [
            "config"
          ],
          "current": [
            "config"
          ],
          "edges": [
            "cli_config"
          ],
          "defs": [
            "config"
          ],
          "sources": [
            {
              "label": "testActions.ts:27-31",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/cli/testActions.ts#L27-L31"
            },
            {
              "label": "configLoader.ts:106-109",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/configLoader.ts#L106-L109"
            },
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            }
          ],
          "deeper": [
            {
              "title": "4.1 Projects wait for successful dependencies",
              "href": "/4-runner/4-1-config-and-projects/"
            }
          ]
        },
        {
          "id": "it-finds-tests-and-groups-them",
          "title": "It finds tests and groups them",
          "text": "The runner keeps the test files that match `testMatch`. Tests with the same project and worker fixtures, from one file, form a group.",
          "show": [
            "files"
          ],
          "current": [
            "files"
          ],
          "edges": [
            "config_files"
          ],
          "defs": [
            "group"
          ],
          "sources": [
            {
              "label": "projectUtils.ts:147-160",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/projectUtils.ts#L147-L160"
            },
            {
              "label": "testGroups.ts:68-81",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testGroups.ts#L68-L81"
            },
            {
              "label": "suiteUtils.ts:76-78",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L76-L78"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "the-dispatcher-starts-a-worker",
          "title": "The dispatcher starts a worker",
          "text": "The dispatcher has one slot per worker (the `workers` option). It forks a worker process and gives it a group of tests.",
          "show": [
            "dispatch",
            "test"
          ],
          "current": [
            "dispatch",
            "test"
          ],
          "edges": [
            "files_dispatch",
            "dispatch_test"
          ],
          "defs": [
            "worker"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:236-240",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L236-L240"
            },
            {
              "label": "processHost.ts:54-63",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/processHost.ts#L54-L63"
            },
            {
              "label": "workerHost.ts:40-51",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/workerHost.ts#L40-L51"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "your-test-asks-for-fixtures",
          "title": "Your test asks for fixtures",
          "text": "The worker runs its tests one after another. Your test names what it needs in its first argument: `async ({ page })`. Each name is a fixture.",
          "show": [],
          "current": [
            "test"
          ],
          "edges": [],
          "defs": [
            "fixture"
          ],
          "sources": [
            {
              "label": "workerMain.ts:242-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/workerMain.ts#L242-L250"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "fixtures-start-dependencies-firs",
          "title": "Fixtures start, dependencies first",
          "text": "Before the test body, Playwright collects automatic fixtures and the ones you named. Dependencies start first: `playwright` → `browser` → `context` → `page`. Fixtures you add with `test.extend` join the same graph.",
          "show": [
            "pw",
            "browserFx",
            "contextFx",
            "pageFx",
            "yours"
          ],
          "current": [
            "pw",
            "browserFx",
            "contextFx",
            "pageFx"
          ],
          "edges": [
            "pw_browser",
            "browser_ctx",
            "ctx_page"
          ],
          "defs": [
            "builtin",
            "custom",
            "scope"
          ],
          "sources": [
            {
              "label": "fixtureRunner.ts:236-258",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L236-L258"
            },
            {
              "label": "fixtureRunner.ts:203-210",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L203-L210"
            },
            {
              "label": "index.ts:474",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L474"
            },
            {
              "label": "index.ts:494-499",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L494-L499"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.5 Options reset values, autos choose when to start",
              "href": "/4-runner/4-5-option-and-auto-fixtures/"
            }
          ]
        },
        {
          "id": "browser-launches-a-browser-proce",
          "title": "browser launches a browser process",
          "text": "The `browser` fixture launches a browser, a separate process. It has worker scope: one browser serves every test in this worker.",
          "show": [
            "Browser"
          ],
          "current": [
            "browserFx",
            "Browser"
          ],
          "edges": [
            "mk_browser"
          ],
          "defs": [
            "browser"
          ],
          "sources": [
            {
              "label": "index.ts:238-262",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L238-L262"
            },
            {
              "label": "browserType.ts:210-225",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/browserType.ts#L210-L225"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            }
          ]
        },
        {
          "id": "each-test-gets-a-new-context-and",
          "title": "Each test gets a new context and page",
          "text": "`context` and `page` have test scope, the default. Every test gets a new context in the shared browser, and a page in that context.",
          "show": [
            "Context",
            "Page"
          ],
          "current": [
            "contextFx",
            "pageFx",
            "Context",
            "Page"
          ],
          "edges": [
            "mk_ctx",
            "mk_page"
          ],
          "defs": [
            "context",
            "page"
          ],
          "sources": [
            {
              "label": "fixtures.ts:127",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L127"
            },
            {
              "label": "index.ts:474-492",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L474-L492"
            },
            {
              "label": "index.ts:494-499",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L494-L499"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            }
          ]
        },
        {
          "id": "page-request-shares-the-context",
          "title": "page.request shares the context’s cookies",
          "text": "`page.request` belongs to the page’s browser context. It sends that context’s cookies and stores response cookies there.",
          "show": [
            "pageRequest",
            "cookies",
            "client",
            "server"
          ],
          "current": [
            "pageRequest",
            "Context",
            "cookies"
          ],
          "edges": [
            "test_client",
            "client_server",
            "shared"
          ],
          "defs": [
            "sharedCookies",
            "client"
          ],
          "code": "combined",
          "sources": [
            {
              "label": "page.ts:142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "fetch.ts:732-738",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            }
          ],
          "deeper": [
            {
              "title": "1.1 A failed call comes back with its name and its call log",
              "href": "/1-messages/1-1-one-call-two-processes/"
            },
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            },
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        },
        {
          "id": "node-sends-the-request-not-the-p",
          "title": "Node sends the request, not the page",
          "text": "`page.request.post('/api/login')` leaves from Node with `http` or `https`. `page.route` does not see it.",
          "show": [
            "app"
          ],
          "current": [
            "server",
            "pageRequest",
            "app"
          ],
          "edges": [
            "server_app"
          ],
          "defs": [],
          "code": "combined",
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "sources": [
            {
              "label": "fetch.ts:351-352",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L351-L352"
            },
            {
              "label": "page.ts:636-639",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L636-L639"
            }
          ],
          "deeper": [
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        },
        {
          "id": "the-response-cookie-goes-into-th",
          "title": "The response cookie goes into the context’s jar",
          "text": "The API response’s `Set-Cookie` goes into the browser context’s jar, shared with the page.",
          "show": [],
          "current": [
            "cookies",
            "Context"
          ],
          "edges": [],
          "defs": [],
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "sources": [
            {
              "label": "fetch.ts:441-448",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L441-L448"
            },
            {
              "label": "fetch.ts:732-738",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            },
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        },
        {
          "id": "a-cookie-login-carries-over-to-t",
          "title": "A cookie login carries over to the page",
          "text": "`page.goto('/account')` sends the same cookie. When the app keeps its login in a cookie, the API login also logs in the page.",
          "show": [],
          "current": [
            "cookies",
            "Page",
            "app"
          ],
          "edges": [
            "cookie_page",
            "page_app"
          ],
          "defs": [],
          "code": "combined",
          "log": [
            "navigating to \"https://app.example/account\", waiting until \"load\""
          ],
          "sources": [
            {
              "label": "class-apirequestcontext.md:14-20",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/docs/src/api/class-apirequestcontext.md#L14-L20"
            },
            {
              "label": "frames.ts:695-697",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L695-L697"
            }
          ],
          "deeper": [
            {
              "title": "1.2 Contexts divide state, pages contain frame trees",
              "href": "/1-messages/1-2-browser-context-page-frame/"
            },
            {
              "title": "3.3 An API response lives only as long as its context",
              "href": "/3-network/3-3-api-requests/"
            }
          ]
        },
        {
          "id": "after-the-test-teardown-runs-in",
          "title": "After the test, teardown runs in reverse",
          "text": "Fixtures tear down in reverse order: `page`, then `context`. The browser stays for the next test in this worker and closes when the worker stops.",
          "show": [],
          "current": [
            "pageFx",
            "contextFx"
          ],
          "edges": [],
          "defs": [],
          "sources": [
            {
              "label": "fixtureRunner.ts:213-215",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/fixtureRunner.ts#L213-L215"
            },
            {
              "label": "index.ts:257-262",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L257-L262"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "cli",
          "step": "you-start-the-runner",
          "log": []
        },
        {
          "node": "config",
          "step": "the-runner-loads-the-config",
          "log": [],
          "edge": "cli_config"
        },
        {
          "node": "files",
          "step": "it-finds-tests-and-groups-them",
          "log": [],
          "edge": "config_files"
        },
        {
          "node": "dispatch",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "files_dispatch"
        },
        {
          "node": "test",
          "step": "the-dispatcher-starts-a-worker",
          "log": [],
          "edge": "dispatch_test"
        },
        {
          "node": "test",
          "step": "your-test-asks-for-fixtures",
          "log": []
        },
        {
          "node": "browserFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "pw_browser"
        },
        {
          "node": "contextFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "browser_ctx"
        },
        {
          "node": "pageFx",
          "step": "fixtures-start-dependencies-firs",
          "log": [],
          "edge": "ctx_page"
        },
        {
          "node": "Browser",
          "step": "browser-launches-a-browser-proce",
          "log": [],
          "edge": "mk_browser"
        },
        {
          "node": "Context",
          "step": "each-test-gets-a-new-context-and",
          "log": [],
          "edge": "mk_ctx"
        },
        {
          "node": "Page",
          "step": "each-test-gets-a-new-context-and",
          "log": [],
          "edge": "mk_page"
        },
        {
          "node": "client",
          "step": "page-request-shares-the-context",
          "log": [],
          "edge": "test_client"
        },
        {
          "node": "server",
          "step": "page-request-shares-the-context",
          "log": [],
          "edge": "client_server"
        },
        {
          "node": "cookies",
          "step": "page-request-shares-the-context",
          "log": [],
          "edge": "shared"
        },
        {
          "node": "app",
          "step": "node-sends-the-request-not-the-p",
          "log": [
            "→ POST https://app.example/api/login",
            "← 200 OK",
            "  set-cookie: session=…"
          ],
          "edge": "server_app"
        },
        {
          "node": "cookies",
          "step": "the-response-cookie-goes-into-th",
          "log": []
        },
        {
          "node": "Page",
          "step": "a-cookie-login-carries-over-to-t",
          "log": [],
          "edge": "cookie_page"
        },
        {
          "node": "app",
          "step": "a-cookie-login-carries-over-to-t",
          "log": [
            "navigating to \"https://app.example/account\", waiting until \"load\""
          ],
          "edge": "page_app"
        },
        {
          "node": "pageFx",
          "step": "after-the-test-teardown-runs-in",
          "log": []
        }
      ]
    }
  ],
  "definitions": {
    "runner": {
      "term": "Runner",
      "text": "The main Node process. It reads the config, finds tests, starts workers and collects results."
    },
    "config": {
      "term": "Config",
      "text": "playwright.config: projects, workers, use options, webServer, global setup."
    },
    "group": {
      "term": "Test group",
      "text": "Tests that need the same project and worker fixtures and come from one file. A worker takes a whole group."
    },
    "worker": {
      "term": "Worker",
      "text": "A separate Node process. It runs the tests of its groups one at a time and keeps worker fixtures between them."
    },
    "fixture": {
      "term": "Fixture",
      "text": "A value a test asks for by name. Playwright builds it before the test and cleans it up after."
    },
    "builtin": {
      "term": "Built-in fixture",
      "text": "Ships with Playwright: playwright, browser, context, page, request and options such as browserName."
    },
    "custom": {
      "term": "Your fixture",
      "text": "Added with test.extend. It can depend on built-in fixtures and on each other."
    },
    "scope": {
      "term": "Worker or test scope",
      "text": "A worker fixture is built once per worker and reused. A test fixture is built for every test."
    },
    "browser": {
      "term": "Browser",
      "text": "A browser process that Playwright launches. Chromium by default (browserName)."
    },
    "context": {
      "term": "Context",
      "text": "An isolated browser session with its own cookies and storage."
    },
    "page": {
      "term": "Page",
      "text": "One tab inside a context."
    },
    "client": {
      "term": "Client and server",
      "text": "Your calls go to a client object. It sends each call as a message to the server, which drives the browser. In a test run both live in the worker."
    },
    "request": {
      "term": "request fixture",
      "text": "An API context that sends HTTP from Node. It needs no browser."
    },
    "ownCookies": {
      "term": "Standalone cookie jar",
      "text": "The request fixture has its own cookie jar. storageState copies cookies once; later changes are not shared."
    },
    "sharedCookies": {
      "term": "Shared context cookies",
      "text": "page.request uses the page’s browser-context cookie jar. Response cookies go back into that same jar."
    }
  },
  "code": {
    "request": {
      "title": "Inside Playwright · index.ts (fixtures)",
      "source": {
        "label": "index.ts:190-190",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L190"
      },
      "lines": [
        "request: async ({ playwright }, use) => {",
        "  const request = await playwright.request.newContext();",
        "  await use(request);"
      ]
    },
    "combined": {
      "title": "In your test · page.request",
      "lines": [
        "// ✓ Log in by API, then open the page",
        "await page.request.post('/api/login', {",
        "  data: { user: 'ann', password: 'pw' },",
        "});",
        "await page.goto('/account'); // cookie sent",
        "",
        "// ✗ page.route does not mock page.request",
        "await page.route('**/api/**', mock);",
        "await page.request.get('/api/x'); // real"
      ]
    },
    "state": {
      "title": "In your test · storageState",
      "lines": [
        "await request.post('/api/login', { data });",
        "const state = await request.storageState();",
        "const context = await browser.newContext({",
        "  storageState: state,",
        "});"
      ]
    }
  },
  "conceptScenario": "web",
  "concepts": [
    {
      "label": "Runner",
      "layer": "runner",
      "items": [
        {
          "definition": "runner",
          "short": "The main Node process manages the run.",
          "nodes": [
            "cli"
          ],
          "step": {
            "scenario": "web",
            "step": "you-start-the-runner"
          },
          "source": {
            "label": "program.ts:41",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/program.ts#L41"
          }
        },
        {
          "definition": "config",
          "short": "Projects, workers, use options, webServer and global setup.",
          "nodes": [
            "config"
          ],
          "step": {
            "scenario": "web",
            "step": "the-runner-loads-the-config"
          },
          "source": {
            "label": "testActions.ts:27-31",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/cli/testActions.ts#L27-L31"
          }
        },
        {
          "definition": "group",
          "short": "Tests with matching project and worker fixtures, from one file.",
          "nodes": [
            "files"
          ],
          "step": {
            "scenario": "web",
            "step": "it-finds-tests-and-groups-them"
          },
          "source": {
            "label": "projectUtils.ts:147-160",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/projectUtils.ts#L147-L160"
          }
        },
        {
          "definition": "worker",
          "short": "A separate Node process runs tests one at a time.",
          "nodes": [
            "dispatch",
            "test"
          ],
          "step": {
            "scenario": "web",
            "step": "the-dispatcher-starts-a-worker"
          },
          "source": {
            "label": "dispatcher.ts:236-240",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L236-L240"
          }
        }
      ]
    },
    {
      "label": "Worker and fixtures",
      "layer": "runner",
      "items": [
        {
          "definition": "fixture",
          "short": "A value requested by name, set up before use and cleaned up after.",
          "nodes": [
            "test"
          ],
          "step": {
            "scenario": "web",
            "step": "your-test-asks-for-fixtures"
          },
          "source": {
            "label": "workerMain.ts:242-250",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/workerMain.ts#L242-L250"
          }
        },
        {
          "definition": "builtin",
          "short": "Fixtures shipped with Playwright.",
          "nodes": [
            "pw",
            "browserFx",
            "contextFx",
            "pageFx",
            "request"
          ],
          "step": {
            "scenario": "web",
            "step": "fixtures-start-dependencies-firs"
          },
          "source": {
            "label": "index.ts:78-80",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L78-L80"
          }
        },
        {
          "definition": "custom",
          "short": "Fixtures added with test.extend join the dependency graph.",
          "nodes": [
            "yours"
          ],
          "step": {
            "scenario": "web",
            "step": "fixtures-start-dependencies-firs"
          },
          "source": {
            "label": "fixtures.ts:34",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L34"
          }
        },
        {
          "definition": "scope",
          "short": "Worker fixtures are reused; test fixtures are built for each test.",
          "nodes": [
            "browserFx",
            "contextFx",
            "pageFx"
          ],
          "step": {
            "scenario": "web",
            "step": "fixtures-start-dependencies-firs"
          },
          "source": {
            "label": "fixtures.ts:127",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L127"
          }
        },
        {
          "definition": "client",
          "short": "Client calls become messages to the server, both in the local worker.",
          "nodes": [
            "client",
            "server"
          ],
          "step": {
            "scenario": "web",
            "step": "page-goto-travels-to-your-app"
          },
          "source": {
            "label": "inprocess.ts:27-41",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/inprocess.ts#L27-L41"
          }
        },
        {
          "definition": "request",
          "short": "A standalone API context sends HTTP from Node without a browser.",
          "nodes": [
            "request"
          ],
          "step": {
            "scenario": "api",
            "step": "request-needs-no-browser"
          },
          "source": {
            "label": "index.ts:191-205",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L205"
          }
        },
        {
          "definition": "ownCookies",
          "short": "The request fixture owns its jar; storageState copies cookies once.",
          "nodes": [
            "apiCookies",
            "request"
          ],
          "step": {
            "scenario": "api",
            "step": "the-request-fixture-owns-its-coo"
          },
          "source": {
            "label": "fetch.ts:750-761",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L750-L761"
          }
        }
      ]
    },
    {
      "label": "Browser",
      "layer": "browser",
      "items": [
        {
          "definition": "browser",
          "short": "A separate browser process launched by the browser fixture.",
          "nodes": [
            "Browser"
          ],
          "step": {
            "scenario": "web",
            "step": "browser-launches-a-browser-proce"
          },
          "source": {
            "label": "index.ts:238-262",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L238-L262"
          }
        },
        {
          "definition": "context",
          "short": "An isolated browser session with its own cookies and storage.",
          "nodes": [
            "Context"
          ],
          "step": {
            "scenario": "web",
            "step": "each-test-gets-a-new-context-and"
          },
          "source": {
            "label": "fixtures.ts:127",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L127"
          }
        },
        {
          "definition": "page",
          "short": "One tab inside a context.",
          "nodes": [
            "Page"
          ],
          "step": {
            "scenario": "web",
            "step": "each-test-gets-a-new-context-and"
          },
          "source": {
            "label": "fixtures.ts:127",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/fixtures.ts#L127"
          }
        },
        {
          "definition": "sharedCookies",
          "short": "page.request shares the browser context’s cookie jar.",
          "nodes": [
            "Context",
            "cookies",
            "pageRequest"
          ],
          "step": {
            "scenario": "combined",
            "step": "page-request-shares-the-context"
          },
          "source": {
            "label": "page.ts:142",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "test",
      "cli",
      "dispatch",
      "client",
      "server"
    ],
    "2": [
      "browserFx",
      "contextFx",
      "pageFx",
      "Browser",
      "Context",
      "Page"
    ],
    "3": [
      "Context",
      "cookies",
      "pageRequest"
    ],
    "4": [
      "request",
      "apiCookies"
    ]
  },
  "deeper": [
    {
      "title": "1.1 A failed call comes back with its name and its call log",
      "href": "/1-messages/1-1-one-call-two-processes/",
      "why": "Client, server and the message in between."
    },
    {
      "title": "1.2 Contexts divide state, pages contain frame trees",
      "href": "/1-messages/1-2-browser-context-page-frame/",
      "why": "Browser, context and page, and what each one owns."
    },
    {
      "title": "3.3 An API response lives only as long as its context",
      "href": "/3-network/3-3-api-requests/",
      "why": "The request fixture, cookies and storageState."
    },
    {
      "title": "4.1 Projects wait for successful dependencies",
      "href": "/4-runner/4-1-config-and-projects/",
      "why": "Config, projects, webServer and global setup."
    },
    {
      "title": "4.2 Built on demand, torn down in reverse",
      "href": "/4-runner/4-2-custom-fixtures/",
      "why": "Your own fixtures, setup order and teardown."
    },
    {
      "title": "4.3 Workers take groups, shards keep them whole",
      "href": "/4-runner/4-3-workers-and-parallel/",
      "why": "Test groups, worker slots and parallel runs."
    },
    {
      "title": "4.5 Options reset values, autos choose when to start",
      "href": "/4-runner/4-5-option-and-auto-fixtures/",
      "why": "Option and automatic fixtures, and their order."
    }
  ],
  "viewBox": [
    424,
    736
  ]
}
