Skip to content

Commit ca75c90

Browse files
fix: Improve accessibility for Docs (#6068)
* Add title to icons within API that did not have title or aria-label * try to address some common color-contrast issues * lint * Fix links without text * remove line highlight that make text contrast unreadable * Fix dark theme active color * Fix heading levels * Fix heading levels * lint * Fix broken link
1 parent 3fd06e1 commit ca75c90

File tree

123 files changed

+462
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+462
-478
lines changed

docs/accessibility/configuration/viewfilters.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ By default, every URL that is visited within a run is included in the Accessibil
1818

1919
For every URL visited by Cypress in a run and every link element found, the first `viewFilters` rule for which the `pattern` property 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.
2020

21-
## Syntax <a href="#syntax" id="syntax"></a>
21+
## Syntax
2222

2323
```typescript
2424
{
@@ -31,29 +31,29 @@ For every URL visited by Cypress in a run and every link element found, the firs
3131
}
3232
```
3333

34-
### viewFilters <a href="#viewfilters" id="viewfilters"></a>
34+
### viewFilters
3535

3636
_Optional._ Object\[]
3737

3838
An array of objects used to specify URLs to exclude from Accessibility. _**Each object can have the following properties:**_
3939

40-
### pattern <a href="#pattern" id="pattern"></a>
40+
### pattern
4141

4242
_Required._ String (URL Pattern)
4343

4444
Used to match URLs. Uses [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax.
4545

46-
### include <a href="#include" id="include"></a>
46+
### include
4747

4848
_Optional._ Boolean
4949

5050
_Default:_ `true`
5151

5252
A boolean that represents whether or not a matched URL should be included in Accessibility.
5353

54-
## Examples <a href="#examples" id="examples"></a>
54+
## Examples
5555

56-
### Excluding URLs by hostname <a href="#excluding-urls-by-hostname" id="excluding-urls-by-hostname"></a>
56+
### Excluding URLs by hostname
5757

5858
**Config**
5959

@@ -83,7 +83,7 @@ https://cypress.io/home
8383
https://cypress.io/about
8484
```
8585

86-
### Including only specific URLs <a href="#including-only-specific-urls" id="including-only-specific-urls"></a>
86+
### Including only specific URLs
8787

8888
**Config**
8989

docs/accessibility/configuration/views.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ The `groupBy` property of a view definition allows you to create multiple views
3636
}
3737
```
3838

39-
### views <a href="#views" id="views"></a>
39+
### views
4040

4141
_Optional._ Object\[]
4242

4343
An array of objects used to define views within Accessibility. _**Each object can have the following properties:**_
4444

45-
### pattern <a href="#pattern" id="pattern"></a>
45+
### pattern
4646

4747
_Required._ String (URL Pattern)
4848

4949
A URL pattern that is used to group matching URLs into a view. Uses [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax.
5050

51-
### groupBy <a href="#groupby" id="groupby"></a>
51+
### groupBy
5252

5353
_Optional._ String\[]
5454

5555
The URL parameters that should be used to subdivide the URLs into multiple views, rather than being grouped into a single view.
5656

57-
## Examples <a href="#examples" id="examples"></a>
57+
## Examples
5858

59-
### Grouping dynamic path parameters <a href="#grouping-dynamic-path-parameters" id="grouping-dynamic-path-parameters"></a>
59+
### Grouping dynamic path parameters
6060

6161
**Config**
6262

@@ -85,7 +85,7 @@ https://cypress.io/users/bob#baz
8585
https://cypress.io/users/*
8686
```
8787

88-
### Using named path parameters <a href="#using-named-path-parameters" id="using-named-path-parameters"></a>
88+
### Using named path parameters
8989

9090
**Config**
9191

@@ -116,7 +116,7 @@ https://cypress.io/users/bob#baz
116116
https://cypress.io/users/:name
117117
```
118118

119-
### Grouping URLs by named path parameters <a href="#grouping-urls-by-named-path-parameters" id="grouping-urls-by-named-path-parameters"></a>
119+
### Grouping URLs by named path parameters
120120

121121
**Config**
122122

@@ -149,7 +149,7 @@ https://cypress.io/analytics/performance/:id
149149
https://cypress.io/analytics/usage/:id
150150
```
151151

152-
### Grouping URLs by named query parameters <a href="#grouping-urls-by-named-query-parameters" id="grouping-urls-by-named-query-parameters"></a>
152+
### Grouping URLs by named query parameters
153153

154154
**Config**
155155

@@ -180,7 +180,7 @@ https://cypress.io/app?name=hello
180180
https://cypress.io/app?name=world
181181
```
182182

183-
### Grouping URLs by path parameters to ignore dynamic hosts <a href="#grouping-urls-by-path-parameters-to-ignore-dynamic-hosts" id="grouping-urls-by-path-parameters-to-ignore-dynamic-hosts"></a>
183+
### Grouping URLs by path parameters to ignore dynamic hosts
184184

185185
**Config**
186186

docs/accessibility/core-concepts/inspecting-violation-details.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ After navigating to a specific Rule of View from a [Run-level report](/accessibi
1818

1919
This page is divided into two main sections: **Rules** and **Snapshots**.
2020

21-
### Rules
21+
## Rules
2222

2323
The left-hand side of the detail view lists all Rules that match the current filters for the selected View. If no specific View is selected, the list applies to all Views in the run.
2424

25-
#### Rule details
25+
### Rule details
2626

2727
Each Rule can be expanded to reveal related elements and additional information:
2828

2929
- **Description**: Text explaining the rule, its origin, the affected user experiences, and how to fix the issue.
3030
- **Learn More**: A link to Deque University for in-depth guidance.
3131

32-
#### Element details
32+
### Element details
3333

3434
Clicking on an element in the expanded Rule section provides:
3535

@@ -44,7 +44,7 @@ Clicking on an element in the expanded Rule section provides:
4444
alt="Details displayed after clicking on an element in the Rules section of the Cypress Accessibility issue detail view. Options to copy the selector, print to console, share the issue, and solutions are available."
4545
/>
4646

47-
### Snapshots
47+
## Snapshots
4848

4949
Snapshots are fully hydrated HTML and CSS representations of your application's state during the test. Unlike screenshots or video, these snapshots allow you to:
5050

docs/api/commands/and.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A method to be called on the chainer.
7272
Pass a function that can have any number of explicit assertions within it.
7373
Whatever was passed to the function is what is yielded.
7474

75-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
75+
<HeaderYields />
7676

7777
- In most cases, `.and()` yields the same subject it was given.
7878
- `.and()` is an assertion, and it is _safe_ to chain further commands that use
@@ -238,11 +238,11 @@ cy.get('button')
238238

239239
## Rules
240240

241-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
241+
<HeaderRequirements />
242242

243243
- `.and()` requires being chained off a previous command.
244244

245-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
245+
<HeaderTimeouts />
246246

247247
- `.and()` will continue to [retry](/app/core-concepts/retry-ability) its
248248
specified assertions until it times out.

docs/api/commands/as.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.as()`.
5555
| ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5656
| `type` | `query` | The type of alias to store, which impacts how the value is retrieved later in the test. Valid values are `query` and `static`. A `query` alias re-runs all queries leading up to the resulting value each time the alias is requested. A `static` alias is retrieved once when the alias is stored, and will never change. `type` has no effect when aliasing intercepts, spies, and stubs. |
5757

58-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
58+
<HeaderYields />
5959

6060
- `.as()` yields the same subject it was given.
6161
- It is _safe_ to chain further commands after `.as()`.
@@ -183,17 +183,17 @@ describe('A fixture', () => {
183183

184184
## Rules
185185

186-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
186+
<HeaderRequirements />
187187

188188
- `.as()` requires being chained off a previous command.
189189

190-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
190+
<HeaderAssertions />
191191

192192
- `.as()` is a utility command.
193193
- `.as()` will not run assertions. Assertions will pass through as if this
194194
command did not exist.
195195

196-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
196+
<HeaderTimeouts />
197197

198198
- `.as()` cannot time out.
199199

docs/api/commands/blur.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.blur`.
5555
| `force` | `false` | Forces the action, disables checking if [element is focused](#Requirements) |
5656
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.blur()` to resolve before [timing out](#Timeouts) |
5757

58-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
58+
<HeaderYields />
5959

6060
- `.blur()` yields the same subject it was given.
6161
- It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried)
@@ -115,17 +115,17 @@ events. Your best bet here is to keep Cypress focused when working on a test.
115115

116116
## Rules
117117

118-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
118+
<HeaderRequirements />
119119

120120
- `.blur()` requires being chained off a command that yields DOMelement(s).
121121
- `.blur()` requires the element to currently have focus.
122122
- `.blur()` requires the element to be able to receive focus.
123123

124-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
124+
<HeaderAssertions />
125125

126126
- `.blur()` will automatically wait for assertions you have chained to pass.
127127

128-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
128+
<HeaderTimeouts />
129129

130130
- `.blur()` can time out waiting for assertions you've added to pass.
131131

docs/api/commands/check.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Pass in an options object to change the default behavior of `.check()`.
6464
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.check()` to resolve before [timing out](#Timeouts) |
6565
| `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. |
6666

67-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
67+
<HeaderYields />
6868

6969
- `.check()` yields the same subject it was given.
7070
- It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried)
@@ -168,19 +168,19 @@ cy.get('#pick-fruit :checked').should('be.checked').and('have.value', 'apple')
168168

169169
## Rules
170170

171-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
171+
<HeaderRequirements />
172172

173173
- `.check()` requires being chained off a command that yields DOM element(s).
174174
- `.check()` requires the element to have type `checkbox` or `radio`.
175175

176-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
176+
<HeaderAssertions />
177177

178178
- `.check()` will automatically wait for the element to reach an
179179
[actionable state](/app/core-concepts/interacting-with-elements).
180180
- `.check()` will automatically [retry](/app/core-concepts/retry-ability)
181181
until all chained assertions have passed.
182182

183-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
183+
<HeaderTimeouts />
184184

185185
- `.check()` can time out waiting for the element to reach an
186186
[actionable state](/app/core-concepts/interacting-with-elements).

docs/api/commands/children.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Pass in an options object to change the default behavior of `.children()`.
5151
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
5252
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.children()` to resolve before [timing out](#Timeouts) |
5353

54-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
54+
<HeaderYields />
5555

5656
- `.children()` yields the new DOM element(s) it found.
5757
- `.children()` is a query, and it is _safe_ to chain further commands.
@@ -115,19 +115,19 @@ cy.get('ul').children('.active')
115115

116116
## Rules
117117

118-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
118+
<HeaderRequirements />
119119

120120
- `.children()` requires being chained off a command that yields DOM element(s).
121121

122-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
122+
<HeaderAssertions />
123123

124124
- `.children()` will automatically [retry](/app/core-concepts/retry-ability)
125125
until the element(s)
126126
[exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions).
127127
- `.children()` will automatically [retry](/app/core-concepts/retry-ability)
128128
until all chained assertions have passed.
129129

130-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
130+
<HeaderTimeouts />
131131

132132
- `.children()` can time out waiting for the element(s) to
133133
[exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions).

docs/api/commands/clear.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Pass in an options object to change the default behavior of `.clear()`.
5454
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.clear()` to resolve before [timing out](#Timeouts) |
5555
| `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. |
5656

57-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
57+
<HeaderYields />
5858

5959
- `.clear()` yields the same subject it was given.
6060
- It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried)
@@ -88,19 +88,19 @@ Please read the [`.type()`](/api/commands/type) documentation for more details.
8888

8989
## Rules
9090

91-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
91+
<HeaderRequirements />
9292

9393
- `.clear()` requires being chained off a command that yields DOM element(s).
9494
- `.clear()` requires the element to be an `input` or `textarea`.
9595

96-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
96+
<HeaderAssertions />
9797

9898
- `.clear()` will automatically wait for the element to reach an
9999
[actionable state](/app/core-concepts/interacting-with-elements)
100100
- `.clear()` will automatically [retry](/app/core-concepts/retry-ability)
101101
until all chained assertions have passed
102102

103-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
103+
<HeaderTimeouts />
104104

105105
- `.clear()` can time out waiting for the element to reach an
106106
[actionable state](/app/core-concepts/interacting-with-elements).

docs/api/commands/clearallcookies.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ Pass in an options object to change the default behavior of
4141
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
4242
| `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.clearAllCookies()` to resolve before [timing out](#Timeouts) |
4343

44-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
44+
<HeaderYields />
4545

4646
- `cy.clearAllCookies()` yields `null`.
4747

4848
## Rules
4949

50-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
50+
<HeaderRequirements />
5151

5252
- `cy.clearAllCookies()` requires being chained off of `cy`.
5353

54-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
54+
<HeaderAssertions />
5555

5656
- `cy.clearAllCookies()` cannot have any assertions chained.
5757

58-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
58+
<HeaderTimeouts />
5959

6060
- `cy.clearAllCookies()` should never time out.
6161

docs/api/commands/clearalllocalstorage.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ Pass in an options object to change the default behavior of
4242
| ------ | ------- | ----------------------------------------------------------------------------------- |
4343
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
4444

45-
### Yields [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}
45+
<HeaderYields />
4646

4747
- `cy.clearAllLocalStorage()` yields `null`.
4848

4949
## Rules
5050

51-
### Requirements [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
51+
<HeaderRequirements />
5252

5353
- `cy.clearAllLocalStorage()` requires being chained off of `cy`.
5454

55-
### Assertions [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions}
55+
<HeaderAssertions />
5656

5757
- `cy.clearAllLocalStorage()` cannot have any assertions chained.
5858

59-
### Timeouts [<Icon name="question-circle"/>](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts}
59+
<HeaderTimeouts />
6060

6161
- `cy.clearAllLocalStorage()` cannot time out.
6262

0 commit comments

Comments
 (0)