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


Python GaiaImageCompareTestCase.pinch方法代码示例

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


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

示例1: orientation_zoom_check

# 需要导入模块: from gaiatest.gaia_graphics_test import GaiaImageCompareTestCase [as 别名]
# 或者: from gaiatest.gaia_graphics_test.GaiaImageCompareTestCase import pinch [as 别名]
    def orientation_zoom_check(self):

        self.push_resource(self.images, count=self.image_count)

        self.take_screenshot()
        # flick image, change orientation, pinch zoom, change orientation
        # launch gallery, load image.
        gallery = Gallery(self.marionette)
        gallery.launch()
        gallery.wait_for_files_to_load(self.image_count)

        self.assertEqual(gallery.gallery_items_number, self.image_count)

        # Tap first image to open full screen view.
        image = gallery.tap_first_gallery_item()
        self.assertIsNotNone(image.current_image_source)
        self.assertTrue(image.is_photo_toolbar_displayed)

        # scroll back and forth in different display mode
        self.change_orientation('landscape-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        400, locator=image._current_image_locator)

        self.change_orientation('portrait-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        400, locator=image._current_image_locator)

        # flip A LOT
        for x in range(0, 4):
            self.change_orientation('landscape-primary')
            self.change_orientation('portrait-primary')
        self.take_screenshot()

        # do pinch zoom while flipping the phone
        GaiaImageCompareTestCase.pinch(self.marionette, image._current_frame_locator, 'in', 20)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        300, locator=image._current_image_locator)
        self.take_screenshot()
        self.change_orientation('landscape-primary')
        GaiaImageCompareTestCase.pinch(self.marionette, image._current_frame_locator, 'out', 50)
        self.take_screenshot()
        self.change_orientation('portrait-primary')

        image.double_tap_image()
        self.take_screenshot(prewait=3) #takes time for zoom-in action to complete

        # go back and forth with flicking then exit gallery app
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        150, locator=image._current_frame_locator)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        150, locator=image._current_frame_locator)
        self.take_screenshot()
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:60,代码来源:orientation_zoom_base.py


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