Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comments
Comment #2
steinmb CreditAttribution: steinmb as a volunteer commented#3293469: Automated A11y tests in Nightwatch is now in, unblocking
Comment #3
bnjmnmComment #5
dmundraThe '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?Comment #6
dmundraI found the related issue discussing the header change https://www.drupal.org/project/drupal/issues/3182458
Comment #7
dmundraI believe this one is the search block duplicate ID issue https://www.drupal.org/project/drupal/issues/1852090