diff --git a/features/cli/display_failing_result.feature b/features/cli/display_failing_result.feature index 357e0d4..fb1c943 100644 --- a/features/cli/display_failing_result.feature +++ b/features/cli/display_failing_result.feature @@ -6,11 +6,11 @@ Feature: Display failing result Then it should fail with: """ ✗ http://localhost:54321/missing_main_heading.html - * Headings: Exactly one main heading + * Structure: Headings: Exactly one main heading - Found 0 h1 elements. For details on how to fix these errors, please see the following pages: - - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/headings.shtml + - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/structure/headings """ Scenario: One standard generates a warning @@ -19,13 +19,10 @@ Feature: Display failing result Then it should fail with: """ ✓ http://localhost:54321/subheading_first.html - ⚠ Headings: Headings must be in ascending order - - First heading was not a main heading: /html/body/h3 ⚠ Structure: Headings: Headings must be in ascending order - First heading was not a main heading: /html/body/h3 For details on how to fix these errors, please see the following pages: - - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/headings.shtml - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/structure/headings """ @@ -35,17 +32,14 @@ Feature: Display failing result Then it should fail with: """ ✗ http://localhost:54321/two_headings_failures_and_one_warning.html - * Headings: Content must follow headings - - No content follows: /html/body/h2 - * Headings: Exactly one main heading - - Found 0 h1 elements. - ⚠ Headings: Headings must be in ascending order - - First heading was not a main heading: /html/body/h2 ⚠ Structure: Headings: Headings must be in ascending order - First heading was not a main heading: /html/body/h2 + * Structure: Headings: Exactly one main heading + - Found 0 h1 elements. + * Structure: Headings: Content must follow headings + - No content follows: /html/body/h2 For details on how to fix these errors, please see the following pages: - - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/headings.shtml - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/structure/headings """ @@ -55,12 +49,12 @@ Feature: Display failing result Then it should fail with: """ ✗ http://localhost:54321/heading_and_title_attribute_failures.html - * Headings: Exactly one main heading + * Structure: Headings: Exactly one main heading - Found 0 h1 elements. - * Title attributes: Title attributes only on inputs + * Text equivalents: Tooltips and supplementary information: Title attributes only on inputs - Non-input element has title attribute: /html/body/p/span For details on how to fix these errors, please see the following pages: - - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/headings.shtml - - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/title-attributes.shtml + - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/structure/headings + - http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/text-equivalents/tooltips-and-supplementary-information """ diff --git a/features/cli/display_result_summary.feature b/features/cli/display_result_summary.feature index 98f8088..530a96d 100644 --- a/features/cli/display_result_summary.feature +++ b/features/cli/display_result_summary.feature @@ -6,7 +6,7 @@ Feature: Display result summary """ page("http://localhost:54321/perfect.html") page("http://localhost:54321/missing_main_heading.html", { - skip: "Headings: Exactly one main heading" + skip: "Structure: Headings: Exactly one main heading" }) page("http://localhost:54321/missing_main_heading.html?again!") page("http://localhost:54321/subheading_first.html") @@ -14,7 +14,7 @@ Feature: Display result summary When I run `bbc-a11y` Then it should fail with: """ - 4 pages checked, 1 error found, 2 warnings, 1 standard skipped + 4 pages checked, 1 error found, 1 warning, 1 standard skipped """ Scenario: Reminds users to consider usability beyond lint results diff --git a/features/cli/json_reporter.feature b/features/cli/json_reporter.feature index 21a8bb7..7ed9032 100644 --- a/features/cli/json_reporter.feature +++ b/features/cli/json_reporter.feature @@ -4,7 +4,7 @@ Feature: JSON Reporter And a file named "a11y.js" with: """ page("http://localhost:54321/perfect.html", { - skip: ["Main landmark: Exactly one Main landmark"] + skip: ["Structure: Containers and landmarks: Exactly one main landmark"] }) page("http://localhost:54321/missing_main_heading.html") """ diff --git a/features/cli/manual_testing.feature b/features/cli/manual_testing.feature index 1aa8189..149596f 100644 --- a/features/cli/manual_testing.feature +++ b/features/cli/manual_testing.feature @@ -5,23 +5,18 @@ Feature: Manual Testing When I run `bbc-a11y http://localhost:54321/perfect.html --manual` And I answer the following questions: | question | answer | - | Is the core purpose (to inform, educate, or entertain) of this page clearly defined? | Yes | - | Is information conveyed with colour also identifiable from context or markup? | Yes | - | Do all colour combinations pass the Snook colour contrast check? | Yes | - | Are all links that are part of general editorial content self-evident, identifiable by their visual style, and distinguishable from the surrounding content? | Yes | - | Do all text links have a mouse over state change? | Yes | - | Do all focusable elements have a clearly identifiable visual style when they have focus? | Yes | - | Does the page function without JavaScript or CSS? | Yes | - | Is the content visible and usable with the page zoomed to 200% of normal? | Yes | - | Is the content visible and usable with the text resized to 200% of normal? | Yes | | Is alternative delivery (such as subtitles, sign language, audio description and transcripts) provided with all embedded media? | Yes | | Does any audio that plays automatically make the user aware this will happen, or provide a pause/stop/mute button? | Yes | | Is relevant metadata provided for all media? | Yes | | Are volume controls provided for all interactive media? | Yes | | Is assistive technology uninterrupted by narrative audio? | Yes | + | Do all colour combinations pass the Snook colour contrast check? | Yes | + | Is information conveyed with colour also identifiable from context or markup? | Yes | | Is the core content of the page accessible without styling? | Yes | | Are all touch targets large enough to touch accurately? | Yes | | Is an inactive space provided around every actionable element? | Yes | + | Is the content visible and usable with the page zoomed to 200% of normal? | Yes | + | Is the content visible and usable with the text resized to 200% of normal? | Yes | | Do all links have underlines and pointers? | Yes | | Do all actionable and focusable elements visibly change state when focused? | Yes | | Is the user experience consistent? | Yes | @@ -69,65 +64,5 @@ Feature: Manual Testing Scenario: Failing manual tests Given a website running at http://localhost:54321 When I run `bbc-a11y http://localhost:54321/perfect.html --manual` - And I answer the following questions: - | question | answer | - | Is the core purpose (to inform, educate, or entertain) of this page clearly defined? | Yes | - | Is information conveyed with colour also identifiable from context or markup? | Yes | - | Do all colour combinations pass the Snook colour contrast check? | Yes | - | Are all links that are part of general editorial content self-evident, identifiable by their visual style, and distinguishable from the surrounding content? | Yes | - | Do all text links have a mouse over state change? | Yes | - | Do all focusable elements have a clearly identifiable visual style when they have focus? | Yes | - | Does the page function without JavaScript or CSS? | Yes | - | Is the content visible and usable with the page zoomed to 200% of normal? | Yes | - | Is the content visible and usable with the text resized to 200% of normal? | Yes | - | Is alternative delivery (such as subtitles, sign language, audio description and transcripts) provided with all embedded media? | Yes | - | Does any audio that plays automatically make the user aware this will happen, or provide a pause/stop/mute button? | Yes | - | Is relevant metadata provided for all media? | Yes | - | Are volume controls provided for all interactive media? | Yes | - | Is assistive technology uninterrupted by narrative audio? | Yes | - | Is the core content of the page accessible without styling? | Yes | - | Are all touch targets large enough to touch accurately? | Yes | - | Is an inactive space provided around every actionable element? | Yes | - | Do all links have underlines and pointers? | Yes | - | Do all actionable and focusable elements visibly change state when focused? | Yes | - | Is the user experience consistent? | Yes | - | Does the interface provide multiple ways to interact with the content? | Yes | - | Is any interactive media adjustable for user ability and preference? | Yes | - | Does any content visibly or intentionally flicker or flash more than three times in any one-second period? | No | - | Are consistent editorial labels used? | Yes | - | Are changes to language indicated? | Yes (or not applicable) | - | Are additional instructions provided to supplement visual and audio cues? | Yes (or not applicable) | - | Are all interactive elements focusable? | Yes | - | Is there a keyboard trap? | No | - | Is content logically ordered? | Yes | - | Is actionable content navigable in a meaningful sequence? | Yes | - | Are actions triggered when appropriate for the type of user interaction? | Yes | - | Are alternative input methods supported? | Yes (or not applicable) | - | Are all form controls labelled? | Yes | - | Is a default input format indicated and supported? | Yes | - | Are labels placed close to the relevant form control, and laid out appropriately? | Yes | - | Are controls, labels, and other form elements properly grouped? | Yes | - | Does focus or context automatically change during user input? | No | - | Are there unnecessary images of text? | No | - | Are accessible alternatives provided for background images that convey information or meaning? | Yes (or not applicable) | - | Does all link and navigation text uniquely describe the target or function of the link or item? | Yes | - | Do all links to alternative formats indicate that an alternative is opening? | Yes (or not applicable) | - | Are repeated links to the same resource combined within a single link? | Yes (or not applicable) | - | Are notifications both visible and audible? | Yes (or not applicable) | - | Are standard operating system notifications used where available and appropriate? | Yes (or not applicable) | - | Are clear error messages provided? | Yes (or not applicable) | - | Is non-critical feedback or assistance provided when appropriate? | Yes (or not applicable) | - | Are scripts and dynamic content built in a progressive manner? | Yes (or not applicable) | - | Does all media that updates or animated content have a pause, stop or hide control? | Yes (or not applicable) | - | Does the page refresh automatically without warning? | No | - | Are there any timed responses that are not adjustable? | No | - | Is interaction input control adaptable? | Yes (or not applicable) | - | Is the page title uniquely and clearly identifiable? | Yes | - | Are containers used to describe page structure? | Yes | - | Are controls, objects and grouped interface elements represented as a single accessible component? | Yes | - | Do alternatives briefly describe the editorial intent or purpose of the image, object, or element? | Yes (or not applicable) | - | Are decorative images hidden from assistive technology? | Yes (or not applicable) | - | Do tooltips repeat link text or other alternatives? | No (or not applicable) | - | Do elements have accessibility properties set appropriately? | Yes (or not applicable) | - | Is visual formatting alone used to convey meaning? | Yes | + And I answer all questions except one with a pass Then it should result in a fail for http://localhost:54321/perfect.html diff --git a/features/cli/skipping_standards.feature b/features/cli/skipping_standards.feature index e3e0950..c45810c 100644 --- a/features/cli/skipping_standards.feature +++ b/features/cli/skipping_standards.feature @@ -5,7 +5,7 @@ Feature: Skipping Standards And a file named "a11y.js" with: """ page("http://localhost:54321/missing_main_heading.html", { - skip: "Headings: Exactly one main heading" + skip: "Structure: Headings: Exactly one main heading" }) """ When I run `bbc-a11y` @@ -19,7 +19,7 @@ Feature: Skipping Standards And a file named "a11y.js" with: """ page("http://localhost:54321/two_headings_failures.html", { - only: "Headings: Exactly one main heading" + only: "Structure: Headings: Exactly one main heading" }) """ When I run `bbc-a11y` diff --git a/features/cli/summarise_tests.feature b/features/cli/summarise_tests.feature index a53e159..9df5619 100644 --- a/features/cli/summarise_tests.feature +++ b/features/cli/summarise_tests.feature @@ -6,15 +6,23 @@ Feature: Summarise Tests """ Tests covered by bbc-a11y: - Core purpose: Core purpose must be defined - Type: manual - Fails for each page whose core purpose (to inform, educate, or entertain) is not clearly defined + Minimum text size: Text cannot be too small + Type: automated + Fails for each text node with a computed font size of less than 11px - Colour and meaning: Information conveyed with colour must also be identifiable from context or markup - Type: manual - Fails for each page whose information conveyed with colour is not also identifiable from context or markup + Principles: All documents must have a W3C recommended doctype + Type: automated + Fails for each page that is missing a w3c recommended doctype (e.g. ) + + Principles: Markup must validate against doctype + Type: automated + Fails for each page whose markup does not validate against a w3c standards validator + + Principles: Anchors must have hrefs + Type: automated + Fails for each visible element with no href attribute - Colour contrast: Colour combinations must pass the WCAG colour contrast check + Audio & Video: Alternatives for audio and visual content: Alternative delivery for embedded media must be provided Type: manual - Fails for each page whose colour combinations fail the WCAG colour contrast check + Fails for each page that includes embedded media with no alternative delivery """ diff --git a/features/disabled_caching.feature b/features/disabled_caching.feature index 5b556fc..8e1cb82 100644 --- a/features/disabled_caching.feature +++ b/features/disabled_caching.feature @@ -20,6 +20,6 @@ Feature: Disabled Caching Then it should fail with: """ ✗ http://localhost:54321/goodThenBad.html - * Headings: Exactly one main heading + * Structure: Headings: Exactly one main heading - Found 0 h1 elements. """ diff --git a/features/setting_cookies.feature b/features/setting_cookies.feature index 5780500..0afa0fc 100644 --- a/features/setting_cookies.feature +++ b/features/setting_cookies.feature @@ -27,11 +27,11 @@ Feature: Setting Cookies ✓ http://localhost:54321/good_with_cookie.html ✗ http://localhost:54321/good_with_cookie.html - * Main landmark: Exactly one Main landmark + * Structure: Containers and landmarks: Exactly one main landmark - Found 0 elements with role="main". ✗ http://localhost:54321/good_with_cookie.html - * Main landmark: Exactly one Main landmark + * Structure: Containers and landmarks: Exactly one main landmark - Found 0 elements with role="main". ✓ http://localhost:54321/good_with_cookie.html diff --git a/features/standards/html/01_core_purpose.feature b/features/standards/html/01_core_purpose.feature deleted file mode 100644 index c4371a4..0000000 --- a/features/standards/html/01_core_purpose.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: Core Purpose - - Rationale - ========= - - While our aim is for all users to have access to all features of BBC apps and - sites we recognise that technology both restricts and extends what is - possible. - - Additionally GEL is aimed providing the best experience to the broadest range - of users, and while it should not discriminate against users with access needs - nor does it give special privilege. - - The aim of this guideline is to provide the most accessible base line - experience for the core purpose across the broadest range of technology. - - See the following standards for examples of when a defined core purpose is - applicable: - - * Progressive enhancement - - * Minimum text size - - It is not a reason to ignore accessibility for non-core page elements. - - Using the standards and guidelines - ================================== - - You can use use and re-use the the BBC Accessibility Standards and Guidelines - under an Open Government Licence for Public Sector Information. - - Details can be found on the Open Government Licence for Public Sector - Information website. - - Feedback - ======== - - We would love to hear your feedback. If you have a question or comment about - the standards or guidelines email us at AccessibilityTeam@bbc.co.uk. diff --git a/features/standards/html/02_validation.feature b/features/standards/html/02_validation.feature deleted file mode 100644 index 772a7e7..0000000 --- a/features/standards/html/02_validation.feature +++ /dev/null @@ -1,79 +0,0 @@ -Feature: Validation - - All documents must have a W3C recommended Doctype and all Markup must - validate against that Doctype. - - Rationale - ========= - - While assistive technologies such as screen readers generally do a good job of - interpreting invalid HTML there will be less risk of problems arising if the - document follows a recognised standard Doctype. - - @internet - Scenario: Valid for doctype - Given a page with the HTML: - """ - - - - Page title - - - -

