{
  "doc": {
    "id": "ui-coverage/configuration/viewfilters",
    "title": "View Filters | Cypress UI Coverage",
    "description": "The `viewFilters` property allows you to specify URL patterns for URLs that should be excluded from UI Coverage.",
    "section": "ui-coverage",
    "source_path": "/llm/markdown/ui-coverage/configuration/viewfilters.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "ui-coverage/configuration/viewfilters#viewfilters",
        "text": "viewFilters",
        "level": 1
      },
      {
        "id": "ui-coverage/configuration/viewfilters#why-use-view-filters",
        "text": "Why use view filters?",
        "level": 2
      },
      {
        "id": "ui-coverage/configuration/viewfilters#scope",
        "text": "Scope",
        "level": 2
      },
      {
        "id": "ui-coverage/configuration/viewfilters#note-on-product-specific-behavior",
        "text": "Note on product-specific behavior",
        "level": 2
      },
      {
        "id": "ui-coverage/configuration/viewfilters#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "ui-coverage/configuration/viewfilters#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "ui-coverage/configuration/viewfilters#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "ui-coverage/configuration/viewfilters#excluding-urls-by-hostname",
        "text": "Excluding URLs by hostname",
        "level": 3
      },
      {
        "id": "ui-coverage/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#including-only-specific-urls",
        "text": "Including only specific URLs",
        "level": 3
      },
      {
        "id": "ui-coverage/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#excluding-error-pages",
        "text": "Excluding error pages",
        "level": 3
      },
      {
        "id": "ui-coverage/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "ui-coverage/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      }
    ]
  },
  "chunks": [
    {
      "id": "ui-coverage/configuration/viewfilters#why-use-view-filters",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Why use view filters?",
      "heading_level": 2,
      "content_markdown": "## Why use view filters?\n\n*   **Exclude Third-Party URLs**: If your application integrates with third-party services, you might want to exclude their URLs from analysis.\n*   **Exclude Admin Pages**: URLs that are not part of the user-facing application, such as admin pages, could be excluded from reports.\n*   **Reduce Noise**: Certain URLs visited during tests (e.g., error pages or redirects) may not represent meaningful user flows. Exclude these to clean up your reports.\n*   **Optimize Performance**: Filtering out irrelevant URLs reduces the amount of data processed, speeding up analysis and improving report readability.\n",
      "section": "ui-coverage",
      "anchors": [
        "why-use-view-filters"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 124
    },
    {
      "id": "ui-coverage/configuration/viewfilters#scope",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Scope",
      "heading_level": 2,
      "content_markdown": "## Scope\n\n**Note:** setting `viewFilters` impacts both Accessibility and UI Coverage reports. Nesting this property under an `accessibility` or `uiCoverage` key is supported, if you need to split them up.\n",
      "section": "ui-coverage",
      "anchors": [
        "scope"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 40
    },
    {
      "id": "ui-coverage/configuration/viewfilters#note-on-product-specific-behavior",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Note on product-specific behavior",
      "heading_level": 2,
      "content_markdown": "## Note on product-specific behavior\n\n*   In UI Coverage, excluding a URL excludes all application snapshots from that URL from the reports, and **also** excludes all links pointing to that URL from being counted towards coverage scores.\n*   In Cypress Accessibility, excluding a URL excludes all application snapshots from that URL from the reports, but has no other effects.\n",
      "section": "ui-coverage",
      "anchors": [
        "note-on-product-specific-behavior"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 79
    },
    {
      "id": "ui-coverage/configuration/viewfilters#syntax",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\n{  \"viewFilters\": [    {      \"pattern\": string,      \"include\": boolean,      \"comment\": string    }  ]}\n```\n\n### Options\n\nFor every URL visited and link element found, the first `viewFilters` rule for which the `pattern` matches the URL is used to either include or exclude the URL based on the `include` value. URLs that do not match any rules are included by default.\n\n| Option | Required | Default | Description |\n| --- | --- | --- | --- |\n| `pattern` | Required |  | A string that matches URLs using [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax. |\n| `include` | Optional | `true` | A boolean that determines whether matching URLs should be included in the report. |\n| `comment` | Optional |  | A comment describing the purpose of this filter rule. |\n",
      "section": "ui-coverage",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 179
    },
    {
      "id": "ui-coverage/configuration/viewfilters#options",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Options",
      "heading_level": 3,
      "content_markdown": "### Options\n\nFor every URL visited and link element found, the first `viewFilters` rule for which the `pattern` matches the URL is used to either include or exclude the URL based on the `include` value. URLs that do not match any rules are included by default.\n\n| Option | Required | Default | Description |\n| --- | --- | --- | --- |\n| `pattern` | Required |  | A string that matches URLs using [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax. |\n| `include` | Optional | `true` | A boolean that determines whether matching URLs should be included in the report. |\n| `comment` | Optional |  | A comment describing the purpose of this filter rule. |\n",
      "section": "ui-coverage",
      "anchors": [
        "options"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 157
    },
    {
      "id": "ui-coverage/configuration/viewfilters#examples",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Excluding URLs by hostname\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"https://app.okta.com/*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://app.okta.com/loginhttps://cypress.io/homehttps://cypress.io/about\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/homehttps://cypress.io/about\n```\n\n* * *\n\n### Including only specific URLs\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"https://cypress.io/dashboards*\",      \"include\": true    },    {      \"pattern\": \"*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://cypress.io/dashboardshttps://cypress.io/dashboards/1https://cypress.io/dashboards/2https://cypress.io/homehttps://cypress.io/login\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/dashboardshttps://cypress.io/dashboards/*\n```\n\n### Excluding error pages\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"http*://*/404\",      \"include\": false    },    {      \"pattern\": \"http*://*/error/*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://cypress.io/homehttps://cypress.io/404https://cypress.io/error/500\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/home\n```\n",
      "section": "ui-coverage",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 153
    },
    {
      "id": "ui-coverage/configuration/viewfilters#excluding-urls-by-hostname",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Excluding URLs by hostname",
      "heading_level": 3,
      "content_markdown": "### Excluding URLs by hostname\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"https://app.okta.com/*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://app.okta.com/loginhttps://cypress.io/homehttps://cypress.io/about\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/homehttps://cypress.io/about\n```\n\n* * *\n",
      "section": "ui-coverage",
      "anchors": [
        "excluding-urls-by-hostname"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 48
    },
    {
      "id": "ui-coverage/configuration/viewfilters#including-only-specific-urls",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Including only specific URLs",
      "heading_level": 3,
      "content_markdown": "### Including only specific URLs\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"https://cypress.io/dashboards*\",      \"include\": true    },    {      \"pattern\": \"*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://cypress.io/dashboardshttps://cypress.io/dashboards/1https://cypress.io/dashboards/2https://cypress.io/homehttps://cypress.io/login\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/dashboardshttps://cypress.io/dashboards/*\n```\n",
      "section": "ui-coverage",
      "anchors": [
        "including-only-specific-urls"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 52
    },
    {
      "id": "ui-coverage/configuration/viewfilters#excluding-error-pages",
      "doc_id": "ui-coverage/configuration/viewfilters",
      "heading": "Excluding error pages",
      "heading_level": 3,
      "content_markdown": "### Excluding error pages\n\n#### Config\n\n```\n{  \"viewFilters\": [    {      \"pattern\": \"http*://*/404\",      \"include\": false    },    {      \"pattern\": \"http*://*/error/*\",      \"include\": false    }  ]}\n```\n\n#### Visited URLs\n\n```\nhttps://cypress.io/homehttps://cypress.io/404https://cypress.io/error/500\n```\n\n#### Views shown in UI\n\n```\nhttps://cypress.io/home\n```\n",
      "section": "ui-coverage",
      "anchors": [
        "excluding-error-pages"
      ],
      "path": "/llm/json/chunked/ui-coverage/configuration/viewfilters.json",
      "token_estimate": 51
    }
  ]
}