Add tests for object inspector keyboard navigation in console
Categories
(DevTools :: Console, task, P3)
Tracking
(Not tracked)
People
(Reporter: yzen, Unassigned, Mentored)
References
Details
Bug 1424159 fixed the issue with keyboard a11y in console trees but we also need to add a test to not regress.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Hey! As suggested, it would be great if I get to contribute here.
Thank you!
Dhruvi
Reporter | ||
Comment 2•5 years ago
|
||
Hi Dhruvi,
Here are some details:
The code changes that we want to test can be found in this patch:
https://phabricator.services.mozilla.com/D18592
What this change does is that it makes the object that is printed in the console keyboard accessible. Here's an example of steps to reproduce:
- Open this url:
data:text/html,<script>console.log({foo:"bar"});</script>
- Open developer tools and the console panel
- Notice that the last printed item in the console looks something like this:
Object { foo: "bar" }
- You probably need to press
Shift + Tab
twice until that item is highlighted (focused). - Once focused you can operate the object using Arrow keys: ArrowRight/ArrowLeft will expand/collapse tree items, ArrowUp/ArrowDown will change which tree item in the object tree is currently active.
This is essentially what we would want to test.
You can create a new file in: devtools/client/webconsole/test/mochitest
and call it something like browser_webconsole_grip_keyboard_accessibility.js
You can look at some examples of how similar tests are written in:
devtools/client/webconsole/test/mochitest/browser_webconsole_keyboard_accessibility.js
devtools/client/webconsole/test/mochitest/browser_webconsole_object_inspector_entries.js
Please feel free to ask any questions!
Thanks!
Comment 3•5 years ago
|
||
Hey! I was trying an initial test to see what output do I get and what to exactly expect but on running the test I faced the following error :
./mach test devtools/client/webconsole/test/mochitest/browser_webconsole_grip_keyboard_accessibility.js
UNKNOWN TEST: devtools/client/webconsole/test/mochitest/browser_webconsole_grip_keyboard_accessibility.js
I was unable to find tests from the given argument(s).
You should specify a test directory, filename, test suite name, or
abbreviation. If no arguments are given, there must be local file
changes and corresponding IMPACTED_TESTS annotations in moz.build
files relevant to those files.
It's possible my little brain doesn't know about the type of test you are
trying to execute. If you suspect this, please request support by filing
a bug at
https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=General.
I tried looking at moz.build but it did not seem to clear anything. For the initial test, I just added some Test URI and everything from the two already written test suggested.
Thank you,
Dhruvi
Comment 4•5 years ago
|
||
Hello Dhruvi,
The test file should be referenced in devtools/client/webconsole/test/mochitest/browser.ini
. Then you'll be able to run it.
Comment 5•5 years ago
|
||
Hey! For focussing onto Object I need to give tab + shift using synthesizeKeyShortcut(). But I am not able to understand what parameters to pass here and how to focus on that object. Is this the right way to focus on the object? As I see
synthesizeKeyShortcut(clearShortcut) is used to give commands while the tests running.
Thank you,
Dhruvi
Comment 6•5 years ago
|
||
Hello Dhruvi, sorry I missed your question!
Make sure to use the needinfo
field when you ask something so it's not lost in the bugmails :)
You can use EventUtils.synthesizeKey("KEY_Tab", {shiftKey: true});
to do a Shift + Tab in a test. Hope it helps!
Updated•5 years ago
|
Reporter | ||
Comment 7•5 years ago
|
||
(In reply to Dhruvi Butti from comment #5)
Hey! For focussing onto Object I need to give tab + shift using synthesizeKeyShortcut(). But I am not able to understand what parameters to pass here and how to focus on that object. Is this the right way to focus on the object? As I see
synthesizeKeyShortcut(clearShortcut) is used to give commands while the tests running.
Thank you,
Dhruvi
Hi Dhruvi, also could you check the "Need more information from" checkbox when you comment/ask a question (at the bottom of the bug), selecting me or Nicolas using the search in the input field. Otherwise we will probably miss your comment. Thanks!
Comment 8•5 years ago
|
||
Hi Dhruvi: just checking if you need more time to work on this bug, which is fine.
If you, however, do not plan on working on this anymore, please let us know so the bug can be made available for others to claim.
Comment 9•5 years ago
|
||
Unassigning the bug now
Updated•5 years ago
|
Comment 10•2 years ago
|
||
Hello,
I would be happy to work on this.
Thank you,
Colin
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•