Re-enable test_uppercase_alpha_keys test

NEW
Unassigned

Status

defect
P2
normal
5 years ago
a year ago

People

(Reporter: automatedtester, Unassigned)

Tracking

(Depends on 1 bug, Blocks 1 bug, {pi-marionette-server, pi-marionette-task})

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

5 years ago
In fixing bug 947490 I switched all the typing tests on but this test had to be disabled and we need to re enable it.
I assume the issue here is that we do not yet check if the character is shifted or not:
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-shifted-character

At least I cannot find any check for that like in the `action.Key` class. There is only the KEY_CODE_LOOKUP table in `action.js`, but that doesn't set the relationship between a lowercase or uppercase character.

https://dxr.mozilla.org/mozilla-central/rev/f41930a869a84af81df1a88d8e82323ff3a6509a/testing/marionette/action.js#181-182

Maja, since you implemented the action sequences, do you know more about that? Maybe I miss something?
Flags: needinfo?(mjzffr)
The "shifted character" comment in the spec is new relative to the implementation in action.js -- feel free to add another map to keep track of shifted status.

Right now, if an uppercase key value is passed in an actions sequence, action.js sets the "key", "code", "location" properties, and  event.js determines the correct keyCode+charCode when constructing the event, but the shift property is left as is. (That is, we don't set shift to "true" on the event object as a result of seeing an action for "keydown"+"A".) I'm not sure the resulting event is considered well-formed. I can imagine a device that sends uppercase keys without any form of "shift" being pressed, in which case such an event would make sense. The UIEvents spec explains that the key/code/modifier values are device-dependent, so I guess that's okay? 

In any case, in actions the shift property of the event is only changed to true if the sequence actually includes a "keydown" action for "shift". That's consistent with what is specified in the Webdriver spec re sendKeys: in https://w3c.github.io/webdriver/webdriver-spec.html#element-send-keys, it sounds like you need to add {"type": "keydown", "value":<shift key>} to the action sequence being constructed every time an uppercase key is encountered in the input to sendKeys.
Flags: needinfo?(mjzffr)
This seems like a potential conformance issue.
Blocks: webdriver
OS: Mac OS X → All
Priority: -- → P2
Hardware: x86 → All
Version: unspecified → Trunk
We only have to fix this once, for the actions API, if we fix bug 1418995 first.
Depends on: 1418995
Summary: testUppercaseAlphaKeys needs to be re enabled → Re-enable test_uppercase_alpha_keys test
You need to log in before you can comment on or make changes to this bug.