{
  "format": 3,
  "id": "5.1",
  "title": "Each wait repeats a different piece of work",
  "layers": {
    "runner": {
      "label": "Runner"
    },
    "server": {
      "label": "Server"
    },
    "page": {
      "label": "Page"
    },
    "client": {
      "label": "Client"
    },
    "app": {
      "label": "App"
    }
  },
  "lanes": {
    "worker": {
      "label": "NODE · TEST WORKER",
      "layer": "runner",
      "y": 16,
      "h": 184.6,
      "x": 16,
      "w": 1479.4450000000002
    },
    "server": {
      "label": "PLAYWRIGHT SERVER",
      "layer": "server",
      "y": 228.6,
      "h": 297.19999999999993,
      "x": 16,
      "w": 1479.4450000000002
    },
    "page": {
      "label": "PAGE · INJECTED SCRIPT",
      "layer": "page",
      "y": 553.8,
      "h": 72,
      "x": 16,
      "w": 1479.4450000000002
    }
  },
  "frames": {},
  "nodes": {
    "locator": {
      "label": "expect(locator)",
      "layer": "client",
      "lane": "worker",
      "box": [
        32,
        40,
        120,
        36
      ]
    },
    "timing": {
      "label": "Timeout settings",
      "layer": "runner",
      "lane": "worker",
      "box": [
        1014.2039999999997,
        40,
        130,
        36
      ]
    },
    "producer": {
      "label": "Poll: readCount()",
      "layer": "app",
      "lane": "worker",
      "box": [
        398.2039999999999,
        40,
        130,
        36
      ]
    },
    "matcher": {
      "label": "Check returned value",
      "layer": "runner",
      "lane": "worker",
      "box": [
        383.7039999999999,
        152.6,
        159,
        36
      ]
    },
    "pollPass": {
      "label": "Poll passes",
      "layer": "runner",
      "lane": "worker",
      "box": [
        560.204,
        40,
        93,
        36
      ]
    },
    "finished": {
      "label": "Block finishes",
      "layer": "runner",
      "lane": "worker",
      "box": [
        872.2039999999998,
        40,
        110,
        36
      ]
    },
    "block": {
      "label": "Positive toPass block",
      "layer": "app",
      "lane": "worker",
      "box": [
        685.2039999999998,
        40,
        155,
        36
      ]
    },
    "thrown": {
      "label": "Assertion throws",
      "layer": "runner",
      "lane": "worker",
      "box": [
        698.2039999999998,
        152.6,
        129,
        36
      ]
    },
    "intervals": {
      "label": "Wait between tries",
      "layer": "runner",
      "lane": "worker",
      "box": [
        1176.2040000000002,
        40,
        143,
        36
      ]
    },
    "stop": {
      "label": "No next try",
      "layer": "runner",
      "lane": "worker",
      "box": [
        1200.2040000000002,
        152.6,
        95,
        36
      ]
    },
    "soft": {
      "label": "Soft assertion",
      "layer": "runner",
      "lane": "worker",
      "box": [
        1356.9450000000002,
        40,
        111,
        36
      ]
    },
    "failed": {
      "label": "Test marked failed",
      "layer": "runner",
      "lane": "worker",
      "box": [
        1341.4450000000002,
        152.6,
        142,
        36
      ]
    },
    "resolve": {
      "label": "Resolve selector",
      "layer": "server",
      "lane": "server",
      "box": [
        184,
        252.6,
        127,
        36
      ]
    },
    "ready": {
      "label": "Locator passes",
      "layer": "server",
      "lane": "server",
      "box": [
        188.5,
        477.79999999999995,
        118,
        36
      ]
    },
    "check": {
      "label": "Injected text check",
      "layer": "page",
      "lane": "page",
      "box": [
        175.5,
        577.8,
        144,
        36
      ]
    }
  },
  "edges": {
    "value": {
      "from": "producer",
      "to": "matcher",
      "label": {
        "at": [
          593.1514999999999,
          118.5
        ],
        "text": "value"
      },
      "path": "M500.91368028419174,76 L581.1514999999999,114.3 L500.91368028419174,152.6",
      "badge": [
        581.1514999999999,
        114.3
      ]
    },
    "pollRetry": {
      "from": "matcher",
      "to": "producer",
      "label": {
        "at": [
          411.7964999999999,
          118.5
        ],
        "text": "mismatch: retry"
      },
      "path": "M442.931619893428,152.6 L399.7964999999999,114.3 L442.931619893428,76",
      "badge": [
        399.7964999999999,
        114.3
      ]
    },
    "throws": {
      "from": "block",
      "to": "thrown",
      "label": {
        "at": [
          982.2409999999999,
          118.5
        ],
        "text": "throws"
      },
      "path": "M829.0568596802841,76 L970.2409999999999,114.3 L827.2039999999998,153.10263808381157",
      "badge": [
        969.3145701598578,
        114.55131904190578
      ]
    },
    "blockRetry": {
      "from": "thrown",
      "to": "block",
      "label": {
        "at": [
          660.7564999999998,
          118.5
        ],
        "text": "repeat whole block"
      },
      "path": "M724.994319715808,152.6 L644.7564999999998,114.3 L724.994319715808,76",
      "badge": [
        644.7564999999998,
        114.3
      ]
    },
    "deadline": {
      "from": "intervals",
      "to": "stop",
      "label": {
        "at": [
          1259.7040000000002,
          118.5
        ],
        "text": "wait reaches deadline"
      },
      "path": "M1247.7040000000002,76 L1247.7040000000002,114.3 L1247.7040000000002,152.6",
      "badge": [
        1247.7040000000002,
        114.3
      ]
    },
    "record": {
      "from": "soft",
      "to": "failed",
      "label": {
        "at": [
          1424.445,
          118.5
        ],
        "text": "records failure"
      },
      "path": "M1412.4450000000002,76 L1412.4450000000002,114.3 L1412.4450000000002,152.6",
      "badge": [
        1412.4450000000002,
        119.08749999999999
      ]
    },
    "injected": {
      "from": "resolve",
      "to": "check",
      "label": {
        "at": [
          152.015625,
          352.48437499999994
        ],
        "text": "injected check"
      },
      "path": "M247.5,288.6 L247.5,433.2 L247.5,433.2 L247.5,577.8",
      "badge": [
        247.5,
        433.2
      ]
    },
    "locatorRetry": {
      "from": "check",
      "to": "resolve",
      "label": {
        "at": [
          203.89499999999998,
          365.09999999999997
        ],
        "text": "retry"
      },
      "path": "M247.5,577.8 L247.5,433.2 L247.5,433.2 L247.5,288.6",
      "badge": [
        267.5,
        433.2
      ]
    },
    "match": {
      "from": "check",
      "to": "ready",
      "label": {
        "at": [
          259.5,
          566
        ],
        "text": "matches"
      },
      "path": "M247.5,577.8 L247.5,545.8 L247.5,545.8 L247.5,513.8",
      "badge": [
        247.5,
        545.8
      ]
    }
  },
  "scenarios": [
    {
      "id": "intro",
      "label": "Three repeated regions",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "the-assertion-delegates-its-sele",
          "title": "The assertion delegates its selector",
          "text": "A locator text assertion sends expected text and timeout through locator._expect to its frame.",
          "show": [
            "locator"
          ],
          "current": [
            "locator"
          ],
          "edges": [],
          "defs": [
            "locator"
          ],
          "code": "live",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 405-408",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L405-L408"
            },
            {
              "label": "locator.ts · 423-428",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/locator.ts#L434-L439"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-server-repeats-a-fresh-check",
          "title": "The server repeats a fresh check",
          "text": "The server checks once, then retries mismatches. Each check resolves the selector and runs the page’s injected check.",
          "show": [
            "locator",
            "resolve",
            "check",
            "ready"
          ],
          "current": [
            "resolve",
            "check",
            "ready"
          ],
          "edges": [
            "injected",
            "locatorRetry",
            "match"
          ],
          "defs": [
            "resolve"
          ],
          "log": [],
          "sources": [
            {
              "label": "frames.ts · 1492-1503",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1490-L1500"
            },
            {
              "label": "frames.ts · 1505-1516",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1503-L1514"
            },
            {
              "label": "frames.ts · 1550-1558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1548-L1555"
            },
            {
              "label": "frames.ts · 1143-1150",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1141-L1148"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "poll-repeats-a-producer-and-its",
          "title": "Poll repeats a producer and its matcher",
          "text": "The producer runs in the test worker. Only matcher failures are caught for retry; producer errors escape that catch.",
          "show": [
            "locator",
            "resolve",
            "check",
            "ready",
            "producer",
            "matcher",
            "pollPass"
          ],
          "current": [
            "producer",
            "matcher",
            "pollPass"
          ],
          "edges": [
            "value",
            "pollRetry"
          ],
          "defs": [
            "producer",
            "matcher"
          ],
          "code": "poll",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "expect.ts · 433-436",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L433-L436"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "positive-topass-repeats-the-whol",
          "title": "Positive toPass repeats the whole block",
          "text": "When the callback throws, positive toPass repeats it, including earlier requests or actions.",
          "show": [
            "locator",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "block",
            "thrown",
            "finished"
          ],
          "edges": [
            "throws",
            "blockRetry"
          ],
          "defs": [
            "block"
          ],
          "code": "choose",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-timeout-defaults-differ",
          "title": "The timeout defaults differ",
          "text": "Poll inherits expect’s timeout, normally 5000 ms. toPass uses separate settings and defaults to zero.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "timing"
          ],
          "edges": [],
          "defs": [
            "timing"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 172-174",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L172-L174"
            },
            {
              "label": "expect.ts · 438-441",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L438-L441"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-final-wait-repeats",
          "title": "The final wait repeats",
          "text": "Both default to waits of 100, 250, 500, then 1000 ms. The last interval repeats; attempts themselves also take time.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "intervals"
          ],
          "edges": [],
          "defs": [
            "intervals"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-deadline-can-prevent-another",
          "title": "The deadline can prevent another try",
          "text": "A wait that reaches the deadline is not scheduled. In a running test, the deadline is capped 250 ms before the test deadline, even with zero timeout.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "stop"
          ],
          "edges": [
            "deadline"
          ],
          "defs": [
            "stop"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 438-441",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L438-L441"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "matchers.ts · 547-558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L547-L558"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "a-soft-failure-can-finish-the-bl",
          "title": "A soft failure can finish the block",
          "text": "With a runner step, soft failure records the error and continues, still failing the test. A positive toPass block that finishes without throwing does not retry.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "soft",
            "failed",
            "finished"
          ],
          "edges": [
            "record"
          ],
          "defs": [
            "soft"
          ],
          "code": "toPass",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 351-358",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L351-L358"
            },
            {
              "label": "testInfo.ts · 334-337",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/testInfo.ts#L335-L338"
            },
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        }
      ]
    },
    {
      "id": "locator",
      "label": "Locator",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Read the page again",
        "text": "expect(locator) reads fresh text. A string you saved stays fixed."
      },
      "steps": [
        {
          "id": "expect-locator-tohavetext-ready",
          "title": "expect(locator).toHaveText('Ready') reads Loading and tries again",
          "text": "expect(locator).toHaveText('Ready') reads Loading and tries again.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "locator"
          ],
          "edges": [],
          "defs": [
            "example00",
            "locator",
            "resolve"
          ],
          "code": "live",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 405-408",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L405-L408"
            },
            {
              "label": "locator.ts · 423-428",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/locator.ts#L434-L439"
            },
            {
              "label": "frames.ts · 1492-1503",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1490-L1500"
            },
            {
              "label": "frames.ts · 1505-1516",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1503-L1514"
            },
            {
              "label": "frames.ts · 1550-1558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1548-L1555"
            },
            {
              "label": "frames.ts · 1143-1150",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1141-L1148"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-next-try-finds-the-element-a",
          "title": "The next try finds the element again",
          "text": "The next try finds the element again. Its text is still Loading.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "resolve"
          ],
          "edges": [],
          "defs": [
            "example01",
            "locator",
            "resolve"
          ],
          "code": "live",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 405-408",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L405-L408"
            },
            {
              "label": "locator.ts · 423-428",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/locator.ts#L434-L439"
            },
            {
              "label": "frames.ts · 1492-1503",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1490-L1500"
            },
            {
              "label": "frames.ts · 1505-1516",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1503-L1514"
            },
            {
              "label": "frames.ts · 1550-1558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1548-L1555"
            },
            {
              "label": "frames.ts · 1143-1150",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1141-L1148"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-page-now-says-ready",
          "title": "The page now says Ready",
          "text": "The page now says Ready. expect(locator) passes; the saved string stays Loading.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "ready"
          ],
          "edges": [],
          "defs": [
            "example02",
            "locator",
            "resolve"
          ],
          "code": "live",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 405-408",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L405-L408"
            },
            {
              "label": "locator.ts · 423-428",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/locator.ts#L434-L439"
            },
            {
              "label": "frames.ts · 1492-1503",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1490-L1500"
            },
            {
              "label": "frames.ts · 1505-1516",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1503-L1514"
            },
            {
              "label": "frames.ts · 1550-1558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1548-L1555"
            },
            {
              "label": "frames.ts · 1143-1150",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1141-L1148"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "locator",
          "step": "expect-locator-tohavetext-ready",
          "log": []
        },
        {
          "node": "resolve",
          "step": "expect-locator-tohavetext-ready",
          "log": []
        },
        {
          "node": "check",
          "step": "expect-locator-tohavetext-ready",
          "log": [],
          "edge": "injected",
          "fail": true
        },
        {
          "node": "resolve",
          "step": "the-next-try-finds-the-element-a",
          "log": [],
          "edge": "locatorRetry"
        },
        {
          "node": "check",
          "step": "the-next-try-finds-the-element-a",
          "log": [],
          "edge": "injected",
          "fail": true
        },
        {
          "node": "resolve",
          "step": "the-page-now-says-ready",
          "log": [],
          "edge": "locatorRetry"
        },
        {
          "node": "check",
          "step": "the-page-now-says-ready",
          "log": [],
          "edge": "injected"
        },
        {
          "node": "ready",
          "step": "the-page-now-says-ready",
          "log": [],
          "edge": "match"
        }
      ]
    },
    {
      "id": "read-block",
      "label": "Read/block",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Repeat a read or a block",
        "text": "expect.poll calls readCount again. toPass repeats every line, including write()."
      },
      "steps": [
        {
          "id": "expect-poll-reads-1",
          "title": "expect.poll reads 1",
          "text": "expect.poll reads 1. The check fails, then waits 100 ms before trying again.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "matcher"
          ],
          "edges": [],
          "defs": [
            "example10",
            "producer",
            "matcher",
            "block"
          ],
          "code": "poll",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "expect.ts · 433-436",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L433-L436"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "expect-poll-calls-readcount-agai",
          "title": "expect.poll calls readCount again",
          "text": "expect.poll calls readCount again. This time it reads 2 and passes.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "pollPass"
          ],
          "edges": [],
          "defs": [
            "example11",
            "producer",
            "matcher",
            "block"
          ],
          "code": "poll",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "expect.ts · 433-436",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L433-L436"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "topass-runs-write-then-reads-1",
          "title": "toPass runs write(), then reads 1",
          "text": "toPass runs write(), then reads 1. The failed assertion throws.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "thrown"
          ],
          "edges": [],
          "defs": [
            "example12",
            "producer",
            "matcher",
            "block"
          ],
          "code": "choose",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "expect.ts · 433-436",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L433-L436"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "after-the-wait-topass-runs-write",
          "title": "After the wait, toPass runs write() again, then reads the count again",
          "text": "After the wait, toPass runs write() again, then reads the count again.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "block"
          ],
          "edges": [],
          "defs": [
            "example13",
            "producer",
            "matcher",
            "block"
          ],
          "code": "choose",
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "expect.ts · 433-436",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L433-L436"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "producer",
          "step": "expect-poll-reads-1",
          "log": []
        },
        {
          "node": "matcher",
          "step": "expect-poll-reads-1",
          "log": [],
          "edge": "value",
          "fail": true
        },
        {
          "node": "producer",
          "step": "expect-poll-calls-readcount-agai",
          "log": [],
          "edge": "pollRetry"
        },
        {
          "node": "matcher",
          "step": "expect-poll-calls-readcount-agai",
          "log": [],
          "edge": "value"
        },
        {
          "node": "pollPass",
          "step": "expect-poll-calls-readcount-agai",
          "log": []
        },
        {
          "node": "block",
          "step": "topass-runs-write-then-reads-1",
          "log": []
        },
        {
          "node": "thrown",
          "step": "topass-runs-write-then-reads-1",
          "log": [],
          "edge": "throws",
          "fail": true
        },
        {
          "node": "block",
          "step": "after-the-wait-topass-runs-write",
          "log": [],
          "edge": "blockRetry"
        },
        {
          "node": "finished",
          "step": "after-the-wait-topass-runs-write",
          "log": []
        }
      ]
    },
    {
      "id": "deadlines",
      "label": "Deadlines",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Choose waits and timeouts",
        "text": "intervals sets waits after failed tries. Each try also takes time."
      },
      "steps": [
        {
          "id": "expect-poll-uses-expect-s-timeou",
          "title": "expect.poll uses expect's timeout, normally 5000 ms",
          "text": "expect.poll uses expect's timeout, normally 5000 ms. toPass has its own default: timeout 0.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "timing"
          ],
          "edges": [],
          "defs": [
            "example20",
            "timing",
            "intervals",
            "stop"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 172-174",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L172-L174"
            },
            {
              "label": "expect.ts · 438-441",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L438-L441"
            },
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "matchers.ts · 547-558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L547-L558"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "after-failed-tries-both-wait-100",
          "title": "After failed tries, both wait 100, 250, 500, then 1000 ms",
          "text": "After failed tries, both wait 100, 250, 500, then 1000 ms. The 1000 ms wait repeats.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "intervals"
          ],
          "edges": [],
          "defs": [
            "example21",
            "timing",
            "intervals",
            "stop"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 172-174",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L172-L174"
            },
            {
              "label": "expect.ts · 438-441",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L438-L441"
            },
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "matchers.ts · 547-558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L547-L558"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "if-the-next-wait-would-reach-the",
          "title": "If the next wait would reach the time limit, expect.poll or toPass fails without another try",
          "text": "If the next wait would reach the time limit, expect.poll or toPass fails without another try.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "stop"
          ],
          "edges": [],
          "defs": [
            "example22",
            "timing",
            "intervals",
            "stop"
          ],
          "log": [],
          "sources": [
            {
              "label": "expect.ts · 172-174",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L172-L174"
            },
            {
              "label": "expect.ts · 438-441",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L438-L441"
            },
            {
              "label": "expect.ts · 443-453",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
            },
            {
              "label": "matchers.ts · 504-508",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "matchers.ts · 547-558",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L547-L558"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "timing",
          "step": "expect-poll-uses-expect-s-timeou",
          "log": []
        },
        {
          "node": "intervals",
          "step": "after-failed-tries-both-wait-100",
          "log": []
        },
        {
          "node": "stop",
          "step": "if-the-next-wait-would-reach-the",
          "log": [],
          "edge": "deadline",
          "fail": true
        }
      ]
    },
    {
      "id": "soft-error",
      "label": "Soft error",
      "display": {
        "counterLabel": true,
        "edges": "all",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "The block passes; the test fails",
        "text": "expect.soft records a failure. If the block finishes, toPass does not try again."
      },
      "steps": [
        {
          "id": "expect-count-tobe-2-fails-and-th",
          "title": "expect(count).toBe(2) fails and throws",
          "text": "expect(count).toBe(2) fails and throws. toPass can run the block again.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "thrown"
          ],
          "edges": [],
          "defs": [
            "example30",
            "block",
            "soft"
          ],
          "code": "toPass",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "expect.ts · 351-358",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L351-L358"
            },
            {
              "label": "testInfo.ts · 334-337",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/testInfo.ts#L335-L338"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "expect-soft-count-tobe-2-fails",
          "title": "expect.soft(count).toBe(2) fails",
          "text": "expect.soft(count).toBe(2) fails. The next line runs, but the test is marked failed.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "soft"
          ],
          "edges": [],
          "defs": [
            "example31",
            "block",
            "soft"
          ],
          "code": "toPass",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "expect.ts · 351-358",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L351-L358"
            },
            {
              "label": "testInfo.ts · 334-337",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/testInfo.ts#L335-L338"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        },
        {
          "id": "the-block-finishes-without-throw",
          "title": "The block finishes without throwing",
          "text": "The block finishes without throwing. toPass passes without another try; the test still fails.",
          "show": [
            "locator",
            "timing",
            "producer",
            "matcher",
            "pollPass",
            "finished",
            "block",
            "thrown",
            "intervals",
            "stop",
            "soft",
            "failed",
            "resolve",
            "ready",
            "check"
          ],
          "current": [
            "finished"
          ],
          "edges": [],
          "defs": [
            "example32",
            "block",
            "soft"
          ],
          "code": "toPass",
          "log": [],
          "sources": [
            {
              "label": "matchers.ts · 509-518",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
            },
            {
              "label": "timeoutRunner.ts · 42-61",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
            },
            {
              "label": "expect.ts · 351-358",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L351-L358"
            },
            {
              "label": "testInfo.ts · 334-337",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/worker/testInfo.ts#L335-L338"
            }
          ],
          "deeper": [
            {
              "title": "2.1 Two loops behind every click",
              "href": "/2-actions/2-1-two-loops/"
            },
            {
              "title": "2.6 A click waits for its navigation to start, not for the page to load",
              "href": "/2-actions/2-6-waiting-for-navigation/"
            },
            {
              "title": "4.6 Each clock spends its own remaining budget",
              "href": "/4-runner/4-6-timeouts/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "block",
          "step": "expect-count-tobe-2-fails-and-th",
          "log": []
        },
        {
          "node": "thrown",
          "step": "expect-count-tobe-2-fails-and-th",
          "log": [],
          "edge": "throws",
          "fail": true
        },
        {
          "node": "soft",
          "step": "expect-soft-count-tobe-2-fails",
          "log": []
        },
        {
          "node": "failed",
          "step": "expect-soft-count-tobe-2-fails",
          "log": [],
          "edge": "record",
          "fail": true
        },
        {
          "node": "finished",
          "step": "the-block-finishes-without-throw",
          "log": []
        }
      ]
    }
  ],
  "definitions": {
    "locator": {
      "term": "Locator assertion",
      "text": "toHaveText delegates expected text and timeout to locator._expect, which passes its stored selector to the frame."
    },
    "resolve": {
      "term": "Fresh selector resolution",
      "text": "The server checks once, then retries mismatches. Each internal check resolves the selector and runs injected.expect in the page."
    },
    "producer": {
      "term": "Poll producer",
      "text": "expect.poll runs the producer before its matcher-failure catch. A producer error escapes that catch."
    },
    "matcher": {
      "term": "Poll matcher",
      "text": "Poll forces the inner matcher to throw; mismatches trigger another producer call. Locator matchers are refused."
    },
    "block": {
      "term": "Positive toPass",
      "text": "Positive toPass repeats the whole callback when it throws, including earlier requests or actions."
    },
    "timing": {
      "term": "Timeout defaults",
      "text": "Poll inherits the expect timeout, normally 5000 ms. toPass has separate settings and defaults to timeout 0."
    },
    "intervals": {
      "term": "Retry intervals",
      "text": "Poll and toPass default to 100, 250, 500, then 1000 ms waits; the last interval repeats. Tries also take time."
    },
    "stop": {
      "term": "Deadline limit",
      "text": "Neither schedules a wait that reaches its deadline. In a running test, both cap the deadline 250 ms before the test deadline, even with timeout 0."
    },
    "soft": {
      "term": "Soft failure",
      "text": "With a runner step, a soft failure records an error and continues. The test still fails; a soft assertion inside toPass can let the block finish without a retry."
    },
    "example00": {
      "term": "Example state",
      "text": "expect(locator).toHaveText('Ready') · saved text = 'Loading' · expect(locator): read and check again · find the element again · text: Loading · Loading ≠ Ready; try again · expect(locator) is still waiting · expect(savedText).toBe('Ready') · fails: savedText is still Loading"
    },
    "example01": {
      "term": "Example state",
      "text": "expect(locator).toHaveText('Ready') · saved text = 'Loading' · expect(locator): read and check again · find the element again · text: Loading · Loading ≠ Ready; try again · expect(locator) is still waiting · expect(savedText).toBe('Ready') · fails: savedText is still Loading"
    },
    "example02": {
      "term": "Example state",
      "text": "expect(locator).toHaveText('Ready') · saved text = 'Loading' · expect(locator): read and check again · find the element again · text: Ready · Ready = Ready; passes ✓ · expect(locator) passes ✓ · expect(savedText).toBe('Ready') · fails: savedText is still Loading"
    },
    "example10": {
      "term": "Example state",
      "text": "expect.poll(readCount).toBe(2) · expect.poll: read and check again · readCount() → 1 · expect(1).toBe(2) fails · try again after 100 ms · expect.poll is still waiting · If readCount() throws: · expect.poll fails; no retry"
    },
    "example11": {
      "term": "Example state",
      "text": "expect.poll(readCount).toBe(2) · expect.poll: read and check again · readCount() → 2 · expect(2).toBe(2) passes ✓ · no more tries · expect.poll passes ✓ · If readCount() throws: · expect.poll fails; no retry"
    },
    "example12": {
      "term": "Example state",
      "text": "expect(async () => { … }).toPass() · toPass: repeat every line · await write() · const count = await readCount() · expect(count).toBe(2) fails · toPass tries again after 100 ms · count = 1 · failed assertion throws"
    },
    "example13": {
      "term": "Example state",
      "text": "expect(async () => { … }).toPass() · toPass: repeat every line · await write() · runs again · const count = await readCount() · expect(count).toBe(2) passes ✓ · toPass passes ✓ · count = 2 · write() ran twice in this example"
    },
    "example20": {
      "term": "Example state",
      "text": "expect.poll / toPass · timeout defaults · expect.poll: timeout 5000 ms · toPass: timeout 0 · the test timeout still limits both · timeout 0: no own time limit · toPass has its own timeout setting · expect's timeout does not set it"
    },
    "example21": {
      "term": "Example state",
      "text": "expect.poll / toPass · default intervals · fail → wait 100 ms → try again · fail → wait 250 ms → try again · fail → wait 500 ms → try again · then wait 1000 ms after each failure · intervals sets waits between tries · tries do not start at fixed times"
    },
    "example22": {
      "term": "Example state",
      "text": "expect.poll / toPass · when time runs out · the check still fails · next wait reaches the time limit · fails; no next try · the test timeout also limits retries · toPass({ timeout: 0 }) · still cannot outlast the test"
    },
    "example30": {
      "term": "Example state",
      "text": "expect(async () => { … }).toPass() · toPass: repeat every line · const count = 1 · expect(count).toBe(2) fails · throws; next line does not run · toPass tries again after 100 ms · use expect.soft to keep going · after a failed assertion"
    },
    "example31": {
      "term": "Example state",
      "text": "expect(async () => { … }).toPass() · toPass: run the block · const count = 1 · expect.soft(count).toBe(2) fails · next line runs · soft failure recorded; no throw · the block keeps running · the test has a recorded failure · ✗ failed test"
    },
    "example32": {
      "term": "Example state",
      "text": "expect(async () => { … }).toPass() · toPass: run the block · const count = 1 · expect.soft(count).toBe(2) fails · next line runs · toPass passes ✓; no retry · the block finished without throwing · the soft failure stays recorded · ✗ failed test"
    }
  },
  "code": {
    "live": {
      "title": "In your test · keep the lookup live",
      "lines": [
        "// ✗ Compare one captured string",
        "expect(await status.textContent())",
        "  .toBe('Ready');",
        "// ✓ Let the server repeat the check",
        "await expect(status).toHaveText('Ready');"
      ]
    },
    "poll": {
      "title": "Inside Playwright · expect.ts",
      "source": {
        "label": "expect.ts:443-443",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443"
      },
      "lines": [
        "    const value = await actual();",
        "    try {",
        "      await callMatcherAsStep(",
        "        matcherName, {",
        "          ...info, poll: undefined,",
        "          isSoft: false",
        "        }, value, matcher, args);",
        "      return {",
        "        continuePolling: false,",
        "        result: undefined",
        "      };",
        "    } catch (error) {",
        "      return {",
        "        continuePolling: true, result: error",
        "      };",
        "    }"
      ]
    },
    "choose": {
      "title": "In your test · choose the repeated work",
      "lines": [
        "// ✓ Repeat a read and its matcher",
        "await expect.poll(readCount).toBe(2);",
        "// ✓ Repeat the entire block on failure",
        "await expect(async () => {",
        "  // ✗ A write here may repeat too",
        "  // await incrementCount();",
        "  const count = await readCount();",
        "  expect(count).toBe(2);",
        "}).toPass({ timeout: 5_000 });"
      ]
    },
    "toPass": {
      "title": "Inside Playwright · matchers.ts",
      "source": {
        "label": "matchers.ts:509-509",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509"
      },
      "lines": [
        "    try {",
        "      await callback();",
        "      return {",
        "        continuePolling: !!this.isNot,",
        "        result: undefined",
        "      };",
        "    } catch (e) {",
        "      return {",
        "        continuePolling: !this.isNot,",
        "        result: e",
        "      };",
        "    }"
      ]
    }
  },
  "conceptScenario": "intro",
  "concepts": [
    {
      "label": "Node · locator delegation",
      "layer": "client",
      "items": [
        {
          "definition": "locator",
          "short": "Passes the stored selector to the frame.",
          "nodes": [
            "locator"
          ],
          "step": {
            "step": "the-assertion-delegates-its-sele"
          },
          "source": {
            "label": "locator.ts · 423-428",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/client/locator.ts#L434-L439"
          }
        }
      ]
    },
    {
      "label": "Node · worker test code",
      "layer": "app",
      "items": [
        {
          "definition": "producer",
          "short": "The producer runs before the matcher-failure catch.",
          "nodes": [
            "producer"
          ],
          "step": {
            "step": "poll-repeats-a-producer-and-its"
          },
          "source": {
            "label": "expect.ts · 443-453",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
          }
        },
        {
          "definition": "block",
          "short": "Positive toPass retries the callback when it throws.",
          "nodes": [
            "block"
          ],
          "step": {
            "step": "positive-topass-repeats-the-whol"
          },
          "source": {
            "label": "matchers.ts · 509-518",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L509-L518"
          }
        }
      ]
    },
    {
      "label": "Node · test worker",
      "layer": "runner",
      "items": [
        {
          "definition": "matcher",
          "short": "Poll’s inner matcher uses isSoft: false.",
          "nodes": [
            "matcher"
          ],
          "step": {
            "step": "poll-repeats-a-producer-and-its"
          },
          "source": {
            "label": "expect.ts · 443-453",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L443-L453"
          }
        },
        {
          "definition": "timing",
          "short": "toPass defaults to timeout 0.",
          "nodes": [
            "timing"
          ],
          "step": {
            "step": "the-timeout-defaults-differ"
          },
          "source": {
            "label": "matchers.ts · 504-508",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/matchers.ts#L504-L508"
          }
        },
        {
          "definition": "intervals",
          "short": "The last polling interval repeats.",
          "nodes": [
            "intervals"
          ],
          "step": {
            "step": "the-final-wait-repeats"
          },
          "source": {
            "label": "timeoutRunner.ts · 42-61",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
          }
        },
        {
          "definition": "stop",
          "short": "A wait reaching the deadline is not scheduled.",
          "nodes": [
            "stop"
          ],
          "step": {
            "step": "the-deadline-can-prevent-another"
          },
          "source": {
            "label": "timeoutRunner.ts · 42-61",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/isomorphic/timeoutRunner.ts#L42-L61"
          }
        },
        {
          "definition": "soft",
          "short": "With a runner step, soft failures complete without throwing.",
          "nodes": [
            "soft"
          ],
          "step": {
            "step": "a-soft-failure-can-finish-the-bl"
          },
          "source": {
            "label": "expect.ts · 351-358",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/matchers/expect.ts#L351-L358"
          }
        }
      ]
    },
    {
      "label": "Playwright server",
      "layer": "server",
      "items": [
        {
          "definition": "resolve",
          "short": "Server retries run the expectation again.",
          "nodes": [
            "resolve",
            "ready"
          ],
          "step": {
            "step": "the-server-repeats-a-fresh-check"
          },
          "source": {
            "label": "frames.ts · 1505-1516",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1503-L1514"
          }
        }
      ]
    },
    {
      "label": "Page · injected script",
      "layer": "page",
      "items": [
        {
          "definition": "resolve",
          "short": "Each internal check calls injected.expect.",
          "nodes": [
            "check"
          ],
          "step": {
            "step": "the-server-repeats-a-fresh-check"
          },
          "source": {
            "label": "frames.ts · 1550-1558",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright-core/src/server/frames.ts#L1548-L1555"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "locator",
      "resolve",
      "check",
      "ready"
    ],
    "2": [
      "producer",
      "matcher",
      "pollPass",
      "block",
      "thrown",
      "finished"
    ],
    "3": [
      "timing",
      "intervals",
      "stop"
    ],
    "4": [
      "soft",
      "failed",
      "finished"
    ]
  },
  "deeper": [
    {
      "title": "2.1 Two loops behind every click",
      "href": "/2-actions/2-1-two-loops/",
      "why": "Selector resolution and actionability retry."
    },
    {
      "title": "2.6 A click waits for its navigation to start, not for the page to load",
      "href": "/2-actions/2-6-waiting-for-navigation/",
      "why": "A click waits for navigation to start."
    },
    {
      "title": "4.6 Each clock spends its own remaining budget",
      "href": "/4-runner/4-6-timeouts/",
      "why": "Each clock spends its own remaining budget."
    }
  ],
  "viewBox": [
    1535.26,
    641.8
  ],
  "measurement": {
    "name": "font-table",
    "labels": {
      "value": {
        "width": 31.604999999999997,
        "height": 12.6
      },
      "pollRetry": {
        "width": 94.81499999999998,
        "height": 12.6
      },
      "throws": {
        "width": 37.925999999999995,
        "height": 12.6
      },
      "blockRetry": {
        "width": 113.77799999999998,
        "height": 12.6
      },
      "deadline": {
        "width": 132.74099999999999,
        "height": 12.6
      },
      "record": {
        "width": 94.81499999999998,
        "height": 12.6
      },
      "injected": {
        "width": 88.49399999999999,
        "height": 12.6
      },
      "locatorRetry": {
        "width": 31.604999999999997,
        "height": 12.6
      },
      "match": {
        "width": 44.24699999999999,
        "height": 12.6
      }
    }
  }
}
