{
  "format": 3,
  "id": "3.3",
  "title": "API context ownership and server response body lifetime",
  "layers": {
    "client": {
      "label": "Client"
    },
    "runner": {
      "label": "Runner"
    },
    "server": {
      "label": "Server"
    },
    "fail": {
      "label": "Fail"
    }
  },
  "lanes": {
    "api": {
      "label": "NODE · API OBJECTS",
      "layer": "client",
      "y": 16,
      "h": 184.6,
      "x": 16,
      "w": 1703
    },
    "fixture": {
      "label": "NODE · FIXTURE AND TEST LIFECYCLE",
      "layer": "runner",
      "y": 228.6,
      "h": 184.6,
      "x": 16,
      "w": 1703
    },
    "server": {
      "label": "PLAYWRIGHT SERVER · RESPONSE STORAGE",
      "layer": "server",
      "y": 441.2,
      "h": 184.59999999999997,
      "x": 16,
      "w": 1703
    }
  },
  "frames": {},
  "nodes": {
    "pageRequest": {
      "label": "page.request",
      "layer": "client",
      "lane": "api",
      "box": [
        32,
        40,
        107,
        36
      ]
    },
    "standalone": {
      "label": "newContext()",
      "layer": "client",
      "lane": "api",
      "box": [
        171,
        40,
        109,
        36
      ]
    },
    "read": {
      "label": "Read response body",
      "layer": "client",
      "lane": "api",
      "box": [
        312,
        40,
        152,
        36
      ]
    },
    "error": {
      "label": "Disposed response",
      "layer": "fail",
      "lane": "api",
      "fail": true,
      "box": [
        316.5,
        152.6,
        143,
        36
      ]
    },
    "fixture": {
      "label": "request fixture",
      "layer": "runner",
      "lane": "fixture",
      "box": [
        496,
        252.6,
        117,
        36
      ]
    },
    "hookEnd": {
      "label": "beforeAll ends",
      "layer": "runner",
      "lane": "fixture",
      "box": [
        497,
        365.2,
        115,
        36
      ]
    },
    "own": {
      "label": "Own beforeAll context",
      "layer": "client",
      "lane": "fixture",
      "box": [
        645,
        252.6,
        164,
        36
      ]
    },
    "tests": {
      "label": "Tests read bodies",
      "layer": "client",
      "lane": "fixture",
      "box": [
        841,
        252.6,
        135,
        36
      ]
    },
    "reason": {
      "label": "Later request fails",
      "layer": "fail",
      "lane": "fixture",
      "fail": true,
      "box": [
        1008,
        252.6,
        138,
        36
      ]
    },
    "afterAll": {
      "label": "afterAll: dispose()",
      "layer": "client",
      "lane": "fixture",
      "box": [
        1178,
        252.6,
        135,
        36
      ]
    },
    "bodies": {
      "label": "Stored response bodies",
      "layer": "server",
      "lane": "server",
      "box": [
        1441.5,
        577.8,
        172,
        36
      ]
    },
    "one": {
      "label": "Release one response",
      "layer": "server",
      "lane": "server",
      "box": [
        1545,
        465.2,
        162,
        36
      ]
    },
    "all": {
      "label": "Release owner context",
      "layer": "server",
      "lane": "server",
      "box": [
        1345,
        465.2,
        168,
        36
      ]
    }
  },
  "edges": {
    "missing": {
      "from": "read",
      "to": "error",
      "label": {
        "at": [
          400,
          118.5
        ],
        "text": "missing"
      },
      "path": "M388,76 L388,114.3 L388,152.6",
      "badge": [
        388,
        114.3
      ]
    },
    "hook": {
      "from": "fixture",
      "to": "hookEnd",
      "label": {
        "at": [
          566.5000000000001,
          331.09999999999997
        ],
        "text": "hook ends"
      },
      "path": "M554.5,288.6 L554.5,326.9 L554.5,365.2",
      "badge": [
        554.5,
        326.9
      ]
    },
    "releaseOne": {
      "from": "one",
      "to": "bodies",
      "label": {
        "at": [
          1638,
          543.7
        ],
        "text": "one"
      },
      "path": "M1626,501.2 L1626,539.5 L1558.9920071047957,577.8",
      "badge": [
        1609.1218209168787,
        549.1471216485252
      ]
    },
    "releaseAll": {
      "from": "all",
      "to": "bodies",
      "label": {
        "at": [
          1441,
          543.7
        ],
        "text": "all"
      },
      "path": "M1429,501.2 L1429,539.5 L1496.0079928952043,577.8",
      "badge": [
        1458.3159968916518,
        556.25625
      ]
    }
  },
  "scenarios": [
    {
      "id": "intro",
      "label": "How API responses live",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "the-browser-context-owns-page-re",
          "title": "The browser context owns page.request",
          "text": "page.request belongs to the browser context and shares its cookies.",
          "show": [
            "pageRequest"
          ],
          "current": [
            "pageRequest"
          ],
          "edges": [],
          "defs": [
            "pageRequest"
          ],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "a-standalone-context-has-its-own",
          "title": "A standalone context has its own owner",
          "text": "The request fixture creates its own context. A context from playwright.request.newContext() is yours to dispose.",
          "show": [
            "pageRequest",
            "standalone"
          ],
          "current": [
            "standalone"
          ],
          "edges": [],
          "defs": [
            "standalone"
          ],
          "sources": [
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 752-762",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L750-L760"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "bodies-stay-on-the-server",
          "title": "Bodies stay on the server",
          "text": "Response bodies stay on the server until someone releases them.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies"
          ],
          "current": [
            "bodies"
          ],
          "edges": [],
          "defs": [
            "bodies"
          ],
          "sources": [
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "release-one-response",
          "title": "Release one response",
          "text": "response.dispose() releases one body. Other response bodies remain available.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one"
          ],
          "current": [
            "one"
          ],
          "edges": [
            "releaseOne"
          ],
          "defs": [
            "one"
          ],
          "sources": [
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "release-the-owner-context",
          "title": "Release the owner context",
          "text": "Disposing the context releases all of its bodies.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one",
            "all"
          ],
          "current": [
            "all"
          ],
          "edges": [
            "releaseAll"
          ],
          "defs": [
            "all"
          ],
          "sources": [
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "a-released-body-cannot-be-read",
          "title": "A released body cannot be read",
          "text": "Reading a released body fails with Response has been disposed.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one",
            "all",
            "read",
            "error"
          ],
          "current": [
            "read",
            "error"
          ],
          "edges": [
            "missing"
          ],
          "defs": [
            "read"
          ],
          "code": "body",
          "sources": [
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "the-hook-fixture-ends-with-the-h",
          "title": "The hook fixture ends with the hook",
          "text": "The request fixture in beforeAll lives only until that hook ends. Then Playwright disposes it and stores a reason; a later request gets that reason as the error.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one",
            "all",
            "read",
            "error",
            "fixture",
            "hookEnd",
            "reason"
          ],
          "current": [
            "fixture",
            "hookEnd",
            "reason"
          ],
          "edges": [
            "hook"
          ],
          "defs": [
            "fixture"
          ],
          "code": "hook",
          "sources": [
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "own-the-context-across-tests",
          "title": "Own the context across tests",
          "text": "Create your own context in beforeAll and dispose it in afterAll. Read each body before disposal.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one",
            "all",
            "read",
            "error",
            "fixture",
            "hookEnd",
            "reason",
            "own",
            "tests",
            "afterAll"
          ],
          "current": [
            "own",
            "tests",
            "afterAll"
          ],
          "edges": [],
          "defs": [
            "own"
          ],
          "code": "owned",
          "sources": [
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ]
    },
    {
      "id": "release-one",
      "label": "Release one",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Release one response, keep the other",
        "text": "Example: body1 and body2 belong to the same context."
      },
      "steps": [
        {
          "id": "two-responses-share-a-context",
          "title": "Two responses share a context",
          "text": "Each request uses an owner context. These two responses share one.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies"
          ],
          "current": [
            "standalone"
          ],
          "edges": [],
          "defs": [
            "example00",
            "bodies"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "release-body1",
          "title": "Release body1",
          "text": "response.dispose() releases body1. body2 is still available.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one"
          ],
          "current": [
            "one"
          ],
          "edges": [
            "releaseOne"
          ],
          "defs": [
            "example01",
            "bodies"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "read-the-released-body",
          "title": "Read the released body",
          "text": "Reading body1 now fails. The other response remains available.",
          "show": [
            "pageRequest",
            "standalone",
            "bodies",
            "one",
            "read",
            "error"
          ],
          "current": [
            "error"
          ],
          "edges": [],
          "defs": [
            "example02",
            "bodies"
          ],
          "code": "body",
          "log": [
            "Response has been disposed"
          ],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "standalone",
          "step": "two-responses-share-a-context",
          "log": []
        },
        {
          "node": "one",
          "step": "release-body1",
          "log": []
        },
        {
          "node": "bodies",
          "step": "release-body1",
          "log": [],
          "edge": "releaseOne"
        },
        {
          "node": "error",
          "step": "read-the-released-body",
          "log": [
            "Response has been disposed"
          ],
          "fail": true
        }
      ]
    },
    {
      "id": "release-context",
      "label": "Release context",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Release every response in the context",
        "text": "The request fixture ends after its test. You dispose a context you create."
      },
      "steps": [
        {
          "id": "fixture-and-manual-ownership",
          "title": "Fixture and manual ownership",
          "text": "The fixture creates its own context; a manual context belongs to you.",
          "show": [
            "pageRequest",
            "standalone",
            "fixture",
            "bodies"
          ],
          "current": [
            "standalone"
          ],
          "edges": [],
          "defs": [
            "example10",
            "bodies"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "release-both-bodies",
          "title": "Release both bodies",
          "text": "Disposing the owner context releases both response bodies.",
          "show": [
            "pageRequest",
            "standalone",
            "fixture",
            "bodies",
            "all"
          ],
          "current": [
            "all"
          ],
          "edges": [
            "releaseAll"
          ],
          "defs": [
            "example11",
            "bodies"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "read-after-context-disposal",
          "title": "Read after context disposal",
          "text": "Reading either response body after context disposal fails.",
          "show": [
            "pageRequest",
            "standalone",
            "fixture",
            "bodies",
            "all",
            "read",
            "error"
          ],
          "current": [
            "error"
          ],
          "edges": [],
          "defs": [
            "example12",
            "bodies"
          ],
          "code": "body",
          "log": [
            "Response has been disposed"
          ],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 417-419",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L420-L422"
            },
            {
              "label": "networkDispatchers.ts · 248-250",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts#L248-L250"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "standalone",
          "step": "fixture-and-manual-ownership",
          "log": []
        },
        {
          "node": "all",
          "step": "release-both-bodies",
          "log": []
        },
        {
          "node": "bodies",
          "step": "release-both-bodies",
          "log": [],
          "edge": "releaseAll"
        },
        {
          "node": "error",
          "step": "read-after-context-disposal",
          "log": [
            "Response has been disposed"
          ],
          "fail": true
        }
      ]
    },
    {
      "id": "before-all",
      "label": "BeforeAll",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "The hook fixture cannot serve later tests",
        "text": "The output shows the first line of the stored four-line reason."
      },
      "steps": [
        {
          "id": "context-available-in-the-hook",
          "title": "Context available in the hook",
          "text": "The request fixture creates a context for beforeAll.",
          "show": [
            "fixture"
          ],
          "current": [
            "fixture"
          ],
          "edges": [],
          "defs": [
            "example20",
            "fixture"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "hook-teardown-disposes-it",
          "title": "Hook teardown disposes it",
          "text": "When beforeAll ends, Playwright disposes that fixture context.",
          "show": [
            "fixture",
            "hookEnd"
          ],
          "current": [
            "hookEnd"
          ],
          "edges": [
            "hook"
          ],
          "defs": [
            "example21",
            "fixture"
          ],
          "code": "hook",
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "later-request-fails",
          "title": "Later request fails",
          "text": "A later request fails with the reason stored at hook teardown.",
          "show": [
            "fixture",
            "hookEnd",
            "reason"
          ],
          "current": [
            "reason"
          ],
          "edges": [],
          "defs": [
            "example22",
            "fixture"
          ],
          "log": [
            "Fixture { request } from beforeAll cannot be reused in a test."
          ],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "fixture",
          "step": "context-available-in-the-hook",
          "log": []
        },
        {
          "node": "hookEnd",
          "step": "hook-teardown-disposes-it",
          "log": [],
          "edge": "hook"
        },
        {
          "node": "reason",
          "step": "later-request-fails",
          "log": [
            "Fixture { request } from beforeAll cannot be reused in a test."
          ],
          "fail": true
        }
      ]
    },
    {
      "id": "own-context",
      "label": "Own context",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Own the context across the tests",
        "text": "Create it in beforeAll and release it in afterAll."
      },
      "steps": [
        {
          "id": "create-your-own-context",
          "title": "Create your own context",
          "text": "Create your own context in beforeAll, instead of saving the request fixture.",
          "show": [
            "own"
          ],
          "current": [
            "own"
          ],
          "edges": [],
          "defs": [
            "example30",
            "own"
          ],
          "code": "owned",
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "read-the-needed-bodies",
          "title": "Read the needed bodies",
          "text": "Tests use your context and read the bodies they need.",
          "show": [
            "own",
            "tests"
          ],
          "current": [
            "tests"
          ],
          "edges": [],
          "defs": [
            "example31",
            "own"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "dispose-after-reading",
          "title": "Dispose after reading",
          "text": "Dispose your context in afterAll, after reading the response bodies.",
          "show": [
            "own",
            "tests",
            "afterAll"
          ],
          "current": [
            "afterAll"
          ],
          "edges": [],
          "defs": [
            "example32",
            "own"
          ],
          "log": [],
          "sources": [
            {
              "label": "page.ts · 142-142",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
            },
            {
              "label": "index.ts · 191-204",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
            },
            {
              "label": "playwrightDispatcher.ts · 87-92",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts#L87-L92"
            },
            {
              "label": "fetch.ts · 734-740",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L732-L738"
            },
            {
              "label": "fetch.ts · 190-194",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
            },
            {
              "label": "fetch.ts · 185-188",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
            },
            {
              "label": "fetch.ts · 388-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
            },
            {
              "label": "fetch.ts · 783-788",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L781-L786"
            },
            {
              "label": "fetch.ts · 162-171",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
            },
            {
              "label": "fetch.ts · 715-719",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L713-L717"
            },
            {
              "label": "fetch.ts · 116-117",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L117-L118"
            },
            {
              "label": "fetch.ts · 195-198",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L197-L200"
            }
          ],
          "deeper": [
            {
              "title": "0.1 API calls leave from Node, page calls from the browser",
              "href": "/0-anatomy/0-1-anatomy-of-a-test/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "own",
          "step": "create-your-own-context",
          "log": []
        },
        {
          "node": "tests",
          "step": "read-the-needed-bodies",
          "log": []
        },
        {
          "node": "afterAll",
          "step": "dispose-after-reading",
          "log": []
        }
      ]
    }
  ],
  "definitions": {
    "pageRequest": {
      "term": "Browser context ownership",
      "text": "page.request belongs to its browser context and shares its cookies."
    },
    "standalone": {
      "term": "Standalone ownership",
      "text": "Standalone contexts own a CookieStore. The request fixture creates its own context; a context you create is yours to dispose."
    },
    "bodies": {
      "term": "Server response bodies",
      "text": "Response bodies stay on the server until the response or its owner context releases them."
    },
    "one": {
      "term": "Release one body",
      "text": "response.dispose() releases one response body. Other response bodies remain available."
    },
    "all": {
      "term": "Release all bodies",
      "text": "Disposing an owner context releases all of its response bodies."
    },
    "read": {
      "term": "Read a response",
      "text": "body() fails with Response has been disposed after the body is released."
    },
    "fixture": {
      "term": "Hook fixture lifetime",
      "text": "The request fixture in beforeAll lives only until that hook ends. Playwright disposes it and stores a reason; a later request throws that reason."
    },
    "own": {
      "term": "Own the shared context",
      "text": "Create your context in beforeAll, read the needed bodies in tests, and dispose it in afterAll."
    },
    "example00": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example01": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: missing after dispose() · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example02": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: missing after dispose() · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example10": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example11": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: missing after disposal · body2: missing after disposal. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example12": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: missing after disposal · body2: missing after disposal. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example20": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Context available in the hook. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example21": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    },
    "example22": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: Later test → api.get(...) · ✗ Context already disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose(). Output · reason excerpt (first line of the stored four-line reason)."
    },
    "example30": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Context available for tests · afterAll → not reached yet."
    },
    "example31": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → not reached yet."
    },
    "example32": {
      "term": "Example state",
      "text": "Who owns the context? page.request → browser context · request fixture → after test · newContext() → you dispose it. Response bodies: body1: available · body2: available. beforeAll fixture: beforeAll: request fixture · Hook ends → context disposed. Your shared context: beforeAll → own newContext() · Tests → read each response · afterAll → api.dispose()."
    }
  },
  "code": {
    "body": {
      "title": "Inside Playwright · fetch.ts",
      "source": {
        "label": "fetch.ts:395-395",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L395"
      },
      "lines": [
        "const result = await this._request._channel",
        "  .fetchResponseBody({",
        "    fetchUid: this._fetchUid()",
        "  }, kNoTimeout);",
        "if (result.binary === undefined)",
        "  throw new Error(",
        "    'Response has been disposed');",
        "return result.binary;"
      ]
    },
    "hook": {
      "title": "Inside Playwright · index.ts",
      "source": {
        "label": "index.ts:194-194",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L194"
      },
      "lines": [
        "const hook = (test.info() as TestInfoImpl)",
        "  ._currentHookType();",
        "if (hook === 'beforeAll') {",
        "  await request.dispose({ reason: ["
      ]
    },
    "owned": {
      "title": "In your test · a shared API context",
      "lines": [
        "// ✗ The fixture ends with this hook",
        "test.beforeAll(async ({ request }) => {",
        "  api = request;",
        "});",
        "// ✓ Own it for the whole file",
        "test.beforeAll(async ({ playwright }) => {",
        "  api = await playwright.request",
        "    .newContext();",
        "});",
        "test.afterAll(async () => {",
        "  await api.dispose();",
        "});"
      ]
    }
  },
  "conceptScenario": "intro",
  "concepts": [
    {
      "label": "Node · API objects",
      "layer": "client",
      "items": [
        {
          "definition": "pageRequest",
          "short": "Aliases the browser context request.",
          "nodes": [
            "pageRequest"
          ],
          "step": {
            "step": "the-browser-context-owns-page-re"
          },
          "source": {
            "label": "page.ts · 142-142",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/page.ts#L142"
          }
        },
        {
          "definition": "standalone",
          "short": "Standalone contexts own a CookieStore.",
          "nodes": [
            "standalone"
          ],
          "step": {
            "step": "a-standalone-context-has-its-own"
          },
          "source": {
            "label": "fetch.ts · 752-762",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L750-L760"
          }
        },
        {
          "definition": "read",
          "short": "An absent body produces Response has been disposed.",
          "nodes": [
            "read"
          ],
          "step": {
            "step": "a-released-body-cannot-be-read"
          },
          "source": {
            "label": "fetch.ts · 388-398",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/fetch.ts#L393-L403"
          }
        }
      ]
    },
    {
      "label": "Node · fixture lifecycle",
      "layer": "runner",
      "items": [
        {
          "definition": "fixture",
          "short": "The beforeAll fixture context is disposed when the hook ends.",
          "nodes": [
            "fixture",
            "hookEnd"
          ],
          "step": {
            "step": "the-hook-fixture-ends-with-the-h"
          },
          "source": {
            "label": "index.ts · 191-204",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
          }
        }
      ]
    },
    {
      "label": "Node · your owned context",
      "layer": "client",
      "items": [
        {
          "definition": "own",
          "short": "Create in beforeAll; dispose in afterAll.",
          "nodes": [
            "own",
            "tests",
            "afterAll"
          ],
          "step": {
            "step": "own-the-context-across-tests"
          },
          "source": {
            "label": "index.ts · 191-204",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/index.ts#L191-L204"
          }
        }
      ]
    },
    {
      "label": "Playwright server · response storage",
      "layer": "server",
      "items": [
        {
          "definition": "bodies",
          "short": "Stores bodies by generated identifiers.",
          "nodes": [
            "bodies"
          ],
          "step": {
            "step": "bodies-stay-on-the-server"
          },
          "source": {
            "label": "fetch.ts · 190-194",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L190-L194"
          }
        },
        {
          "definition": "one",
          "short": "Deletes one stored response body.",
          "nodes": [
            "one"
          ],
          "step": {
            "step": "release-one-response"
          },
          "source": {
            "label": "fetch.ts · 185-188",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L185-L188"
          }
        },
        {
          "definition": "all",
          "short": "Context cleanup clears all stored bodies.",
          "nodes": [
            "all"
          ],
          "step": {
            "step": "release-the-owner-context"
          },
          "source": {
            "label": "fetch.ts · 162-171",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/fetch.ts#L162-L171"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "pageRequest",
      "standalone"
    ],
    "2": [
      "bodies",
      "one",
      "all",
      "read",
      "error"
    ],
    "3": [
      "fixture",
      "hookEnd",
      "reason"
    ],
    "4": [
      "own",
      "tests",
      "afterAll"
    ]
  },
  "deeper": [
    {
      "title": "0.1 API calls leave from Node, page calls from the browser",
      "href": "/0-anatomy/0-1-anatomy-of-a-test/",
      "why": "API calls leave from Node; page calls leave from the browser."
    },
    {
      "title": "4.2 Built on demand, torn down in reverse",
      "href": "/4-runner/4-2-custom-fixtures/",
      "why": "Built on demand, torn down in reverse."
    }
  ],
  "viewBox": [
    1735,
    641.8
  ],
  "measurement": {
    "name": "font-table",
    "labels": {
      "missing": {
        "width": 44.24699999999999,
        "height": 12.6
      },
      "hook": {
        "width": 56.88899999999999,
        "height": 12.6
      },
      "releaseOne": {
        "width": 18.963,
        "height": 12.6
      },
      "releaseAll": {
        "width": 18.963,
        "height": 12.6
      }
    }
  }
}
