本文整理汇总了Python中marionette.marionette.Actions.perform方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.perform方法的具体用法?Python Actions.perform怎么用?Python Actions.perform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette.marionette.Actions
的用法示例。
在下文中一共展示了Actions.perform方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _flick_to_image
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [as 别名]
def _flick_to_image(self, direction):
action = Actions(self.marionette)
current_image = self.marionette.find_element(*self._current_image_locator)
current_image_move_x = current_image.size["width"] / 2
current_image_mid_x = current_image.size["width"] / 2
current_image_mid_y = current_image.size["height"] / 2
if direction == "next":
action.flick(
current_image,
current_image_mid_x,
current_image_mid_y,
current_image_mid_x - current_image_move_x,
current_image_mid_y,
)
else:
action.flick(
current_image,
current_image_mid_x,
current_image_mid_y,
current_image_mid_x + current_image_move_x,
current_image_mid_y,
)
action.perform()
self.wait_for_element_displayed(*self._current_image_locator)
示例2: move_slider
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [as 别名]
def move_slider(self, slider, dir_x):
scale = self.marionette.find_element(*slider)
finger = Actions(self.marionette)
finger.press(scale)
finger.move_by_offset(dir_x, 0)
finger.release()
finger.perform()
time.sleep(2)
示例3: _flick_menu_down
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [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()
示例4: _flick_menu_up
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [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()
示例5: _flick_to_month
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [as 别名]
def _flick_to_month(self, direction):
"""Flick current monthly calendar to next or previous month.
@param direction: flick to next month if direction='next', else flick to previous month
"""
action = Actions(self.marionette)
current_monthly_calendar = self.marionette.find_element(*self._current_monthly_calendar_locator)
flick_origin_x = current_monthly_calendar.size['width'] // 2
flick_origin_y = current_monthly_calendar.size['height'] // 2
flick_destination_x = 0 if direction == 'next' else 2 * flick_origin_x
action.flick(current_monthly_calendar, flick_origin_x, flick_origin_y,
flick_destination_x, flick_origin_y)
action.perform()
示例6: double_tap_image
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import perform [as 别名]
def double_tap_image(self):
image = self.marionette.find_element(*self._current_image_locator)
action = Actions(self.marionette)
action.double_tap(image)
action.perform()