-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update UI Coverage documenation #6236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
marktnoonan
commented
Jul 31, 2025
- Update element identification and interaction commands docs to reference addition ways of managing what is considered interactive, and what commands count towards coverage.
- Fix incorrect docs for significant attributes format.
cypress-documentation
|
Project |
cypress-documentation
|
Branch Review |
marktnoonan/significant-attributes
|
Run status |
|
Run duration | 03m 27s |
Commit |
|
Committer | marktnoonan |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
309
|
View all changes introduced in this branch ↗︎ |
UI Coverage
10.95%
|
|
---|---|
|
2455
|
|
3
|
Accessibility
96.98%
|
|
---|---|
|
1 critical
3 serious
4 moderate
0 minor
|
|
25
|
"attributes": ["aria-*"] | ||
} | ||
] | ||
"significantAttributes": ["aria-*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this doesn't support wildcarding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure if this API exactly matches what unique-selector accepts, but if it does, it would be something like['attribute:aria-label', 'attribute:role', 'id', 'class']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jennifer-shehane That's abstracted away by UICov logic here https://github.com/cypress-io/cypress-services/blob/develop/discovery/packages/common/src/elementProcessingUtils.ts#L72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I didn't verify on the wildcarding, I'll remove this from the PR
<div data-cy-ui-interactive="include">Custom interactive widget</div> | ||
``` | ||
|
||
It most cases we recommend **not** using this override, and instead updating the HTML to be something the browser would already consider to be interactive. This will likely produce better overall behavior, including for accessibility purposes. `data-cy-ui-interactive` is a fallback for situations where that may not be possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I would word this a bit more strongly - something like "use of this attribute is a strong signal there is an issue with the HTML structure of your application which likely has real-world impacts for users, particularly those using screen readers or with disabilities. If possible we recommend updating your HTML to better convey the interactive nature of this element; this would improve the functionality of your application for these users as well as automatically detect the element in the report. As a fallback for scenarios where this isn't possible......."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure about this. Since we can now support requiring custom commands and the "assert" command - you might have a totally valid reason to want to change the definition of what we consider interactive without it implying the elements themselves are broken.
Still might need another pass at this though - the framing of everything in terms of "interactions" might not be the most accurate, long term. Will think on it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big proponent of getting this update in since we have confused ourselves talking about this doc.
"attributes": ["aria-*"] | ||
} | ||
] | ||
"significantAttributes": ["aria-*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure if this API exactly matches what unique-selector accepts, but if it does, it would be something like['attribute:aria-label', 'attribute:role', 'id', 'class']
…om/cypress-io/cypress-documentation into marktnoonan/significant-attributes