And a heading

- - - """ - And my page configuration is: - """ - { - w3cValidator: 'https://validator.w3.org/nu/' - } - """ - When I test the "Validation: Markup must validate against doctype" standard - Then it passes - - @internet - Scenario: Invalid for doctype - Given a page with the HTML: - """ - - - - Page title - - -

And a heading

- - - """ - When my page configuration is: - """ - { - w3cValidator: 'https://validator.w3.org/nu/' - } - """ - And I test the "Validation: Markup must validate against doctype" standard - Then it fails with the message: - """ - The character encoding was not declared. Proceeding using “windows-1252”. - """ - - Scenario: No doctype specified - Given a page with the HTML: - """ - - - No doctype specified - - -

The doctype is not specified

- - - """ - When I test the "Validation: All documents must have a W3C recommended doctype" standard - Then it fails with the message: - """ - Missing w3c recommended doctype - """ diff --git a/features/standards/html/03_progressive_enhancement.feature b/features/standards/html/03_progressive_enhancement.feature deleted file mode 100644 index 5bfc216..0000000 --- a/features/standards/html/03_progressive_enhancement.feature +++ /dev/null @@ -1,4 +0,0 @@ -Feature: Progressive Enhancement - - * The core purpose of every document must not require JavaScript or CSS to - function. diff --git a/features/standards/html/04_indicating_language.feature b/features/standards/html/04_indicating_language.feature deleted file mode 100644 index aa18bb7..0000000 --- a/features/standards/html/04_indicating_language.feature +++ /dev/null @@ -1,46 +0,0 @@ -Feature: Specify content language - - The main language of the page **must** be specified. - - Changes to language within the page **must** be indicated. - - Rationale - ========= - - Assistive technologies such as screen readers have support for different - languages, allowing for appropriate pronunciation. - - Scenario: lang attribute on html element - Given a page with the HTML: - """ - - - - Language specified - - -

