Skip to content
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

Add guides for Cypress Accessibility #6053

Merged
merged 16 commits into from
Dec 19, 2024
Merged

Conversation

marktnoonan
Copy link
Contributor

This PR adds a new Guides section for the Cypress Accessibility product, updates its changelog, and fixes a CSS issue in the footer.

Copy link

cypress bot commented Dec 18, 2024

cypress-documentation    Run #187

Run Properties:  status check passed Passed #187  •  git commit ba1c7381ef: updates based on PR feedback
Project cypress-documentation
Branch Review marktnoonan/accessibility-guides
Run status status check passed Passed #187
Run duration 03m 47s
Commit git commit ba1c7381ef: updates based on PR feedback
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 279
View all changes introduced in this branch ↗︎
UI Coverage  10.88%
  Untested elements 2218  
  Tested elements 3  
Accessibility  95.76%
  Failed rules  1 critical   5 serious   4 moderate   0 minor
  Failed elements 500  

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.

Just a few changes. I’ll approve without you having addressed them all.

I love having these guides in our docs. The tone and guidance and understanding is a great step forward for us.

In general, I have a few things to mention:

  • There are a lot of run on sentences that could be cleaned up more.
  • It’d be great to get it to be a bit more scannable
  • you might consider having an “example” of the guidance of each page, where it walks through an example project and how to walk through each step with pictures.


### Assistive technology support

Certain accessibility techniques are not fully supported by all assistive technologies like screen readers or voice control software. Axe Core® accounts for this. The software and operating systems tested against are listed in their [Accessibility Supported document](https://github.com/dequelabs/axe-core/blob/develop/doc/accessibility-supported.md). For example: it can seem like a false positive from Axe Core® if a failing technique used in your code appears to work correctly in a certain screen reader, browser and operating system combination that you test with. But if it does not have sufficient accessibility support in commonly used technology configurations, Axe Core® will intentionally fail that technique, allowing you to switch to something with better support.
Copy link
Member

Choose a reason for hiding this comment

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

This guide feels like it ends abruptly. I think it’d benefit from some kind of summary or what next. Not blocking this PR though


<DocsImage
src="/img/accessibility/guides/github-actions-a11y-block.png"
width="75%"
Copy link
Member

Choose a reason for hiding this comment

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

These widths can look strange on mobile, so always something to check out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Also really wish I could center them, but I didn't find a good way to do that. Edge-to-edge is just too big for a lot of these, left aligned feels a bit odd too though.


## Using the Results API

The Cypress Accessibility Results API provides access to accessibility results after the run is completed, so that you can implement patterns like blocking a pull request or sending out alerts based on specific accessibility criteria. This is done by adding a separate accessibility verification step to your CI pipeline, and using a helper function provided by Cypress to automatically request the report for the appropriate Cypress run based on the build context. The example below shows how this can look in GitHub Actions when there is an accessibility failure based on your own chosen policy:
Copy link
Member

Choose a reason for hiding this comment

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

Should we link to the results api doc here?

docs/accessibility/guides/blocking-pull-requests.mdx Outdated Show resolved Hide resolved
docs/accessibility/guides/blocking-pull-requests.mdx Outdated Show resolved Hide resolved
docs/accessibility/guides/maintaining-accessibility.mdx Outdated Show resolved Hide resolved
docs/accessibility/guides/maintaining-accessibility.mdx Outdated Show resolved Hide resolved
docs/accessibility/guides/maintaining-accessibility.mdx Outdated Show resolved Hide resolved
docs/accessibility/guides/maximizing-coverage.mdx Outdated Show resolved Hide resolved
(loc) => loc.textContent
)
Cypress._.each(URLs, (URL) => {
cy.visit(URL)
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend splitting this up into separate tests for performance reasons. This could end up being a very long non-performant test. The docs themselves have tests like this - but split into visiting a different page on each test definition.

npx cypress run --key <record_key> --record --spec "cypress/e2e/my-spec.cy.js"
```

(You can skip the `--key` option by setting `CYPRESS_RECORD_KEY` as an environment variable. Learn more about recording in our [docs about recorded runs](/guides/cloud/recorded-runs)).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(You can skip the `--key` option by setting `CYPRESS_RECORD_KEY` as an environment variable. Learn more about recording in our [docs about recorded runs](/guides/cloud/recorded-runs)).
(You can skip the `--key` option by setting `CYPRESS_RECORD_KEY` as an environment variable. Learn more about recording in our [docs about recorded runs](/cloud/features/recorded-runs)).

Moved content - fails to build if not corrected

@marktnoonan marktnoonan merged commit a4486d0 into main Dec 19, 2024
10 checks passed
@marktnoonan marktnoonan deleted the marktnoonan/accessibility-guides branch December 19, 2024 13:59
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