Keyboard

class gaiatest.apps.keyboard.app.Keyboard(marionette)[source]

Bases: gaiatest.apps.base.Base

There are two underlying strategies in this class;

  • send() method which uses logic to traverse the keyboard to type the string sent to it. Send should be used in tests where the layout of the keyboard is not tested and only string input is important
  • tap_x() or anything not send() methods which do not use logic to change keyboard panels. Tap should be used where the keyboard is expected to open with that key visible

The methods in this class employ a lot of aggressive frame switching to the keyboard and back to the displayed app because it predominantly acts as a utility class and thus it works best when the main focus of the test is on the web app rather than the keyboard itself.

a11y_backspace_key_name
a11y_backspace_key_role
a11y_candidate_panel_name
a11y_dismiss_suggestions_button_name
a11y_dismiss_suggestions_button_role
a11y_enter_key_name
a11y_enter_key_role
a11y_first_predictive_word_click()[source]
a11y_first_predictive_word_name
a11y_first_predictive_word_role
a11y_space_key_name
a11y_space_key_role
a11y_suggestions_container_role
choose_extended_character(long_press_key, selection, movement=True)[source]
current_keyboard
dismiss()[source]
enable_caps_lock()[source]
is_keyboard_displayed
keyboard_table = ['english', 'dvorak', 'otherlatins', 'cyrillic', 'arabic', 'hebrew', 'zhuyin', 'pinyin', 'greek', 'japanese', 'portuguese', 'spanish']
lookup_table = {'!': '\xc2\xa1', '$': '\xe2\x82\xac\xc2\xa3\xc2\xa5', '0': '\xc2\xba', '?': '\xc2\xbf', 'A': '\xc3\x81\xc3\x80\xc3\x82\xc3\x84\xc3\x85\xc3\x83\xc4\x80\xc3\x86', 'C': '\xc3\x87\xc4\x86\xc4\x8c', 'E': '\xc3\x89\xc3\x88\xc3\x8a\xc3\x8b\xc4\x92\xc4\x98\xe2\x82\xac\xc6\x90', 'I': '\xc4\xae\xc4\xaa\xc3\x8e\xc3\x8c\xc3\x8d\xc3\x8f', 'L': '\xc2\xa3\xc5\x81', 'O': '\xc6\x9f\xc3\x98\xc5\x92\xc5\x8c\xc3\x94\xc3\x92\xc3\x93\xc3\x96', 'N': '\xc5\x83\xc3\x91', 'S': '\xc5\x9a\xc5\xa0\xc5\x9e', 'U': '\xc5\xaa\xc3\x9b\xc3\x99\xc3\x9a\xc3\x9c', 'Y': '\xc2\xa5\xc5\xb8', 'Z': '\xc5\xbd\xc5\xb9\xc5\xbb', 'a': '\xc3\xa1\xc3\xa0\xc3\xa2\xc3\xa4\xc3\xa5\xc3\xa3\xc4\x81\xc3\xa6', 'c': '\xc3\xa7\xc4\x87\xc4\x8d', 'e': '\xc3\xa9\xc3\xa8\xc3\xaa\xc3\xab\xc4\x93\xc4\x99\xe2\x82\xac\xc9\x9b', 'i': '\xc4\xaf\xc4\xab\xc3\xae\xc3\xac\xc3\xad\xc3\xaf', 'l': '\xc2\xa3\xc5\x82', 'o': '\xc9\xb5\xc3\xb8\xc5\x93\xc5\x8d\xc3\xb4\xc3\xb2\xc3\xb3\xc3\xb6', 'n': '\xc5\x84\xc3\xb1', 's': '\xc3\x9f\xc5\x9b\xc5\xa1$', 'u': '\xc5\xab\xc3\xbb\xc3\xb9\xc3\xba\xc3\xbc', 'y': '\xc2\xa5\xc3\xbf', 'z': '\xc5\xbe\xc5\xba\xc5\xbc'}
name = 'Keyboard'
send(string)[source]
switch_keyboard_language(lang_code)[source]
switch_to_keyboard(focus=False)[source]
tap_backspace()[source]
tap_dotcom()[source]
tap_enter()[source]
tap_first_predictive_word()[source]
tap_keyboard_language_key()[source]
tap_shift()[source]
tap_space()[source]
tap_suggestion(word)[source]