The language is specified

- - - """ - When I test the "Indicating language: Html must have lang attribute" standard - Then it passes - - Scenario: Missing lang attribute on html element - Given a page with the HTML: - """ - - - - Language missing - - -

The language is missing

- - - """ - When I test the "Indicating language: Html must have lang attribute" standard - Then it fails with the message: - """ - html tag has no lang attribute: /html - """ diff --git a/features/standards/html/05_page_titles.feature b/features/standards/html/05_page_titles.feature deleted file mode 100644 index 49426ec..0000000 --- a/features/standards/html/05_page_titles.feature +++ /dev/null @@ -1,127 +0,0 @@ -Feature: Page Titles - - Documents must have a page that identifies its main content. - - Rationale - ========= - - Document titles help users orientate themselves within web sites and apps. - The document <title> element content is often the first thing a speech output - user will hear and acts as a confirmation of what page they have arrived at. - Document titles commonly have the same content as the main <h1> element. - - Scenario: Valid page title with string - Given a page with the HTML: - """ - <!DOCTYPE html> - <html lang="en-GB"> - <head> - <title>Chocolate brownies - Yummy recipe site - - -

Chocolate brownies

- - - """ - When my page configuration is: - """ - { - title: 'Chocolate brownies - Yummy recipe site' - } - """ - When I test the "Page titles: Title element must identify main content" standard - Then it passes - - Scenario: Valid page title with template string - Given a page with the HTML: - """ - - - - Chocolate brownies - Yummy recipe site - - -

Chocolate brownies

- - - """ - When my page configuration is: - """ - { - title: '{h1:first} - Yummy recipe site' - } - """ - When I test the "Page titles: Title element must identify main content" standard - Then it passes - - Scenario: Valid page title with template function - Given a page with the HTML: - """ - - - - Chocolate brownies - Yummy recipe site - - -

Chocolate brownies

- - - """ - When my page configuration is: - """ - { - title: $ => $('h1').text() + ' - Yummy recipe site' - } - """ - When I test the "Page titles: Title element must identify main content" standard - Then it passes - - Scenario: Valid page title with invalid template - Given a page with the HTML: - """ - - - - Chocolate brownies - Yummy recipe site - - -

Chocolate brownies

- - - """ - When my page configuration is: - """ - { - title: 666 - } - """ - When I test the "Page titles: Title element must identify main content" standard - Then it fails with the message: - """ - Invalid title 666 - """ - - Scenario: Invalid page title - Given a page with the HTML: - """ - - - - Oops wrong title - Yummy recipe site - - -

Sausage rolls

- - - """ - When my page configuration is: - """ - { - title: $ => $('h1').text() + ' - Yummy recipe site' - } - """ - When I test the "Page titles: Title element must identify main content" standard - Then it fails with the message: - """ - Title element failed to identify main content: expected "Sausage rolls - Yummy recipe site", actual "Oops wrong title - Yummy recipe site" - """ diff --git a/features/standards/html/06_main_landmark.feature b/features/standards/html/06_main_landmark.feature deleted file mode 100644 index 6501590..0000000 --- a/features/standards/html/06_main_landmark.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Main landmark - - A page **must** have exactly one element with `role="main"` - - Rationale - ========= - - The WAI-ARIA `main` landmark role can be help keyboard users with assistive - technologies such as screen readers (and in the future as native browser - functionality) to skip directly to the main content of a page, bypassing - navigation and other contents that might be before it. - - Scenario: Page has a single main element - Given a page with the body: - """ -
Main element
- """ - When I test the "Main landmark: Exactly one Main landmark" standard - Then it passes - - Scenario: Page has two main elements - Given a page with the body: - """ -
Main one
-
Main two
- """ - When I test the "Main landmark: Exactly one Main landmark" standard - Then it fails with the message: - """ - Found 2 elements with role="main": /html/body/div[1] /html/body/div[2] - """ - - Scenario: Page has zero main elements - Given a page with the body: - """ -
Main one
- """ - When I test the "Main landmark: Exactly one Main landmark" standard - Then it fails with the message: - """ - Found 0 elements with role="main". - """ diff --git a/features/standards/html/07_headings.feature b/features/standards/html/07_headings.feature deleted file mode 100644 index 6761f1e..0000000 --- a/features/standards/html/07_headings.feature +++ /dev/null @@ -1,253 +0,0 @@ -Feature: Headings - - A document **must** have exactly one `

` element. - - Heading levels after the document `

` element **must** be sequential and - **must not** skip heading levels. - - Heading elements **must** be followed by content. - - Rationale - ========= - - A logical heading structure is invaluable for users of screen readers and - similar assistive technologies to help navigate content. - - Users should be able to use the document's `

` identify its main content. - Documents should have one main subject. - - Heading levels should not be skipped as a predictable document outline is an - important factor for understandability. - - Headings should not be used for non-heading purposes, i.e. to identify blocks - of content. A heading should always be followed either by non-heading content - or by a heading of one level deeper. - - Scenario: No main heading - Given a page with the body: - """ -

