{
  "doc": {
    "id": "accessibility/configuration/significantattributes",
    "title": "Significant Attributes | Cypress Accessibility",
    "description": "The `significantAttributes` configuration property allows users to specify custom attributes that should be considered \"significant\" for the purpose of identification and grouping.",
    "section": "accessibility",
    "source_path": "/llm/markdown/accessibility/configuration/significantattributes.md",
    "version": "6a908a532b1fca4ed18538a4c1c5a9bc7f24f403",
    "updated_at": "2026-05-01T19:25:18.656Z",
    "headings": [
      {
        "id": "accessibility/configuration/significantattributes#significantattributes",
        "text": "significantAttributes",
        "level": 1
      },
      {
        "id": "accessibility/configuration/significantattributes#why-use-significant-attributes",
        "text": "Why use significant attributes?",
        "level": 2
      },
      {
        "id": "accessibility/configuration/significantattributes#scope",
        "text": "Scope",
        "level": 2
      },
      {
        "id": "accessibility/configuration/significantattributes#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "accessibility/configuration/significantattributes#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "accessibility/configuration/significantattributes#marking-specific-attributes-as-significant",
        "text": "Marking specific attributes as significant",
        "level": 3
      },
      {
        "id": "accessibility/configuration/significantattributes#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/significantattributes#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/significantattributes#significant-attributes-tracked",
        "text": "Significant attributes tracked",
        "level": 4
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "significantAttributes"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The `significantAttributes` property allows you to specify which attributes should be considered significant when identifying elements in Cypress Accessibility."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Why use significant attributes?"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress uses a "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/accessibility/core-concepts/element-identification.md",
            "children": [
              {
                "type": "text",
                "value": "default set of attributes"
              }
            ]
          },
          {
            "type": "text",
            "value": " (such as common test ID patterns), in a priority order, as the preferred way to identify elements in reports."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The values of these attributes are used as element identifiers, which helps us recognize the same element in multiple contexts and deduplicate the findings. This helps when reviewing run reports, or comparing reports in Branch Review."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "You may have attributes already in place in your application that would help with element organization, such as `data-component-name`. If you would like Cypress to use and prioritize these attributes, or you want to change the default priority order, you can define your own list of significant attributes."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Scope"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Note: setting `significantAttributes` impacts both Cypress Accessibility and UI Coverage reports if set at the root of the configuration. Nesting this property under an `accessibility` or `uiCoverage` key is supported, if you need to split them up."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`significantAttributes` is an array of strings, with each string being the name of a HTML attribute."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"significantAttributes\": [    string  ]}"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Marking specific attributes as significant"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Config"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"significantAttributes\": [\"class\", \"id\", \"data-context\"]}"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "HTML"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<body>  <button class=\"primary\" id=\"submit\" data-testid=\"submit\" data-context=\"user-signup\">    Submit  </button></body>"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Significant attributes tracked"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "class=\"primary\", id=\"submit\", data-context=\"user-signup\""
      }
    ]
  },
  "token_estimate": 317
}