Skip to content

Commit

Permalink
Add example of excluding disabled elements form elementFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Jan 24, 2025
1 parent f0e8a51 commit 2fd3c73
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/ui-coverage/configuration/elementfilters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,35 @@ sidebar_label: elementFilters
# elementFilters

<ElementFilters />

### Excluding disabled elements

UI Coverage highlights disabled elements by default to reveal potential untested paths in your app, in case those elements become enabled later. If needed, you can exclude them from the report using the `elementFilters` configuration.

#### Config

```json
{
"elementFilters": [
{
"selector": "[disabled]",
"include": false
}
]
}
```

#### HTML

```xml
<body>
<button data-cy='cancel'>Cancel</button>
<button disabled data-cy='submit'>Submit</button>
</body>
```

#### Elements shown in UI

```
[data-cy='cancel']
```

0 comments on commit 2fd3c73

Please sign in to comment.