{
  "doc": {
    "id": "api/cypress-api/currentretry",
    "title": "Cypress.currentRetry | Cypress Documentation",
    "description": "Cypress.currentRetry is a number representing the current test retry count.",
    "section": "api",
    "source_path": "/llm/markdown/api/cypress-api/currentretry.md",
    "version": "6a908a532b1fca4ed18538a4c1c5a9bc7f24f403",
    "updated_at": "2026-05-01T19:25:18.656Z",
    "headings": [
      {
        "id": "api/cypress-api/currentretry#cypress-currentretry",
        "text": "Cypress.currentRetry",
        "level": 1
      },
      {
        "id": "api/cypress-api/currentretry#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/currentretry#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/currentretry#get-current-test-retry",
        "text": "Get current test retry",
        "level": 3
      },
      {
        "id": "api/cypress-api/currentretry#history",
        "text": "History",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.currentRetry"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.currentRetry` is a number representing the current "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/guides/test-retries.md",
            "children": [
              {
                "type": "text",
                "value": "test retry"
              }
            ]
          },
          {
            "type": "text",
            "value": " count."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Note that `Cypress.currentRetry` may only be used inside tests and "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/writing-and-organizing-tests.md#Hooks",
            "children": [
              {
                "type": "text",
                "value": "test hooks"
              }
            ]
          },
          {
            "type": "text",
            "value": ", and will be `null` outside of tests and test hooks."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "Cypress.currentRetry"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Get current test retry"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('example', () => {  expect(Cypress.currentRetry).to.eq(0)})"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "History"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Version"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Changes"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#12-3-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "12.3.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Added `Cypress.currentRetry`"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 95
}