wpt icon indicating copy to clipboard operation
wpt copied to clipboard

Create keyboard testing utilities (/common/keyboard-utils.js)

Open rahimabdi opened this issue 1 year ago • 3 comments

Initial PR to address keyboard accessibility utils for accessibility-focused WPT tests: https://github.com/web-platform-tests/interop-accessibility/issues/101

rahimabdi avatar Feb 01 '24 07:02 rahimabdi

This resembles some utilities that have recently been introduced for testing accessibility primitives. Since we're currently combatting some technical debt in that initial design, it may be wise to address those concerns here in this introductory patch before tests begin to rely on it.

jugglinmike avatar Feb 01 '24 18:02 jugglinmike

Is it normal for utilities to actually be test function wrappers? That seems a bit weird to me.

I would expect that to more clearly show up in the name of the functions you call.

E.g., test_elements_are_focusable instead of verifyElementsAreFocusable.

I sought to align with aria-utils.js to make test creation easier. @cookiecrook Thoughts?

rahimabdi avatar Feb 03 '24 23:02 rahimabdi

This resembles some utilities that have recently been introduced for testing accessibility primitives. Since we're currently combatting some technical debt in that initial design, it may be wise to address those concerns here in this introductory patch before tests begin to rely on it.

Thanks for bringing attention to this, @jugglinmike! There's an additional argument for both verifyRole..() and verifyLabels...()that was introduced in aria-utils.js as part of the display: contents test. The new verifyRolesAndLabelsBySelector() method specifies a test prefix, and calls the role/label function, to ensure unique test names for what is really a single test function that tests both role/label together.

It sounds like the subtest count PR might be blocking for this one, right? Tagging @cookiecrook for input and thoughts on direction.

rahimabdi avatar Feb 03 '24 23:02 rahimabdi