Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

rahimabdi
Copy link
Contributor

Initial PR to address keyboard accessibility utils for accessibility-focused WPT tests: web-platform-tests/interop-accessibility#101

@rahimabdi rahimabdi requested review from boazsender and zcorpan and removed request for boazsender and zcorpan February 1, 2024 08:30
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rahimabdi rahimabdi changed the title Create /common/keyboard-accessibility-utils.js Create /common/keyboard-utils.js Feb 1, 2024
@rahimabdi rahimabdi changed the title Create /common/keyboard-utils.js Create keyboard testing utilities (/common/keyboard-utils.js) Feb 1, 2024
@jugglinmike
Copy link
Contributor

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.

@rahimabdi
Copy link
Contributor Author

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
Copy link
Contributor Author

rahimabdi commented Feb 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants