Add listbox-picker test case (custom dropdown ARIA listbox contract)#21
Open
manichandra wants to merge 1 commit into
Open
Add listbox-picker test case (custom dropdown ARIA listbox contract)#21manichandra wants to merge 1 commit into
manichandra wants to merge 1 commit into
Conversation
Covers a custom dropdown picker and the ARIA listbox contract that a static axe-core pass does not catch: the trigger must expose aria-haspopup and aria-expanded, the popup must be role=listbox with role=option children, options must carry aria-selected, and the menu must support arrow-key navigation and close on Escape (WAI-ARIA 1.2 / APG listbox pattern; WCAG 2.1 SC 4.1.2). Includes prompt.yaml, test.js (six Requirement assertions), and two examples with embedded a11y-assertions expectations (a conformant listbox and a div-based dropdown anti-pattern). Verified with node_runner: the conformant example passes all six; the anti-pattern fails the five role/selection/keyboard assertions.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
test_cases/listbox-picker/, a test case that evaluates a custom dropdown "picker" against the ARIA listbox contract — semantics that a static axe-core pass does not catch on adiv-based dropdown.Motivation
There is currently no listbox/combobox test case. Custom dropdown menus are a pattern models frequently generate without accessibility semantics:
aria-haspopup/aria-expanded, so assistive technology cannot announce that it opens a popup or whether it is open;divs with norole="listbox"/role="option", so it is not exposed as a selectable list;aria-selected, so the current choice is not announced;axe-core does not flag a
divdropdown that merely looks interactive, so these gaps go unmeasured. The case maps to WAI-ARIA 1.2, the WAI-ARIA APG listbox pattern, and WCAG 2.1 SC 4.1.2 (Name, Role, Value).What this adds
prompt.yaml— a neutral product spec for a text-style picker that explicitly forbids a native<select>. It does not state the ARIA answer, so the eval measures whether the model gets it right.test.js— six Requirement assertions, following the existingmodule.exports.run = async ({ page, assert, utils })convention with{ pass, message }results:aria-haspopupandaria-expanded)role="listbox"withrole="option"childrenaria-selected(exactly one selected)examples/— two example files with embeddeda11y-assertionsexpectations: a conformant ARIA listbox and adiv-based dropdown anti-pattern.DOM discovery is self-contained (it tags candidate options and inspects roles/attributes), so the case does not depend on widget-specific
utils; the onlyutilscall (reload) is guarded.Validation
Ran
test.jsagainst both examples withnode_runner:div-based dropdown fails the five role / selection / keyboard assertions (only "Each option has an accessible name" passes, since the items have text).Checklist
test_cases/conventions