当前位置: 首页>>代码示例>>Python>>正文


Python Actions.perform方法代码示例

本文整理汇总了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)
开发者ID:jingmeizhang,项目名称:gaia,代码行数:29,代码来源:fullscreen_image.py

示例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)
开发者ID:,项目名称:,代码行数:10,代码来源:

示例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()
开发者ID:pcheng13,项目名称:gaia-ui-tests,代码行数:12,代码来源:alarm.py

示例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()
开发者ID:Bharatpattani,项目名称:gaia,代码行数:13,代码来源:alarm.py

示例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()
开发者ID:Sob40,项目名称:gaia,代码行数:17,代码来源:app.py

示例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()
开发者ID:AlexSJ,项目名称:gaia,代码行数:7,代码来源:fullscreen_image.py


注:本文中的marionette.marionette.Actions.perform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。