Skip to content

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

Merged
merged 7 commits into from
Aug 6, 2025
Merged

Conversation

marktnoonan
Copy link
Contributor

  • 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.

Copy link

cypress bot commented Jul 31, 2025

cypress-documentation    Run #590

Run Properties:  status check passed Passed #590  •  git commit 8fe848ce82: Merge branch 'marktnoonan/significant-attributes' of https://github.com/cypress-...
Project cypress-documentation
Branch Review marktnoonan/significant-attributes
Run status status check passed Passed #590
Run duration 03m 27s
Commit git commit 8fe848ce82: Merge branch 'marktnoonan/significant-attributes' of https://github.com/cypress-...
Committer marktnoonan
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 309
View all changes introduced in this branch ↗︎
UI Coverage  10.95%
  Untested elements 2455  
  Tested elements 3  
Accessibility  96.98%
  Failed rules  1 critical   3 serious   4 moderate   0 minor
  Failed elements 25  

"attributes": ["aria-*"]
}
]
"significantAttributes": ["aria-*"]
Copy link
Contributor

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

Copy link
Member

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']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.
Copy link
Contributor

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......."

Copy link
Contributor Author

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.

Copy link
Member

@jennifer-shehane jennifer-shehane left a 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-*"]
Copy link
Member

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']

@marktnoonan marktnoonan merged commit e590bbf into main Aug 6, 2025
11 checks passed
@marktnoonan marktnoonan deleted the marktnoonan/significant-attributes branch August 6, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants