Blocked on #3293469: Automated A11y tests in Nightwatch, which performs the checks that surfaced this

Problem/Motivation

The tests added in #3293469: Automated A11y tests in Nightwatch identified the following when visiting /search/node

08:56:58   ✖ NightwatchAssertError
08:56:58    aXe rule: duplicate-id-aria - IDs used in ARIA and labels must be unique
08:56:58 	In element: ...search-block-form > .form-no-label.js-form-item.form-item > .form-search[size="15"][maxlength="128"]
08:56:58   ✖ NightwatchAssertError
08:56:58    aXe rule: heading-order - Heading levels should only increase by one
08:56:58 	In element: h3

Things to consider:

  • If it is easier to split this into multiple issues, that should happen.
  • These tests were performed with Olivero as theme, so it is possible some A11y fails are Olivero specific, vs. originating from the Search module. For any given issue where that is the case, change the Component to Olivero.
  • If any of the a11y errors are considered acceptable (either false positives or there's a tradeoff that provides greater benefit), it's possible to leave something unfixed, but the rationale should be documented within the code.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

bnjmnm created an issue. See original summary.

steinmb’s picture

Status: Postponed » Active
bnjmnm’s picture

Title: [PP-1] Address A11y test fails in search/node » Address A11y test fails in search/node

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dmundra’s picture

The 'header-order' error is caused by 'Your search yielded no results.' being an h3.

Linking to some historical context of why that was the case:

* https://www.drupal.org/project/drupal/issues/1926344#comment-8256493, mentions the header issue with multiple h3s and making 'Search results' an h2.
* https://www.drupal.org/project/drupal/issues/1926344#comment-8418527, suggested dropping 'Search results' from being displayed if no results but leaving the h3 for 'Your search yielded no results'.

So the question is should we change 'Your search yielded no results' to h2? But does it need to be a header, could it be a paragraph. That point was raised in https://www.drupal.org/project/drupal/issues/1926344#comment-8256063 and the comment was valid to leave it a header because of the help text after it. Since the help text has been removed maybe setting to a paragraph is fine now?

dmundra’s picture

dmundra’s picture