Skip to content

Commit 9c6bb10

Browse files
authored
chore: documents assertNoAccessibilityIssues
1 parent 5d817b7 commit 9c6bb10

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

browser-testing.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ You can visit multiple pages simultaneously by passing an array of URLs to the `
137137
$pages = visit(['/', '/about']);
138138

139139
$pages->assertNoSmoke()
140+
->assertNoAccessibilityIssues()
140141
->assertNoConsoleLogs()
141142
->assertNoJavaScriptErrors();
142143

@@ -248,6 +249,7 @@ pest()->browser()->timeout(10);
248249
[assertNoSmoke](#assert-no-smoke)
249250
[assertNoConsoleLogs](#assert-no-console-logs)
250251
[assertNoJavaScriptErrors](#assert-no-javascript-errors)
252+
[assertNoAccessibilityIssues](#assert-no-accessibility-issues)
251253
[assertScreenshotMatches](#assert-screenshot-matches)
252254

253255
</div>
@@ -815,6 +817,29 @@ The `assertNoJavaScriptErrors` method asserts there are no JavaScript errors on
815817
$page->assertNoJavaScriptErrors();
816818
```
817819

820+
<a name="assert-no-accessibility-issues"></a>
821+
### assertNoAccessibilityIssues
822+
823+
The `assertNoAccessibilityIssues` method asserts there are no "serious" accessibility issues on the page:
824+
825+
```php
826+
$page->assertNoAccessibilityIssues();
827+
```
828+
829+
By default, the level is 1 (serious). You can change to one of the following levels:
830+
831+
```
832+
0. Critical
833+
1. Serious
834+
2. Moderate
835+
3. Minor
836+
```
837+
838+
- The level 0 (critical) only reports issues that cause severe barriers for individuals with disabilities. The organization may be subject to legal action if these issues are not addressed.
839+
- The level 1 (serious) includes all critical issues (level 0) and adds issues that significantly impact accessibility. The organization may be subject to legal action if these issues are not addressed.
840+
- The level 2 (moderate) includes all serious issues (level 1) and adds issues that moderately affect accessibility. The end-user would appreciate the fix, but it is not a barrier.
841+
- The level 3 (minor) includes all moderate issues (level 2) and adds issues that have a minor impact on accessibility. These issues are often related to best practices and do not significantly affect the user experience.
842+
818843
## Screenshot Assertions
819844

820845
<a name="assert-screenshot-matches"></a>

0 commit comments

Comments
 (0)