[Webkit-unassigned] [Bug 273843] New: Support: Shift + Tab keys for test_driver.send_keys()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 7 14:43:09 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=273843

            Bug ID: 273843
           Summary: Support: Shift + Tab keys for test_driver.send_keys()
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Keywords: InRadar
          Severity: Normal
          Priority: P2
         Component: WebDriver
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jcraig at apple.com
                CC: bburg at apple.com

Rahim wrote the following. I'm filing on his behalf.

---------------------------------------------------------

I currently working on a Web Platform Tests (WPT) pull request for adding keyboard testing to WPT’s common utils: https://github.com/web-platform-tests/wpt/pull/44347. This will allow us to include keyboard tests as part of Accessibility Interop work: https://github.com/web-platform-tests/interop-accessibility.

One of the keyboard testing functions I’ve written in the proposed wpt/common/keyboard-utils.js file is verifyElementsDoNotCauseKeyboardTrap() which given a focusable test element, confirms that keyboard focus can be moved away from (via Shift + Tab), and back to (via Tab), the focusable test element.

In keyboard-utils.js, I’ve set up a “keys” object:

===================
const keys = {
  // See WebDriver key codepoints: https://w3c.github.io/webdriver/#keyboard-actions
  "LeftShiftAndTab": "\uE008" + "\uE004", // Left Shift = \uE008 and Right Shift = \uE050 however, they should be indistinguishable
  "Tab": "\uE004",
};
===================

And when I want to move focus away from the tested element in my verifyElementsDoNotCauseKeyboardTrap() function:

===================
await test_driver.send_keys(el, keys.LeftShiftAndTab); 
===================

It appears that both Chromium/Gecko’s test_driver.send_keys() implementations support a Shift + Tab concurrent key press however, my WebKit tests for this function fail due to lack of support for sending Shift and Tab keys simultaneously. I’ve tried the codepoints for both Left Shift ( \uE008) and Right Shift (\uE050) in combination with Tab (\uE004) and both fail in only WebKit. Please see the attached test results for Chrome and Safari (Firefox’s results all pass like Chrome so I haven’t included it).

I see this resolved bug addressing modifier key support in our testdriver-vendor.js so perhaps it’s only the Shift key that’s not supported as a modifier: https://bugs.webkit.org/show_bug.cgi?id=221465.

*Note: In my PR (https://github.com/web-platform-tests/wpt/pull/44347), I’ve temporarily added some tests in wpt/accessibility/keyboard/keyboard-utils-test.html for quick testing; however, this test file will not be checked in but can be used to test the verifyElementsDoNotCauseKeyboardTrap() function across engines.

I’m testing my function with the keyboard-utils-test.html file by running the following WPT CLI command for each browser:
- Safari = ./wpt run --log-mach-level debug --log-mach - --webdriver-arg="--diagnose" safari <local path to keyboard-utils-test.html>

- Chrome = ./wpt run --log-mach-level debug --log-mach - --webdriver-arg="--diagnose" chrome <local path to keyboard-utils-test.html> 

- Firefox = ./wpt run --log-mach-level debug --log-mach - --webdriver-arg="--diagnose" firefox <local path to keyboard-utils-test.html>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240507/9c19e980/attachment.htm>


More information about the webkit-unassigned mailing list