Pagination test scenarios
These test scenarios are designed to be human readable by using Gherkin syntax. Almost all of them are automated behind the scenes using JavaScript and Playwright, which you can see in the GitHub repo.
Sections: the scenarios are grouped by the same themes as the accessibility requirements in the component documentation, so each section here matches a section there.
Tags: marked by an @ symbol, tags are a
way to group related tests. For example, by component name, whether
it's an automated or manual test, and the WCAG level and success
criterion number.
Steps: every scenario is written with the same shared set of Given, When and Then steps. See the full list of test steps for what each one does.
View accessibility requirements
Adaptability
View accessibility requirements: Adaptability
@pagination @adaptability Feature: Pagination — Adaptability Helping people by honouring user preferences and by allowing adaptations to content presentation and time limits User story: As a person who needs to adjust the way content is presented, or to adjust timings, I want components that my tools can interpret and adjust, so that I can navigate, understand, and operate the interface reliably using the technology that supports me. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Perceivable # ---------------------------------------------------------------------------- @1.3.4 @aa @automatic Rule: 1.3.4 Orientation, Level AA Scenario: Content is not restricted to a single orientation, unless it's essential When I switch to landscape mode And I view the rendered ".tl-pagination" Then it should not lose any content or functionality @1.4.4 @aa @automatic Rule: 1.4.4 Resize Text, Level AA Scenario: Text can scale up to 200% without loss of content or functionality When I zoom in the browser to 200% And I view the rendered ".tl-pagination" Then it should not lose any content or functionality @1.4.10 @aa @automatic Rule: 1.4.10 Reflow, Level AA Scenario: Content reflows without horizontal scrolling at 320px wide When I view the rendered ".tl-pagination" And I set the viewport to 320px wide Then it should reflow without requiring horizontal scrolling @1.4.12 @aa @automatic Rule: 1.4.12 Text Spacing, Level AA Scenario: Line, letter and word spacing can be increased without a loss of content When I view the rendered ".tl-pagination" And I increase the line height to 1.5 times the font size And I increase the spacing following paragraphs to 2 times the font size And I increase the letter spacing to 0.12 times the font size And I increase the word spacing to 0.16 times the font size Then it should not lose any content or functionality @1.4.8 @aaa @automatic Rule: 1.4.8 Visual Presentation, Level AAA Scenario: People can see their preferences for text colour, width, alignment, spacing, and size reflected in the visual presentation When I view the rendered ".tl-pagination" And I apply a custom foreground and background colour using a user stylesheet And I apply a custom max-width using a user stylesheet And I apply a custom text-alignment using a user stylesheet And I apply a custom line height using a user stylesheet And I apply a custom font size of 200% using a user stylesheet Then it should not lose any content or functionalityFeature: Pagination — Adaptability
Helping people by honouring user preferences and by allowing adaptations to content presentation and time limits
User story:
As a person who needs to adjust the way content is presented, or to adjust timings, I want components that my tools can interpret and adjust, so that I can navigate, understand, and operate the interface reliably using the technology that supports me.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
1.3.4 Orientation
Rule: 1.3.4 Orientation, Level AA
Scenario: Content is not restricted to a single orientation, unless it's essential
When I switch to landscape mode
And I view the rendered ".tl-pagination"
Then it should not lose any content or functionality
1.4.4 Resize Text
Rule: 1.4.4 Resize Text, Level AA
Scenario: Text can scale up to 200% without loss of content or functionality
When I zoom in the browser to 200%
And I view the rendered ".tl-pagination"
Then it should not lose any content or functionality
1.4.10 Reflow
Rule: 1.4.10 Reflow, Level AA
Scenario: Content reflows without horizontal scrolling at 320px wide
When I view the rendered ".tl-pagination"
And I set the viewport to 320px wide
Then it should reflow without requiring horizontal scrolling
1.4.12 Text Spacing
Rule: 1.4.12 Text Spacing, Level AA
Scenario: Line, letter and word spacing can be increased without a loss of content
When I view the rendered ".tl-pagination"
And I increase the line height to 1.5 times the font size
And I increase the spacing following paragraphs to 2 times the font size
And I increase the letter spacing to 0.12 times the font size
And I increase the word spacing to 0.16 times the font size
Then it should not lose any content or functionality
1.4.8 Visual Presentation
Rule: 1.4.8 Visual Presentation, Level AAA
Scenario: People can see their preferences for text colour, width, alignment, spacing, and size reflected in the visual presentation
When I view the rendered ".tl-pagination"
And I apply a custom foreground and background colour using a user stylesheet
And I apply a custom max-width using a user stylesheet
And I apply a custom text-alignment using a user stylesheet
And I apply a custom line height using a user stylesheet
And I apply a custom font size of 200% using a user stylesheet
Then it should not lose any content or functionality
Animation and movement
View accessibility requirements: Animation and movement
@pagination @animation-and-movement Feature: Pagination — Animation and movement Helping people to limit animation or reduce motion within content No component-specific requirementsFeature: Pagination — Animation and movement
Helping people to limit animation or reduce motion within content
No component-specific requirements
Assistive technologies and semantics
View accessibility requirements: Assistive technologies and semantics
@pagination @assistive-technologies-and-semantics Feature: Pagination — Assistive technologies and semantics Helping people who use a screen reader or other assistive tech by using appropriate code User story: As a person who uses assistive technology I want components that use semantic markup, roles, and states that my tools can interpret so that I can navigate, understand, and operate the interface reliably. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Perceivable # ---------------------------------------------------------------------------- @1.3.1 @a @automatic Rule: 1.3.1 Info and Relationships, Level A Scenario: A navigation landmark is used to identify the pagination component When I inspect ".tl-pagination" in the DOM Then it should use the tag "nav" @1.3.1 @a @automatic Rule: 1.3.1 Info and Relationships, Level A Scenario: The link that visually indicates the current page communicates the state programmatically or as text When I inspect ".tl-pagination li:nth-child(5) a" in the DOM Then it should have the attribute "aria-current" with the value "page" @1.3.2 @a @automatic Rule: 1.3.2 Meaningful Sequence, Level A Scenario Outline: A correct reading sequence can be programmatically determined When I inspect "<element>" in the DOM Then it is positioned after the "<previous_element>" element in the DOM Examples: | element | previous_element | | .tl-pagination > ol | .tl-pagination > a:first-child | | .tl-pagination > ol + a | .tl-pagination > ol | | .tl-pagination li:nth-child(1) a | .tl-pagination > ol | | .tl-pagination li:nth-child(2) .visually-hidden | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | .tl-pagination li:nth-child(2) .visually-hidden | | .tl-pagination li:nth-child(4) a | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(5) a | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(6) a | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(7) a | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(8) a | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(9) .visually-hidden | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | .tl-pagination li:nth-child(9) .visually-hidden | # ---------------------------------------------------------------------------- # Operable # ---------------------------------------------------------------------------- @2.5.3 @a @automatic Rule: 2.5.3 Label in Name, Level A Scenario Outline: Each link has an accessible name that matches or includes the visible label When I inspect "<element>" in the Accessibility Tree Then it should have an accessible name which contains the visible label "<visible_label>" Examples: | element | visible_label | | .tl-pagination > a:first-child | Previous | | .tl-pagination > ol + a | Next | | .tl-pagination li:nth-child(1) a | 1 | | .tl-pagination li:nth-child(3) a | 4 | | .tl-pagination li:nth-child(4) a | 5 | | .tl-pagination li:nth-child(5) a | 6 | | .tl-pagination li:nth-child(6) a | 7 | | .tl-pagination li:nth-child(7) a | 8 | | .tl-pagination li:nth-child(8) a | 9 | | .tl-pagination li:nth-child(10) a | 13 | # ---------------------------------------------------------------------------- # Robust # ---------------------------------------------------------------------------- @4.1.2 @a @automatic Rule: 4.1.2 Name, Role, Value, Level A Scenario Outline: Each link has an accessible name When I inspect "<element>" in the Accessibility Tree Then it should have an accessible name Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @4.1.2 @a @automatic Rule: 4.1.2 Name, Role, Value, Level A Scenario Outline: Each link has a role of link When I inspect "<element>" in the Accessibility Tree Then it should have an accessible role of "link" Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @4.1.2 @a @automatic Rule: 4.1.2 Name, Role, Value, Level A Scenario: The link which indicates the current page has a value of aria-current="page" When I inspect ".tl-pagination li:nth-child(5) a" in the DOM Then it should have the attribute "aria-current" with the value "page" @recommendation @automatic Rule: Recommendation Scenario: Markup can be parsed without errors When I inspect ".tl-pagination" in the DOM Then it should use valid HTML with no parsing errors @recommendation @automatic Rule: Recommendation Scenario: The navigation landmark has a descriptive accessible name, such as "Pagination" When I inspect ".tl-pagination" in the Accessibility Tree Then its accessible name should be "Pagination" @recommendation @automatic Rule: Recommendation Scenario Outline: Each link is implemented as an <a> element with a href attribute When I inspect "<element>" in the DOM Then it should use the tag "a" And it should have the attribute "href" Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @recommendation @automatic Rule: Recommendation Scenario: An <ol> is used with role="list" to ensure it is exposed as lists in Safari/VoiceOver When I inspect ".tl-pagination > ol" in the DOM Then it should have the attribute "role" with the value "list"Feature: Pagination — Assistive technologies and semantics
Helping people who use a screen reader or other assistive tech by using appropriate code
User story:
As a person who uses assistive technology I want components that use semantic markup, roles, and states that my tools can interpret so that I can navigate, understand, and operate the interface reliably.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
1.3.1 Info and Relationships
Rule: 1.3.1 Info and Relationships, Level A
Scenario: A navigation landmark is used to identify the pagination component
When I inspect ".tl-pagination" in the DOM
Then it should use the tag "nav"
Rule: 1.3.1 Info and Relationships, Level A
Scenario: The link that visually indicates the current page communicates the state programmatically or as text
When I inspect ".tl-pagination li:nth-child(5) a" in the DOM
Then it should have the attribute "aria-current" with the value "page"
1.3.2 Meaningful Sequence
Rule: 1.3.2 Meaningful Sequence, Level A
Scenario Outline: A correct reading sequence can be programmatically determined
When I inspect "<element>" in the DOM
Then it is positioned after the "<previous_element>" element in the DOM
Examples:
| element | previous_element |
|---|---|
| .tl-pagination > ol | .tl-pagination > a:first-child |
| .tl-pagination > ol + a | .tl-pagination > ol |
| .tl-pagination li:nth-child(1) a | .tl-pagination > ol |
| .tl-pagination li:nth-child(2) .visually-hidden | .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a | .tl-pagination li:nth-child(2) .visually-hidden |
| .tl-pagination li:nth-child(4) a | .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(5) a | .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(6) a | .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(7) a | .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(8) a | .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(9) .visually-hidden | .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a | .tl-pagination li:nth-child(9) .visually-hidden |
2.5.3 Label in Name
Rule: 2.5.3 Label in Name, Level A
Scenario Outline: Each link has an accessible name that matches or includes the visible label
When I inspect "<element>" in the Accessibility Tree
Then it should have an accessible name which contains the visible label "<visible_label>"
Examples:
| element | visible_label |
|---|---|
| .tl-pagination > a:first-child | Previous |
| .tl-pagination > ol + a | Next |
| .tl-pagination li:nth-child(1) a | 1 |
| .tl-pagination li:nth-child(3) a | 4 |
| .tl-pagination li:nth-child(4) a | 5 |
| .tl-pagination li:nth-child(5) a | 6 |
| .tl-pagination li:nth-child(6) a | 7 |
| .tl-pagination li:nth-child(7) a | 8 |
| .tl-pagination li:nth-child(8) a | 9 |
| .tl-pagination li:nth-child(10) a | 13 |
4.1.2 Name, Role, Value
Rule: 4.1.2 Name, Role, Value, Level A
Scenario Outline: Each link has an accessible name
When I inspect "<element>" in the Accessibility Tree
Then it should have an accessible name
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 4.1.2 Name, Role, Value, Level A
Scenario Outline: Each link has a role of link
When I inspect "<element>" in the Accessibility Tree
Then it should have an accessible role of "link"
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 4.1.2 Name, Role, Value, Level A
Scenario: The link which indicates the current page has a value of aria-current="page"
When I inspect ".tl-pagination li:nth-child(5) a" in the DOM
Then it should have the attribute "aria-current" with the value "page"
Recommendations
Rule: Recommendation
Scenario: Markup can be parsed without errors
When I inspect ".tl-pagination" in the DOM
Then it should use valid HTML with no parsing errors
Rule: Recommendation
Scenario: The navigation landmark has a descriptive accessible name, such as "Pagination"
When I inspect ".tl-pagination" in the Accessibility Tree
Then its accessible name should be "Pagination"
Rule: Recommendation
Scenario Outline: Each link is implemented as an <a> element with a href attribute
When I inspect "<element>" in the DOM
Then it should use the tag "a"
And it should have the attribute "href"
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: Recommendation
Scenario: An <ol> is used with role="list" to ensure it is exposed as lists in Safari/VoiceOver
When I inspect ".tl-pagination > ol" in the DOM
Then it should have the attribute "role" with the value "list"
Colour and contrast
View accessibility requirements: Colour and contrast
@pagination @colour-and-contrast Feature: Pagination — Colour and contrast Helping people who struggle with colour perception or low vision User story: As a person with low vision or colour vision deficiency I want components with sufficient contrast and that don't rely solely on colour so that I can perceive and understand all content and interface elements. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Perceivable # ---------------------------------------------------------------------------- @1.4.1 @a @automatic Rule: 1.4.1 Use of Color, Level A Scenario: The current page is distinguishable from the other pages without relying on colour alone When I view the rendered ".tl-pagination a[aria-current='page']" Then it should be distinguishable from ".tl-pagination li:nth-child(4) a" without relying on colour alone Scenario Outline: Colour is not the only visual means of conveying information When I view the rendered "<element>" Then it should have the CSS property "text-decoration-line" with the value "underline" Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @1.4.3 @aa @automatic Rule: 1.4.3 Contrast (Minimum), Level AA Scenario Outline: The text for each link has a contrast ratio of at least 4.5:1 against the background colour When I view the rendered "<element>" Then its text should have a contrast ratio of "4.5" against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @1.4.3 @aa @automatic @darkmode Rule: 1.4.3 Contrast (Minimum), Level AA Scenario Outline: Darkmode: The text for each link has a contrast ratio of at least 4.5:1 against the background colour When I view the rendered "<element>" And I enable "dark" mode Then its text should have a contrast ratio of "4.5" against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(10) a | @1.4.11 @aa @automatic Rule: 1.4.11 Non-text Contrast, Level AA Scenario Outline: Icons used such as arrows for "previous" and "next" have a contrast ratio of at least 3:1 against the background colour When I view the rendered "<element>" Then its text should have a contrast ratio of "3" against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | @1.4.11 @aa @automatic Rule: 1.4.11 Non-text Contrast, Level AA Scenario Outline: If the links have a custom focus style that uses colour alone, the focus style has a contrast ratio of at least 3:1 against the background colour When I focus "<element>" using a keyboard Then it should have a visible focus indicator And the focus indicator should have a contrast ratio of 3:1 against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @1.4.6 @aaa @automatic Rule: 1.4.6 Contrast (Enhanced), Level AAA Scenario Outline: The text for each link has a contrast ratio of at least 7:1 against the background colour When I view the rendered "<element>" Then its text should have a contrast ratio of "7" against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @1.4.6 @aaa @automatic @darkmode Rule: 1.4.6 Contrast (Enhanced), Level AAA Scenario Outline: Darkmode: The text for each link has a contrast ratio of at least 7:1 against the background colour When I view the rendered "<element>" And I enable "dark" mode Then its text should have a contrast ratio of "7" against its background Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(10) a | # ---------------------------------------------------------------------------- # Recommendations # ---------------------------------------------------------------------------- @recommendation @automatic Rule: Recommendation Scenario: The visual design remains usable in Windows High Contrast/Forced Colors mode When I enable "forced colors" mode And I view the rendered ".tl-pagination" Then it should not lose any content or functionalityFeature: Pagination — Colour and contrast
Helping people who struggle with colour perception or low vision
User story:
As a person with low vision or colour vision deficiency I want components with sufficient contrast and that don't rely solely on colour so that I can perceive and understand all content and interface elements.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
1.4.1 Use of Color
Rule: 1.4.1 Use of Color, Level A
Scenario: The current page is distinguishable from the other pages without relying on colour alone
When I view the rendered ".tl-pagination a[aria-current='page']"
Then it should be distinguishable from ".tl-pagination li:nth-child(4) a" without relying on colour alone
Scenario Outline: Colour is not the only visual means of conveying information
When I view the rendered "<element>"
Then it should have the CSS property "text-decoration-line" with the value "underline"
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
1.4.3 Contrast (Minimum)
Rule: 1.4.3 Contrast (Minimum), Level AA
Scenario Outline: The text for each link has a contrast ratio of at least 4.5:1 against the background colour
When I view the rendered "<element>"
Then its text should have a contrast ratio of "4.5" against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 1.4.3 Contrast (Minimum), Level AA
Scenario Outline: Darkmode: The text for each link has a contrast ratio of at least 4.5:1 against the background colour
When I view the rendered "<element>"
And I enable "dark" mode
Then its text should have a contrast ratio of "4.5" against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(10) a |
1.4.11 Non-text Contrast
Rule: 1.4.11 Non-text Contrast, Level AA
Scenario Outline: Icons used such as arrows for "previous" and "next" have a contrast ratio of at least 3:1 against the background colour
When I view the rendered "<element>"
Then its text should have a contrast ratio of "3" against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
Rule: 1.4.11 Non-text Contrast, Level AA
Scenario Outline: If the links have a custom focus style that uses colour alone, the focus style has a contrast ratio of at least 3:1 against the background colour
When I focus "<element>" using a keyboard
Then it should have a visible focus indicator
And the focus indicator should have a contrast ratio of 3:1 against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
1.4.6 Contrast (Enhanced)
Rule: 1.4.6 Contrast (Enhanced), Level AAA
Scenario Outline: The text for each link has a contrast ratio of at least 7:1 against the background colour
When I view the rendered "<element>"
Then its text should have a contrast ratio of "7" against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 1.4.6 Contrast (Enhanced), Level AAA
Scenario Outline: Darkmode: The text for each link has a contrast ratio of at least 7:1 against the background colour
When I view the rendered "<element>"
And I enable "dark" mode
Then its text should have a contrast ratio of "7" against its background
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(10) a |
Recommendations
Rule: Recommendation
Scenario: The visual design remains usable in Windows High Contrast/Forced Colors mode
When I enable "forced colors" mode
And I view the rendered ".tl-pagination"
Then it should not lose any content or functionality
Consistency and predictability
View accessibility requirements: Consistency and predictability
@pagination @consistency-and-predictability Feature: Pagination — Consistency and predictability Helping people by keeping functionality and content consistent and predictable User story: As a person who benefits from consistent and predictable interfaces I want components that behave in expected ways and don't cause unexpected changes so that I can navigate and interact with confidence. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Understandable # ---------------------------------------------------------------------------- @3.2.1 @a @automatic Rule: 3.2.1 On Focus, Level A Scenario Outline: Each link does not result in a change of context when focused When I focus "<element>" using a keyboard Then it should NOT navigate to a new page Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @3.2.3 @aa @automatic Rule: 3.2.3 Consistent Navigation, Level AA Scenario Outline: Each link has the same accessible name on different pages Given I load the sample "<sample>" When I inspect "<element>" in the Accessibility Tree Then its accessible name should be "<name>" Examples: | element | name | sample | | .tl-pagination > a:first-child | Previous page | http://localhost:8081/pagination/examples/default | | .tl-pagination > a:first-child | Previous page | http://localhost:8081/pagination/examples/default?page=7 | | .tl-pagination > ol + a | Next page | http://localhost:8081/pagination/examples/default | | .tl-pagination > ol + a | Next page | http://localhost:8081/pagination/examples/default?page=7 | | .tl-pagination li:first-child a | 1 | http://localhost:8081/pagination/examples/default | | .tl-pagination li:first-child a | 1 | http://localhost:8081/pagination/examples/default?page=7 | | .tl-pagination li:last-child a | 13 | http://localhost:8081/pagination/examples/default | | .tl-pagination li:last-child a | 13 | http://localhost:8081/pagination/examples/default?page=7 | @recommendation @automatic Rule: Recommendation Scenario Outline: Each link has a visual style that makes it look like a link, such as an underline or background colour When I view the rendered "<element>" Then it should have the CSS property "text-decoration-line" with the value "underline" Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @recommendation @automatic Rule: Recommendation Scenario: There is a visual cue for the current link When I inspect ".tl-pagination li:nth-child(5) a" in the DOM Then it should have the CSS property "background-color" with the value "rgb(66, 0, 101)" And it should have the CSS property "color" with the value "rgb(255, 255, 255)" And it should have the CSS property "font-weight" with the value "700"Feature: Pagination — Consistency and predictability
Helping people by keeping functionality and content consistent and predictable
User story:
As a person who benefits from consistent and predictable interfaces I want components that behave in expected ways and don't cause unexpected changes so that I can navigate and interact with confidence.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
3.2.1 On Focus
Rule: 3.2.1 On Focus, Level A
Scenario Outline: Each link does not result in a change of context when focused
When I focus "<element>" using a keyboard
Then it should NOT navigate to a new page
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
3.2.3 Consistent Navigation
Rule: 3.2.3 Consistent Navigation, Level AA
Scenario Outline: Each link has the same accessible name on different pages
Given I load the sample "<sample>"
When I inspect "<element>" in the Accessibility Tree
Then its accessible name should be "<name>"
Examples:
| element | name | sample |
|---|---|---|
| .tl-pagination > a:first-child | Previous page | http://localhost:8081/pagination/examples/default |
| .tl-pagination > a:first-child | Previous page | http://localhost:8081/pagination/examples/default?page=7 |
| .tl-pagination > ol + a | Next page | http://localhost:8081/pagination/examples/default |
| .tl-pagination > ol + a | Next page | http://localhost:8081/pagination/examples/default?page=7 |
| .tl-pagination li:first-child a | 1 | http://localhost:8081/pagination/examples/default |
| .tl-pagination li:first-child a | 1 | http://localhost:8081/pagination/examples/default?page=7 |
| .tl-pagination li:last-child a | 13 | http://localhost:8081/pagination/examples/default |
| .tl-pagination li:last-child a | 13 | http://localhost:8081/pagination/examples/default?page=7 |
Recommendations
Rule: Recommendation
Scenario Outline: Each link has a visual style that makes it look like a link, such as an underline or background colour
When I view the rendered "<element>"
Then it should have the CSS property "text-decoration-line" with the value "underline"
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: Recommendation
Scenario: There is a visual cue for the current link
When I inspect ".tl-pagination li:nth-child(5) a" in the DOM
Then it should have the CSS property "background-color" with the value "rgb(66, 0, 101)"
And it should have the CSS property "color" with the value "rgb(255, 255, 255)"
And it should have the CSS property "font-weight" with the value "700"
Images and media
View accessibility requirements: Images and media
@pagination @images-and-media Feature: Pagination — Images and media Helping people to access (and remove distractions caused by) image, video and audio content User story: As a person who cannot see or hear media content I want appropriate text alternatives and captions for images, video and audio so that I can access the same information as everyone else. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Perceivable # ---------------------------------------------------------------------------- @1.1.1 @a @automatic Rule: 1.1.1 Non-text Content, Level A Scenario Outline: Arrows in "Next" and "Previous" links are hidden from screen readers When I inspect "<element>" in the Accessibility Tree Then its accessible name should be "<name>" Examples: | element | name | | .tl-pagination > a:first-child | Previous page | | .tl-pagination > ol + a | Next page | @1.1.1 @a @automatic Rule: 1.1.1 Non-text Content, Level A Scenario Outline: Each ellipsis character is hidden from screen readers, and visually hidden text alongside it reads "Ellipsis" Given I load the sample "<sample>" When I inspect "<item> span[aria-hidden]" in the DOM Then it should have the attribute "aria-hidden" with the value "true" When I inspect "<item> .visually-hidden" in the DOM Then it should contain the text "Ellipsis" Examples: | sample | item | | http://localhost:8081/pagination/examples/default | .tl-pagination li:nth-child(2) | | http://localhost:8081/pagination/examples/default | .tl-pagination li:nth-child(9) | | http://localhost:8081/pagination/examples/default?page=1 | .tl-pagination li:nth-child(9) | | http://localhost:8081/pagination/examples/default?page=13 | .tl-pagination li:nth-child(2) | @1.4.5 @aa @automatic Rule: 1.4.5 Images of Text, Level AA Scenario Outline: Real text is used instead of images for links where possible When I inspect "<element>" in the Accessibility Tree Then it should contain static text, not an image Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @1.4.9 @aaa @automatic Rule: 1.4.9 Images of Text (No Exception), Level AAA Scenario Outline: No images of text at all When I inspect "<element>" in the Accessibility Tree Then it should contain static text, not an image Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a |Feature: Pagination — Images and media
Helping people to access (and remove distractions caused by) image, video and audio content
User story:
As a person who cannot see or hear media content I want appropriate text alternatives and captions for images, video and audio so that I can access the same information as everyone else.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
1.1.1 Non-text Content
Rule: 1.1.1 Non-text Content, Level A
Scenario Outline: Arrows in "Next" and "Previous" links are hidden from screen readers
When I inspect "<element>" in the Accessibility Tree
Then its accessible name should be "<name>"
Examples:
| element | name |
|---|---|
| .tl-pagination > a:first-child | Previous page |
| .tl-pagination > ol + a | Next page |
Rule: 1.1.1 Non-text Content, Level A
Scenario Outline: Each ellipsis character is hidden from screen readers, and visually hidden text alongside it reads "Ellipsis"
Given I load the sample "<sample>"
When I inspect "<item> span[aria-hidden]" in the DOM
Then it should have the attribute "aria-hidden" with the value "true"
When I inspect "<item> .visually-hidden" in the DOM
Then it should contain the text "Ellipsis"
Examples:
| sample | item |
|---|---|
| http://localhost:8081/pagination/examples/default | .tl-pagination li:nth-child(2) |
| http://localhost:8081/pagination/examples/default | .tl-pagination li:nth-child(9) |
| http://localhost:8081/pagination/examples/default?page=1 | .tl-pagination li:nth-child(9) |
| http://localhost:8081/pagination/examples/default?page=13 | .tl-pagination li:nth-child(2) |
1.4.5 Images of Text
Rule: 1.4.5 Images of Text, Level AA
Scenario Outline: Real text is used instead of images for links where possible
When I inspect "<element>" in the Accessibility Tree
Then it should contain static text, not an image
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
1.4.9 Images of Text (No Exception)
Rule: 1.4.9 Images of Text (No Exception), Level AAA
Scenario Outline: No images of text at all
When I inspect "<element>" in the Accessibility Tree
Then it should contain static text, not an image
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Input assistance
View accessibility requirements: Input assistance
@pagination @input-assistance Feature: Pagination — Input assistance Helping people to complete forms, enter data and pass authentication No component-specific requirementsFeature: Pagination — Input assistance
Helping people to complete forms, enter data and pass authentication
No component-specific requirements
Keyboard
View accessibility requirements: Keyboard
@pagination @keyboard Feature: Pagination — Keyboard Helping people who use a keyboard User story: As a keyboard user I want components that follow a logical tab order and provide visible, predictable focus states so that I can move through the interface efficiently and operate every feature without using a mouse. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Operable # ---------------------------------------------------------------------------- @2.1.1 @a @automatic Rule: 2.1.1 Keyboard, Level A Scenario Outline: Each link is focusable using the "Tab" key When I focus "<element>" using a keyboard Then "<element>" should be focused Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.1.1 @a @automatic Rule: 2.1.1 Keyboard, Level A Scenario Outline: Each link can be activated by pressing the "Enter" key When I focus "<element>" And I press the "Enter" key once Then the URL should change Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.1.2 @a @automatic Rule: 2.1.2 No Keyboard Trap, Level A Scenario Outline: Each link does not trap focus going forwards When I focus "<element>" And I press the "TAB" key once Then the focus should not be on a "<element>" element Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.1.2 @a @automatic Rule: 2.1.2 No Keyboard Trap, Level A Scenario Outline: Each link does not trap focus going backwards When I focus "<element>" And I hold the "SHIFT" key And I press the "TAB" key once Then the focus should not be on a "<element>" element Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.4.3 @a @automatic Rule: 2.4.3 Focus Order, Level A Scenario Outline: Each link receives focus in logical order When I focus "<element>" And I press the "TAB" key once Then "<next_element>" should be focused Examples: | element | next_element | | .tl-pagination > a:first-child | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(1) a | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(3) a | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(4) a | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(5) a | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(6) a | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(7) a | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(8) a | .tl-pagination li:nth-child(10) a | | .tl-pagination li:nth-child(10) a | .tl-pagination > ol + a | @2.4.7 @aa @automatic Rule: 2.4.7 Focus Visible, Level AA Scenario Outline: Each link has a focus indicator when it receives keyboard focus When I focus "<element>" using a keyboard Then it should have a visible focus indicator Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.4.11 @aa @automatic Rule: 2.4.11 Focus Not Obscured (Minimum), Level AA Scenario Outline: Each link has a focus indicator which is not fully hidden by other content when it receives keyboard focus When I focus "<element>" using a keyboard Then it should have a visible focus indicator And its focus indicator should be at least partially visible Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.1.3 @aaa @automatic Rule: 2.1.3 Keyboard (No Exception), Level AAA Scenario Outline: Each link is focusable using the "Tab" key When I focus "<element>" using a keyboard Then "<element>" should be focused Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.1.3 @aaa @automatic Rule: 2.1.3 Keyboard (No Exception), Level AAA Scenario Outline: Each link can be activated by pressing the "Enter" key When I focus "<element>" And I press the "Enter" key once Then the URL should change Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.4.12 @aaa @automatic Rule: 2.4.12 Focus Not Obscured (Enhanced), Level AAA Scenario Outline: Each link has a focus indicator which is not even partially hidden by other content When I focus "<element>" using a keyboard Then it should have a visible focus indicator And its focus indicator should be fully visible Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.4.13 @aaa @automatic Rule: 2.4.13 Focus Appearance, Level AAA Scenario Outline: The focus indicator is at least 2px larger than the component boundary and has a contrast ratio of 3:1 or higher When I focus "<element>" using a keyboard Then it should have a visible focus indicator And the focus indicator should have a contrast ratio of 3:1 against its background And its focus indicator should have a minimum perimiter thickness of 2px Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a |Feature: Pagination — Keyboard
Helping people who use a keyboard
User story:
As a keyboard user I want components that follow a logical tab order and provide visible, predictable focus states so that I can move through the interface efficiently and operate every feature without using a mouse.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
2.1.1 Keyboard
Rule: 2.1.1 Keyboard, Level A
Scenario Outline: Each link is focusable using the "Tab" key
When I focus "<element>" using a keyboard
Then "<element>" should be focused
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 2.1.1 Keyboard, Level A
Scenario Outline: Each link can be activated by pressing the "Enter" key
When I focus "<element>"
And I press the "Enter" key once
Then the URL should change
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.1.2 No Keyboard Trap
Rule: 2.1.2 No Keyboard Trap, Level A
Scenario Outline: Each link does not trap focus going forwards
When I focus "<element>"
And I press the "TAB" key once
Then the focus should not be on a "<element>" element
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 2.1.2 No Keyboard Trap, Level A
Scenario Outline: Each link does not trap focus going backwards
When I focus "<element>"
And I hold the "SHIFT" key
And I press the "TAB" key once
Then the focus should not be on a "<element>" element
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.4.3 Focus Order
Rule: 2.4.3 Focus Order, Level A
Scenario Outline: Each link receives focus in logical order
When I focus "<element>"
And I press the "TAB" key once
Then "<next_element>" should be focused
Examples:
| element | next_element |
|---|---|
| .tl-pagination > a:first-child | .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(1) a | .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(3) a | .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(4) a | .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(5) a | .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(6) a | .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(7) a | .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(8) a | .tl-pagination li:nth-child(10) a |
| .tl-pagination li:nth-child(10) a | .tl-pagination > ol + a |
2.4.7 Focus Visible
Rule: 2.4.7 Focus Visible, Level AA
Scenario Outline: Each link has a focus indicator when it receives keyboard focus
When I focus "<element>" using a keyboard
Then it should have a visible focus indicator
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.4.11 Focus Not Obscured (Minimum)
Rule: 2.4.11 Focus Not Obscured (Minimum), Level AA
Scenario Outline: Each link has a focus indicator which is not fully hidden by other content when it receives keyboard focus
When I focus "<element>" using a keyboard
Then it should have a visible focus indicator
And its focus indicator should be at least partially visible
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.1.3 Keyboard (No Exception)
Rule: 2.1.3 Keyboard (No Exception), Level AAA
Scenario Outline: Each link is focusable using the "Tab" key
When I focus "<element>" using a keyboard
Then "<element>" should be focused
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Rule: 2.1.3 Keyboard (No Exception), Level AAA
Scenario Outline: Each link can be activated by pressing the "Enter" key
When I focus "<element>"
And I press the "Enter" key once
Then the URL should change
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.4.12 Focus Not Obscured (Enhanced)
Rule: 2.4.12 Focus Not Obscured (Enhanced), Level AAA
Scenario Outline: Each link has a focus indicator which is not even partially hidden by other content
When I focus "<element>" using a keyboard
Then it should have a visible focus indicator
And its focus indicator should be fully visible
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.4.13 Focus Appearance
Rule: 2.4.13 Focus Appearance, Level AAA
Scenario Outline: The focus indicator is at least 2px larger than the component boundary and has a contrast ratio of 3:1 or higher
When I focus "<element>" using a keyboard
Then it should have a visible focus indicator
And the focus indicator should have a contrast ratio of 3:1 against its background
And its focus indicator should have a minimum perimiter thickness of 2px
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
Pointer and touch
View accessibility requirements: Pointer and touch
@pagination @pointer-and-touch Feature: Pagination — Pointer and touch Helping people who use a mouse, touch screen, or other pointing device User story: As a person using touch or pointer input I want components with accessible gestures, adequate target sizes, and predictable interactions so that I can accurately interact with all functionality. Background: Given I load the sample "http://localhost:8081/pagination/examples/default" # ---------------------------------------------------------------------------- # Operable # ---------------------------------------------------------------------------- @2.5.2 @a @automatic Rule: 2.5.2 Pointer Cancellation, Level A Scenario Outline: Each link is activated on the "up" event, not on the "down" event When I press the mouse down on "<element>" Then it should NOT navigate to a new page Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.5.8 @aa @automatic Rule: 2.5.8 Target Size (Minimum), Level AA Scenario Outline: Each link has a target area size and spacing of at least 24 by 24 pixels When I view the rendered "<element>" Then it should have a width and height of at least 24px Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a | @2.5.5 @aaa @automatic Rule: 2.5.5 Target Size (Enhanced), Level AAA Scenario Outline: Each link has a target area size and spacing of at least 44 by 44 pixels When I view the rendered "<element>" Then it should have a width and height of at least 44px Examples: | element | | .tl-pagination > a:first-child | | .tl-pagination > ol + a | | .tl-pagination li:nth-child(1) a | | .tl-pagination li:nth-child(3) a | | .tl-pagination li:nth-child(4) a | | .tl-pagination li:nth-child(5) a | | .tl-pagination li:nth-child(6) a | | .tl-pagination li:nth-child(7) a | | .tl-pagination li:nth-child(8) a | | .tl-pagination li:nth-child(10) a |Feature: Pagination — Pointer and touch
Helping people who use a mouse, touch screen, or other pointing device
User story:
As a person using touch or pointer input I want components with accessible gestures, adequate target sizes, and predictable interactions so that I can accurately interact with all functionality.
Background:
Given I load the sample "https://tetralogical.com/resources/accessible-components-library/pagination/examples/default.html"
2.5.2 Pointer Cancellation
Rule: 2.5.2 Pointer Cancellation, Level A
Scenario Outline: Each link is activated on the "up" event, not on the "down" event
When I press the mouse down on "<element>"
Then it should NOT navigate to a new page
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.5.8 Target Size (Minimum)
Rule: 2.5.8 Target Size (Minimum), Level AA
Scenario Outline: Each link has a target area size and spacing of at least 24 by 24 pixels
When I view the rendered "<element>"
Then it should have a width and height of at least 24px
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |
2.5.5 Target Size (Enhanced)
Rule: 2.5.5 Target Size (Enhanced), Level AAA
Scenario Outline: Each link has a target area size and spacing of at least 44 by 44 pixels
When I view the rendered "<element>"
Then it should have a width and height of at least 44px
Examples:
| element |
|---|
| .tl-pagination > a:first-child |
| .tl-pagination > ol + a |
| .tl-pagination li:nth-child(1) a |
| .tl-pagination li:nth-child(3) a |
| .tl-pagination li:nth-child(4) a |
| .tl-pagination li:nth-child(5) a |
| .tl-pagination li:nth-child(6) a |
| .tl-pagination li:nth-child(7) a |
| .tl-pagination li:nth-child(8) a |
| .tl-pagination li:nth-child(10) a |