[QA] Is it possible to send actual keypresses instead of strings?

Amir E. Aharoni amir.aharoni at mail.huji.ac.il
Thu Sep 12 15:25:21 UTC 2013


2013/9/12 Nikolas Everett <neverett at wikimedia.org>
>
> I'm not sure sending the actual keys would be all the productive any
> way unless visual editor itself (not the operating system) is doing
> something special with keypresses for that language.  From my somewhat
> limited experience with Japanese typing is handled by programs outside
> the browser that drop characters into it once you've decided that they
> are correct.  You'd be testing an operating system feature.


I want to test that this operating system feature behaves nicely with
the VisualEditor.

>
> Worse
> yet, in the example of Japanese there are (at least) two keyboard
> layout techniques that translate my familiar American keyboard into
> Japanese, one based on English phonetics (mostly two strokes per
> hiragana character) and one designed for mostly single stroke per
> hiragana character.


Yes, probably even more than two, and I want to test them all. Yes,
it's ambitious :)

>
> You still need other key presses to change the
> hiragana to katakana or the particular kanji that you meant but the
> problem remains - when you do send_key :a_key which keyboard layout do
> you mean to use?


I plan to have tests for all of them Some Day. How exactly? - That's a
topic for another thread.

>
> When you want to select kanji from the list is it
> two presses of the "squash" character to turn your hiragana to the
> kanji you want or three?


I want to test all input methods, and I want to test the whole
process, including selecting one of the proposed spellings with arrows
and other keys. Ironically, it looks like simulating arrow keys is
easily supported out of the box according to [1], but not the letter
keys, but I may be missing something - that's what my main question in
this thread is.

>
>
> I can certainly see us wanting to make sure that, for example, the
> squashing process used to build kanji doesn't cause visual editor to
> go crazy and throw characters on different lines while the user picks
> from their list, but for the most part questions like did sending the
> sequence "w a t a s i h a <squash>" spit out "私は" is the operating
> systems problem.


See bug https://bugzilla.wikimedia.org/52716 for an example: The
resulting characters may be correct (or not), but there's also the
question of cursor placement and other possible issues. That bug is
fixed, but I want to make sure we have a regression test and of course
other bugs may pop up.

[1] http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver/Keys.html#KEYS-constant

--
Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
http://aharoni.wordpress.com
‪“We're living in pieces,
I want to live in peace.” – T. Moore‬



More information about the QA mailing list