Manual Test Cases for ARIA Haspopup Invalid Value - Test 1558

Test 1558: One or more elements, not intentionally hidden in the DOM and available to assistive technologies, has an aria-haspopup attribute that is not set to one of the following text values: 'true | false | menu | listbox | tree | grid | dialog'.

Elements with aria-haspopup are outlined in purple. Valid values are highlighted in green, invalid values in red.

Test Logic:

Common Use Cases:

Purpose:

aria-haspopup indicates that an element triggers a popup and, since ARIA 1.1, what type of popup it triggers (menu, listbox, tree, grid, or dialog). Assistive technology uses this value to announce the correct interaction pattern to the user. An invalid value (a typo, an unsupported string, or incorrect casing) causes assistive technology to either ignore the attribute or announce inaccurate information, misleading users about what will happen when they activate the control.

N/A Tests - Should Not Be Tested

Element without aria-haspopup attribute

Elements without aria-haspopup are not tested

Hidden element with aria-haspopup (display:none)

(Button is hidden via display:none)

Hidden elements are excluded from testing, even with an invalid value

Hidden element with aria-haspopup (visibility:hidden)

(Button is hidden via visibility:hidden)

Visibility hidden elements are not tested

Element with aria-haspopup inside a display:none ancestor

(Button itself has no styles - the parent div is display:none)

Ancestor visibility is inherited - a display:none parent hides the descendant from testing even with an invalid value

Element with aria-haspopup inside a visibility:hidden ancestor

(Button itself has no styles - the parent div is visibility:hidden)

Ancestor visibility is inherited - a visibility:hidden parent hides the descendant from testing

Element with aria-hidden="true" and aria-haspopup

aria-hidden elements are not available to assistive technologies

PASS Tests - ARIA Haspopup Set to a Valid Value

Legacy boolean usage: aria-haspopup="true"

"true" is a valid legacy ARIA 1.0 value - PASSES

Legacy boolean usage: aria-haspopup="false"

"false" explicitly indicates no popup - PASSES

Menu button: aria-haspopup="menu"

Menu button correctly declares it opens a menu - PASSES

Combobox: aria-haspopup="listbox"

Combobox correctly declares it opens a listbox - PASSES

Tree control trigger: aria-haspopup="tree"

Button correctly declares it opens a tree popup - PASSES

Grid trigger: aria-haspopup="grid"

Button correctly declares it opens a grid (e.g. a date picker) - PASSES

Dialog trigger: aria-haspopup="dialog"

Button correctly declares it opens a dialog - PASSES

FAIL Tests - ARIA Haspopup Set to an Invalid Value

Button with empty aria-haspopup value

An empty value is present but is not one of the valid tokens - FAILS

Menu button with typo: aria-haspopup="list"

"list" is not a valid value (should be "menu" or "listbox") - FAILS

Button using unsupported value: aria-haspopup="none"

"none" is not a valid token - should simply omit the attribute or use "false" - FAILS

Button using arbitrary garbage value: aria-haspopup="yes"

"yes" is not part of the enumerated value set - FAILS

Invalid casing: aria-haspopup="True"

Values are case-sensitive - "True" is not the same token as "true" - FAILS

Invalid casing: aria-haspopup="Menu"

Values are case-sensitive - "Menu" is not the same token as "menu" - FAILS

Whitespace-padded value: aria-haspopup=" menu "

Leading/trailing whitespace is not trimmed - value does not exactly match "menu" - FAILS

Legacy numeric/boolean-like typo: aria-haspopup="1"

"1" is not a valid boolean token, should be "true" - FAILS

Non-native widget: div[role="button"] with invalid aria-haspopup

Custom Button

The test applies to any element type, not just native buttons - "invalid" is not a valid token - FAILS

Anchor link: a[href] with invalid aria-haspopup

Products

Nav menu links frequently get aria-haspopup applied - "list" is not a valid token - FAILS

FAIL Tests - Multiple Failures

Two buttons each with a different invalid aria-haspopup value (2 failures)

Both buttons use invalid values - both FAIL (2 failures)

Mix of valid and invalid aria-haspopup values (1 failure)



First button PASSES (valid "menu"), second button FAILS (invalid "list")

Real World Examples

PASS: Properly implemented "File" menu button

Menu button correctly uses aria-haspopup="menu" - PASSES

FAIL: "File" menu button using the wrong token

Developer mistakenly copied "list" instead of "menu" - FAILS

PASS: Autocomplete search box opening a listbox of suggestions

Search combobox correctly declares aria-haspopup="listbox" - PASSES

FAIL: Search box carrying over an ARIA 1.0 boolean-only mindset

Developer used "none" instead of omitting the attribute or using "false" - FAILS

PASS: "Account Settings" button opening a modal dialog

Settings button correctly declares aria-haspopup="dialog" - PASSES

FAIL: "Account Settings" button with incorrect casing

Value "Dialog" does not match the required lowercase token "dialog" - FAILS