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


Python Actions.perform方法代码示例

本文整理汇总了Python中marionette_driver.marionette.Actions.perform方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.perform方法的具体用法?Python Actions.perform怎么用?Python Actions.perform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在marionette_driver.marionette.Actions的用法示例。


在下文中一共展示了Actions.perform方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: edge_scroll

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
    def edge_scroll(self, frame, direction, dist, release=True):
        """edge scroll - performs task switching action.

        direction = 'LtoR' or 'RtoL' (finger movement direction)
        dist = percentage of horizontal distance travel, max is 1.0
        release = if set to False, the Action object will be returned so the user can complete the release action"""

        start_x = 0
        dist_travelled = 0
        time_increment = 0.01

        if dist > 1:
            dist = 1
        if direction == 'LtoR':
            start_x = 0
        elif direction == 'RtoL':
            start_x = frame.size['width']
            dist *= -1  # travel opposite direction

        limit = dist * frame.size['width']
        dist_unit = limit * time_increment

        action = Actions(self.marionette)
        action.press(frame, start_x, frame.size['height'] / 2)  # press either the left or right edge

        while abs(dist_travelled) < abs(limit):
            action.move_by_offset(dist_unit, 0)
            action.wait(time_increment)
            dist_travelled += dist_unit
        if release:
            action.release()
        action.perform()

        return action
开发者ID:Anirudh0,项目名称:gaia,代码行数:36,代码来源:gaia_graphics_test.py

示例2: move_seek_slider

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
 def move_seek_slider(self, offset):
     scale = self.marionette.find_element(*self._video_seek_head_locator)
     finger = Actions(self.marionette)
     finger.press(scale)
     finger.move_by_offset(offset, 0)
     finger.release()
     finger.perform()
开发者ID:adrm,项目名称:gaia,代码行数:9,代码来源:fullscreen_video.py

示例3: wait_with_value

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
def wait_with_value(marionette, wait_for_condition, expected):
    testAction = marionette.absolute_url("testAction.html")
    marionette.navigate(testAction)
    button = marionette.find_element(By.ID, "button1")
    action = Actions(marionette)
    action.press(button).wait(0.01).release()
    action.perform()
    wait_for_condition_else_raise(marionette, wait_for_condition, expected, "return document.getElementById('button1').innerHTML;")
开发者ID:luke-chang,项目名称:gecko-1,代码行数:10,代码来源:single_finger_functions.py

示例4: move_slider

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.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:AndersonFurlane,项目名称:gaia,代码行数:10,代码来源:edit_picture_base.py

示例5: move_element_offset

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
def move_element_offset(marionette, wait_for_condition, expected1, expected2):
    testAction = marionette.absolute_url("testAction.html")
    marionette.navigate(testAction)
    ele = marionette.find_element(By.ID, "button1")
    action = Actions(marionette)
    action.press(ele).move_by_offset(0,150).move_by_offset(0, 150).release()
    action.perform()
    wait_for_condition_else_raise(marionette, wait_for_condition, expected1, "return document.getElementById('button1').innerHTML;")
    wait_for_condition_else_raise(marionette, wait_for_condition, expected2, "return document.getElementById('button2').innerHTML;")
开发者ID:luke-chang,项目名称:gecko-1,代码行数:11,代码来源:single_finger_functions.py

示例6: press_release

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
def press_release(marionette, times, wait_for_condition, expected):
    testAction = marionette.absolute_url("testAction.html")
    marionette.navigate(testAction)
    action = Actions(marionette)
    button = marionette.find_element(By.ID, "button1")
    action.press(button).release()
    # Insert wait between each press and release chain.
    for _ in range(times-1):
        action.wait(0.1)
        action.press(button).release()
    action.perform()
    wait_for_condition_else_raise(marionette, wait_for_condition, expected, "return document.getElementById('button1').innerHTML;")
开发者ID:luke-chang,项目名称:gecko-1,代码行数:14,代码来源:single_finger_functions.py

示例7: context_click

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
 def context_click(self):
     action = Actions(driver)
     action.context_click(self)
     action.perform()
开发者ID:palant,项目名称:searchlinkfix,代码行数:6,代码来源:run_tests.py

示例8: middle_click

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
 def middle_click(self):
     action = Actions(driver)
     action.middle_click(self)
     action.perform()
开发者ID:palant,项目名称:searchlinkfix,代码行数:6,代码来源:run_tests.py

示例9: click

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.marionette.Actions import perform [as 别名]
 def click(self):
     action = Actions(driver)
     action.click(self)
     action.perform()
开发者ID:palant,项目名称:searchlinkfix,代码行数:6,代码来源:run_tests.py

示例10: double_tap_image

# 需要导入模块: from marionette_driver.marionette import Actions [as 别名]
# 或者: from marionette_driver.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:Anirudh0,项目名称:gaia,代码行数:7,代码来源:fullscreen_image.py


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