test_2_filters.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:varapp-backend-py 作者: varapp 项目源码 文件源码
def move_slider(self, slider, offset=0.0):
        """Click somewhere in an horizontal slider. The position is given in fraction
           of its width: *offset* from 0 to 1."""
        width = slider.size['width']
        action_chains = ActionChains(self.driver)
        # Move to the middle of the slider (default), then to its leftmost point
        action_chains.move_to_element(slider).move_by_offset(-width/2.0, 0)
        # Double-click twice to know where the cursor is.
        #action_chains.context_click().context_click()
        # Need to perform() because it seems to bug with move_by_offset otherwise
        action_chains.perform()
        # Offset to the right
        action_chains.move_by_offset(width * offset, 0)
        # Double-click twice to know where the cursor is
        #action_chains.context_click().context_click()
        action_chains.click().perform()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号