本文整理汇总了Python中marionette.marionette.Actions.move方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.move方法的具体用法?Python Actions.move怎么用?Python Actions.move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette.marionette.Actions
的用法示例。
在下文中一共展示了Actions.move方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def send(self, string):
self._switch_to_keyboard()
for val in string:
if ord(val) > 127:
# this would get the right key to long press and switch to the right keyboard
middle_key_val = self._find_key_for_longpress(val.encode('UTF-8'))
self._switch_to_correct_layout(middle_key_val)
# find the key to long press and press it to get the extended characters list
middle_key = self.marionette.find_element(*self._key_locator(middle_key_val))
action = Actions(self.marionette)
action.press(middle_key).wait(2).perform()
# find the targeted extended key to send
target_key = self.marionette.find_element(*self._key_locator(val))
action.move(target_key).release().perform()
else:
# after switching to correct keyboard, tap/click if the key is there
self._switch_to_correct_layout(val)
if self.is_element_present(*self._key_locator(val)):
self._tap(val)
else:
assert False, 'Key %s not found on the keyboard' % val
# after tap/click space key, it might get screwed up due to timing issue. adding 0.8sec for it.
if ord(val) == int(self._space_key):
time.sleep(0.8)
self.marionette.switch_to_frame()
示例2: send
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def send(self, string):
self.switch_to_keyboard()
for val in string:
if ord(val) > 127:
# this would get the right key to long press and switch to the right keyboard
middle_key_val = self._find_key_for_longpress(val.encode('UTF-8'))
self._switch_to_correct_layout(middle_key_val)
# find the key to long press and press it to get the extended characters list
middle_key = self.marionette.find_element(*self._key_locator(middle_key_val))
action = Actions(self.marionette)
action.press(middle_key).wait(1).perform()
# find the targeted extended key to send
self.wait_for_element_displayed(*self._key_locator(val))
target_key = self.marionette.find_element(*self._key_locator(val))
action.move(target_key).release().perform()
else:
# after switching to correct keyboard, tap/click if the key is there
self._switch_to_correct_layout(val)
self._tap(val)
# when we tap on '@' the layout switches to the default keyboard - Bug 996332
if val == '@':
self.wait_for_condition(lambda m: self._layout_page == 0)
self.apps.switch_to_displayed_app()
示例3: switch_keyboard_language
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def switch_keyboard_language(self, lang_code):
keyboard_language_locator = (By.CSS_SELECTOR, ".keyboard-row button[data-keyboard='%s']" % lang_code)
self.switch_to_keyboard()
language_key = self.marionette.find_element(*self._language_key_locator)
action = Actions(self.marionette)
action.press(language_key).wait(1).perform()
target_kb_layout = self.marionette.find_element(*keyboard_language_locator)
action.move(target_kb_layout).release().perform()
self.marionette.switch_to_frame()
示例4: _flick_menu_down
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def _flick_menu_down(self, locator):
current_element = self.marionette.find_element(*self._current_element(*locator))
next_element = self.marionette.find_element(*self._next_element(*locator))
# TODO: update this with more accurate Actions
action = Actions(self.marionette)
action.press(current_element)
action.move(next_element)
action.release()
action.perform()
示例5: _flick_menu_up
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def _flick_menu_up(self, locator):
self.wait_for_element_displayed(*self._current_element(*locator))
current_element = self.marionette.find_element(*self._current_element(*locator))
next_element = self.marionette.find_element(*self._next_element(*locator))
#TODO: update this with more accurate Actions
action = Actions(self.marionette)
action.press(next_element)
action.move(current_element)
action.release()
action.perform()
示例6: switch_keyboard_language
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def switch_keyboard_language(self, lang_code):
# TODO At the moment this doesn't work because the UI has changed
# An attempted repair ran into https://bugzilla.mozilla.org/show_bug.cgi?id=779284 (Modal dialog)
keyboard_language_locator = (By.CSS_SELECTOR, ".keyboard-row button[data-keyboard='%s']" % lang_code)
self.switch_to_keyboard()
language_key = self.marionette.find_element(*self._language_key_locator)
action = Actions(self.marionette)
action.press(language_key).wait(1).perform()
target_kb_layout = self.marionette.find_element(*keyboard_language_locator)
action.move(target_kb_layout).release().perform()
self.apps.switch_to_displayed_app()
示例7: choose_extended_character
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def choose_extended_character(self, long_press_key, selection, movement=True):
self.switch_to_keyboard()
action = Actions(self.marionette)
# after switching to correct keyboard, set long press if the key is there
self._switch_to_correct_layout(long_press_key)
self.wait_for_element_displayed(*self._key_locator(long_press_key))
key = self.marionette.find_element(*self._key_locator(long_press_key))
action.press(key).wait(1).perform()
# find the extended key and perform the action chain
extend_keys = self.marionette.find_elements(*self._highlight_key_locator)
if movement is True:
action.move(extend_keys[selection - 1]).perform()
action.release().perform()
self.apps.switch_to_displayed_app()
示例8: choose_extended_character
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def choose_extended_character(self, long_press_key, selection, movement=True):
self.switch_to_keyboard()
action = Actions(self.marionette)
# after switching to correct keyboard, set long press if the key is there
self._switch_to_correct_layout(long_press_key)
try:
key = self.marionette.find_element(*self._key_locator(long_press_key))
self.wait_for_condition(lambda m: key.is_displayed)
except:
raise Exception("Key %s not found on the keyboard" % long_press_key)
action.press(key).wait(1).perform()
# find the extended key and perform the action chain
extend_keys = self.marionette.find_elements(*self._highlight_key_locator)
if movement is True:
action.move(extend_keys[selection - 1]).perform()
action.release().perform()
self.marionette.switch_to_frame()
示例9: choose_extended_character
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def choose_extended_character(self, long_press_key, selection, movement=True):
self._switch_to_keyboard()
action = Actions(self.marionette)
# after switching to correct keyboard, set long press if the key is there
self._switch_to_correct_layout(long_press_key)
key = self._key_locator(long_press_key)
if self.is_element_present(*key):
keyobj = self.marionette.find_element(*key)
action.press(keyobj).wait(2).perform()
else:
assert False, 'Key %s not found on the keyboard' % long_press_key
# find the extended key and perform the action chain
extend_keys = self.marionette.find_elements(*self._highlight_key_locator)
if movement is True:
action.move(extend_keys[selection - 1]).perform()
action.release().perform()
time.sleep(1)
self.marionette.switch_to_frame()
示例10: send
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import move [as 别名]
def send(self, string):
self.switch_to_keyboard()
for val in string:
if ord(val) > 127:
# this would get the right key to long press and switch to the right keyboard
middle_key_val = self._find_key_for_longpress(val.encode('UTF-8'))
self._switch_to_correct_layout(middle_key_val)
# find the key to long press and press it to get the extended characters list
middle_key = self.marionette.find_element(*self._key_locator(middle_key_val))
action = Actions(self.marionette)
action.press(middle_key).wait(1).perform()
# find the targeted extended key to send
target_key = self.marionette.find_element(*self._key_locator(val))
action.move(target_key).release().perform()
else:
# after switching to correct keyboard, tap/click if the key is there
self._switch_to_correct_layout(val)
self._tap(val)
self.marionette.switch_to_frame()