本文整理汇总了Python中marionette.marionette.Actions.flick方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.flick方法的具体用法?Python Actions.flick怎么用?Python Actions.flick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette.marionette.Actions
的用法示例。
在下文中一共展示了Actions.flick方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _flick_to_image
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import flick [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: _flick_to_image
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import flick [as 别名]
def _flick_to_image(self, direction):
image = self.marionette.find_element(*self._current_image_locator)
action = Actions(self.marionette)
x_start = (image.size["width"] / 100) * (direction == "next" and 90 or 10)
x_end = (image.size["width"] / 100) * (direction == "next" and 10 or 90)
y_start = image.size["height"] / 4
y_end = image.size["height"] / 4
action.flick(image, x_start, y_start, x_end, y_end, 200).perform()
Wait(self.marionette).until(lambda m: abs(image.location["x"]) >= image.size["width"])
示例3: _flick_to_month
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import flick [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()
示例4: _flick_to_month
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import flick [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)
month = self.marionette.find_element(
*self._current_monthly_calendar_locator)
month_year = self.current_month_year
x_start = (month.size['width'] / 100) * (direction == 'next' and 90 or 10)
x_end = (month.size['width'] / 100) * (direction == 'next' and 10 or 90)
y_start = month.size['height'] / 4
y_end = month.size['height'] / 4
action.flick(month, x_start, y_start, x_end, y_end, 200).perform()
Wait(self.marionette).until(lambda m: self.current_month_year != month_year)
示例5: test_edge_gestures
# 需要导入模块: from marionette.marionette import Actions [as 别名]
# 或者: from marionette.marionette.Actions import flick [as 别名]
def test_edge_gestures(self):
'''
Test swiping between apps with edge gestures
As this is non-default (ie pref set) Gaia behaviour I have eschewed app objects
'''
# Swipe to the left on the displayed frame
displayed_frame = self.apps.displayed_app.frame
action = Actions(self.marionette)
action.flick(displayed_frame, 0, 100, -200, 0, 50).perform()
self.wait_for_condition(lambda m: self.apps.displayed_app.name == self._apps_under_test[0])
# Swipe to the right
displayed_frame = self.apps.displayed_app.frame
action = Actions(self.marionette)
action.flick(displayed_frame, displayed_frame.size['width'], 100, 200, 0, 50).perform()
self.wait_for_condition(lambda m: self.apps.displayed_app.name == self._apps_under_test[1])