Heading 2

- """ - When I test the "Headings: Exactly one main heading" standard - Then it fails with the message: - """ - Found 0 h1 elements. - """ - - Scenario: More than one main heading - Given a page with the body: - """ -

Heading 1

-

Heading 2

-

Heading 1

- """ - When I test the "Headings: Exactly one main heading" standard - Then it fails with the message: - """ - Found 2 h1 elements: /html/body/h1[1] /html/body/h1[2] - """ - - Scenario: More than one main heading, but only one visible - Given a page with the body: - """ -

A Heading

-

Another Heading

- """ - When I test the "Headings: Exactly one main heading" standard - Then it passes - - Scenario: Headings in ascending order - Given a page with the body: - """ -

Heading 1

-

Heading 2

-

Heading 3

-

Heading 4

-
Heading 5
-
Heading 6
- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it passes - - Scenario: Headings in invalid order - Given a page with the body: - """ -

Heading 1

-

Heading 3

-

Heading 2

- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it fails with the message: - """ - Headings are not in order: /html/body/h1 /html/body/h3 - """ - - Scenario: Headings jump back up more than one level - Given a page with the body: - """ -

Heading 1

-

Heading 2

-

Heading 3

-

Heading 4

-

Heading 2b

-

Heading 3b

- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it passes - - Scenario: Heading is hidden - Given a page with the body: - """ -

Heading 1

-

Heading 3

-

Heading 2

- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it fails with the message: - """ - Headings are not in order: /html/body/h1 /html/body/h3 - """ - - Scenario: Heading in a script tag - Given a page with the body: - """ -

