本文整理汇总了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()