Heading 1

- -

Heading 2

- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it passes - - Scenario: Subheading before the first main heading - Given a page with the body: - """ -

Ignore me

-

Heading 1

-

Heading 2

- """ - When I test the "Headings: Headings must be in ascending order" standard - Then it passes with the warning: - """ - First heading was not a main heading: /html/body/h3 - """ - - Scenario: Content between headings - Given a page with the body: - """ -
-

Main heading

-

non-heading content

-

Another heading

-

non-heading content

-

Main content

- non-heading content -

Secondary content

-

non-heading content

-

Tertiary content

- non-heading content -
- """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: Heading followed by subheading - Given a page with the body: - """ -

Main heading

-

Another heading

-

...and some content

- """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: No content between headings - Given a page with the body: - """ -
-

Main heading

-

non-heading content

-

Secondary content

-

Tertiary content

-

non-heading content

-
- """ - When I test the "Headings: Content must follow headings" standard - Then it fails with the message: - """ - No content follows: /html/body/div/h2[1] - """ - - Scenario: Nested heading followed by heading of the same level - Given a page with the body: - """ -

Main heading

-
-

Subheading

-
-

Another subheading

- Content - """ - When I test the "Headings: Content must follow headings" standard - Then it fails with the message: - """ - No content follows: /html/body/div/h2 - """ - - Scenario: Nested heading followed by non-nested content - Given a page with the body: - """ -
-

Main heading

-
- Followed by some content - """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: Nested heading followed by nested content - Given a page with the body: - """ -
-

Main heading

-
-
- Followed by some content -
- """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: Nested heading surrounded by no whitespace followed by content - Given a page with the body: - """ -
-

News headlines

- Content -
- """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: Doubly-nested heading surrounded by no whitespace followed by content - Given a page with the body: - """ -
-

News headlines

- Content -
- """ - When I test the "Headings: Content must follow headings" standard - Then it passes - - Scenario: Non-nested heading followed by nested content - Given a page with the body: - """ -

Main heading

-
- Followed by some content -
- """ - When I test the "Headings: Content must follow headings" standard - Then it passes diff --git a/features/standards/html/08_minimum_text_size.feature b/features/standards/html/08_minimum_text_size.feature index 7e0e60d..d81007f 100644 --- a/features/standards/html/08_minimum_text_size.feature +++ b/features/standards/html/08_minimum_text_size.feature @@ -12,6 +12,7 @@ Feature: Minimum text size vision and there will not have access to assistive technology or be familiar with browser tools to resize content. + @html @automated Scenario: Small text Given a page with the body: """ @@ -33,22 +34,24 @@ Feature: Minimum text size Text size too small (9px): /html/body/span[2]/b """ - Scenario: Hidden elements with small text - Given a page with the body: - """ - - Tiny text, but it's hidden! - """ - When I test the "Minimum text size: Text cannot be too small" standard - Then it passes + @html @automated + Scenario: Hidden elements with small text + Given a page with the body: + """ + + Tiny text, but it's hidden! + """ + When I test the "Minimum text size: Text cannot be too small" standard + Then it passes - Scenario: Text nodes with only whitespace - Given a page with the body: - """ -
  -
- """ - When I test the "Minimum text size: Text cannot be too small" standard - Then it passes + @html @automated + Scenario: Text nodes with only whitespace + Given a page with the body: + """ +
  +
+ """ + When I test the "Minimum text size: Text cannot be too small" standard + Then it passes diff --git a/features/standards/html/09_resizable_text.feature b/features/standards/html/09_resizable_text.feature deleted file mode 100644 index 708cda9..0000000 --- a/features/standards/html/09_resizable_text.feature +++ /dev/null @@ -1,50 +0,0 @@ -Feature: Resizable text - - * Text must be styled with units that are resizable in all browsers. - - * Content must be visible and usable with text resized to 200% of normal. - - * Content must be visible and usable with page zoomed to 200% of normal. - - * Where available on a platform zoom must be suported. - - Rationale - ========= - - Standard browser features for resizing text or page zoom can make content - accessible to many low vision users without the need for additional assistive - technologies such as screen magnifiers or screen readers. - - Text resizing and page zoom cater to different needs, and therefore both - should be supported. - - Internet Explorer does not resize text that have been styled in px units, - therefore em, % or similar units should be used. - - Browsers on iOS, Android, and other mobile platforms also support zoom with - pinch-in and pinch-out gestures. In most cases it is just a matter of not - disabling this, but there are some cases when it is appropriate to implement - content specific interactions, such as with zoomable maps, which should mimic - the same pinch-in and pinch-out gestures. - - Scenario: Text must be styled with units that are resizable in all browsers - Given a page with the body: - """ -

Styled in px!

- - Styled in px! - """ - When I test the "Resizable text: Text must be styled with units that are resizable in all browsers" standard - Then it fails with the message: - """ - Text styled with px unit: /html/body/p - Text styled with px unit: /html/body/b - """ - - Scenario: User agent stylesheet is ignored - Given a page with the body: - """ -

Not styled in px!

- """ - When I test the "Resizable text: Text must be styled with units that are resizable in all browsers" standard - Then it passes diff --git a/features/standards/html/10_tab_index.feature b/features/standards/html/10_tab_index.feature deleted file mode 100644 index 1a1c8a5..0000000 --- a/features/standards/html/10_tab_index.feature +++ /dev/null @@ -1,69 +0,0 @@ -Feature: Tab index - - Positive `tabindex` attribute values **must not** be used to create a logical - tab order. - - `tabindex` values of `0` **must not** be used on elements that are not - focusable by default. - - Rationale - ========= - - Typical BBC pages are made up of several shared components (Global navigation, - page content, share tools, location service widgets, etc.) so no one piece of - code has complete awareness of the content of the page or when the content - updates. Positive `tabindex` values results in unpredictable tab order that do - not occur if the natural order of content is relied upon. - - Using `tabindex="0"` on an element adds it to the document tab order, however - it does not change the element type to allow it to be discovered by navigating - by link or form element, nor does it bind click and key press handlers to the - element. There are no circumstances in which it is not better to use a - natively focusable control such as a `
` or ` -
- """ - When I test the "Tab index: Zero Tab index must only be set on elements which are focusable by default" standard - Then it passes - - Scenario: Focusable elements with zero Tab index - Given a page with the body: - """ - News - - - - - """ - When I test the "Tab index: Zero Tab index must only be set on elements which are focusable by default" standard - Then it passes - - Scenario: Unfocusable element with zero Tab index - Given a page with the body: - """ - News - -
-
- """ - When I test the "Tab index: Zero Tab index must only be set on elements which are focusable by default" standard - Then it fails with the message: - """ - Non-focusable element with tabindex=0: /html/body/div[2] - """ - - Scenario: Unfocusable element with zero Tab index - Given a page with the body: - """ - News - -
-
- """ - When I test the "Tab index: Zero Tab index must only be set on elements which are focusable by default" standard - Then it passes diff --git a/features/standards/html/11_title_attributes.feature b/features/standards/html/11_title_attributes.feature deleted file mode 100644 index 7bf5b79..0000000 --- a/features/standards/html/11_title_attributes.feature +++ /dev/null @@ -1,91 +0,0 @@ -Feature: Title attributes - - `title` attributes **must not** be used for critical information and **must - not** repeat content that is already visible and associated with the same - control or content. - - Rationale - ========= - - `title` attributes are inaccessible to keyboard users without additional - Assistive Technology. They are dependent on user settings in Screen Readers - and similar Assistive Technology. - - Additionally they suffer from discoverability problems: pointing device users - are required to hover over page elements and pause before the title tooltip - displays, usually with no indication that there is additional content to be - displayed. - - Repeating content in visible text and `title` attributes can lead to content - clutter and repeated phrases. - - Key recommendations are: - - - Do not use the `title` attribute unless on a form input as title text is not - well supported on links on mobile - - Do not use `title` attributes and explicit labels together on form fields - - Scenario: Form field with title attribute - Given a page with the body: - """ - - """ - When I test the "Title attributes: Title attributes only on inputs" standard - Then it passes - - Scenario: Hidden element with title attribute - Given a page with the body: - """ - - """ - When I test the "Title attributes: Title attributes only on inputs" standard - Then it passes - - Scenario: Anchor tag with title attribute - Given a page with the body: - """ - - - - """ - When I test the "Title attributes: Title attributes only on inputs" standard - Then it fails with the message: - """ - Non-input element has title attribute: /html/body/a - """ - - Scenario: Iframe tag with title attribute - Given a page with the body: - """ - - """ - When I test the "Title attributes: Title attributes only on inputs" standard - Then it passes - - Scenario: Title attribute duplicates content - Given a page with the body: - """ - - Back to Home - - """ - When I test the "Title attributes: Title attributes must not duplicate content" standard - Then it fails with the message: - """ - Title attribute duplicates content: /html/body/a - """ - - Scenario: Title attribute duplicates nested content - Given a page with the body: - """ - - Back to Home - - """ - When I test the "Title attributes: Title attributes must not duplicate content" standard - Then it fails with the message: - """ - Title attribute duplicates content: /html/body/a - """ diff --git a/features/standards/html/12_focusable_controls.feature b/features/standards/html/12_focusable_controls.feature deleted file mode 100644 index 65a76e3..0000000 --- a/features/standards/html/12_focusable_controls.feature +++ /dev/null @@ -1,70 +0,0 @@ -Feature: Focusable controls - - Controls for JavaScript enhanced interactions **must** be ``, ` - - """ - When I test the "Focusable controls: Anchors must have hrefs" standard - Then it passes - - Scenario: Some anchor tags do not have href attributes - Given a page with the body: - """ - - """ - When I test the "Focusable controls: Anchors must have hrefs" standard - Then it fails with the message: - """ - Anchor has no href attribute: /html/body/ul/li[1]/a - Anchor has no href attribute: /html/body/ul/li[3]/a - """ - - Scenario: Hidden anchor tag with no href attribute - Given a page with the body: - """ - I'm invisible, ignore me - """ - When I test the "Focusable controls: Anchors must have hrefs" standard - Then it passes diff --git a/features/standards/html/13_visible_on_focus.feature b/features/standards/html/13_visible_on_focus.feature deleted file mode 100644 index bb0ad4d..0000000 --- a/features/standards/html/13_visible_on_focus.feature +++ /dev/null @@ -1,49 +0,0 @@ -Feature: Visible On Focus - - Scenario: Element hidden using absolute top positioning - Given a page with the body: - """ - - - - """ - When I test the "Visible on focus: Elements must be visible on focus" standard - Then it fails with the message: - """ - Element is invisible on focus: /html/body/div/a - """ - - Scenario: Element hidden using absolute left positioning - Given a page with the body: - """ - - - - """ - When I test the "Visible on focus: Elements must be visible on focus" standard - Then it fails with the message: - """ - Element is invisible on focus: /html/body/div/a - """ - - Scenario: Element is visible - Given a page with the body: - """ - BBC - """ - When I test the "Visible on focus: Elements must be visible on focus" standard - Then it passes diff --git a/features/standards/html/14_control_styles.feature b/features/standards/html/14_control_styles.feature deleted file mode 100644 index 519cd14..0000000 --- a/features/standards/html/14_control_styles.feature +++ /dev/null @@ -1 +0,0 @@ -Feature: Control Styles diff --git a/features/standards/html/15_focus_styles.feature b/features/standards/html/15_focus_styles.feature deleted file mode 100644 index d7131a4..0000000 --- a/features/standards/html/15_focus_styles.feature +++ /dev/null @@ -1 +0,0 @@ -Feature: Focus Styles diff --git a/features/standards/html/16_colour_contrast.feature b/features/standards/html/16_colour_contrast.feature deleted file mode 100644 index 34d6ba3..0000000 --- a/features/standards/html/16_colour_contrast.feature +++ /dev/null @@ -1 +0,0 @@ -Feature: Colour Contrast diff --git a/features/standards/html/17_colour_and_meaning.feature b/features/standards/html/17_colour_and_meaning.feature deleted file mode 100644 index 3485317..0000000 --- a/features/standards/html/17_colour_and_meaning.feature +++ /dev/null @@ -1 +0,0 @@ -Feature: Colour And Meaning diff --git a/features/standards/html/18_image_alternatives.feature b/features/standards/html/18_image_alternatives.feature deleted file mode 100644 index da39fad..0000000 --- a/features/standards/html/18_image_alternatives.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: Image alternatives - - All images **must** have an alt attribute. - - All editorial significant images **must** have a non-null alt attribute value, - or a text alternative in the preceding or following content. - - Rationale - ========= - - Assistive technologies such as screen readers will provide a text alternative - for images that do not have alt attributes based on the image file name. For - images that do not have editorial significance or are described in the - surrounding text content it is appropriate to use a null (alt="") value for - the image alt attribute to avoid this. - - All editorially significantly images must have a text alternative either as - the value of the alt attribute or in the immediately surrounding text content. - - Scenario: Images with alt attributes - Given a page with the body: - """ - A picture of something - - """ - When I test the "Image alternatives: Images must have alt attributes" standard - Then it passes - - Scenario: Images without alt attributes - Given a page with the body: - """ - A picture of something - - """ - When I test the "Image alternatives: Images must have alt attributes" standard - Then it fails with the message: - """ - Image has no alt attribute: /html/body/img[2] - """ diff --git a/features/standards/html/19_form_labels.feature b/features/standards/html/19_form_labels.feature deleted file mode 100644 index 3495347..0000000 --- a/features/standards/html/19_form_labels.feature +++ /dev/null @@ -1,132 +0,0 @@ -Feature: Form labels - - Form fields that allow input (`select`, and `textarea` elements, and all - `input` element types other than image, submit, reset, button, or hidden) - **must** have an associated label, either in the form of a `