本文整理汇总了Python中gaiatest.apps.gallery.app.Gallery.switch_to_camera方法的典型用法代码示例。如果您正苦于以下问题:Python Gallery.switch_to_camera方法的具体用法?Python Gallery.switch_to_camera怎么用?Python Gallery.switch_to_camera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.gallery.app.Gallery
的用法示例。
在下文中一共展示了Gallery.switch_to_camera方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestEnduranceGalleryCamera
# 需要导入模块: from gaiatest.apps.gallery.app import Gallery [as 别名]
# 或者: from gaiatest.apps.gallery.app.Gallery import switch_to_camera [as 别名]
class TestEnduranceGalleryCamera(GaiaEnduranceTestCase):
def setUp(self):
GaiaEnduranceTestCase.setUp(self)
# Turn off geolocation prompt
self.apps.set_permission('Camera', 'geolocation', 'deny')
# add photo to storage
self.push_resource('IMG_0001.jpg')
self.gallery = Gallery(self.marionette)
self.gallery.launch()
self.gallery.wait_for_files_to_load(1)
def test_endurance_gallery_camera(self):
self.drive(test=self.gallery_camera, app='gallery')
def gallery_camera(self):
# Test requested per bug 851626:
# 1. open the Gallery app
# 2. when the UI/Camera button appears, tap it to switch to the camera
# 3. when the UI/Gallery button appears, tap it to switch back to the gallery
# 4. repeat steps 2 and 3 until *crash*
time.sleep(3)
# From gallery app, switch to camera app
self.camera = self.gallery.switch_to_camera()
time.sleep(3)
# From camera app, switch back to gallery again
self.gallery = self.camera.tap_switch_to_gallery()
self.gallery.wait_for_files_to_load(1)
self.assertTrue(self.gallery.are_gallery_items_displayed)
示例2: test_gallery_view
# 需要导入模块: from gaiatest.apps.gallery.app import Gallery [as 别名]
# 或者: from gaiatest.apps.gallery.app.Gallery import switch_to_camera [as 别名]
def test_gallery_view(self):
"""
https://moztrap.mozilla.org/manage/case/2309/
"""
gallery = Gallery(self.marionette)
gallery.launch()
gallery.wait_for_files_to_load(1)
# From the main list view, click camera icon
self.previous_number_of_pictures = len(self.data_layer.picture_files)
camera = gallery.switch_to_camera()
# Take the shot
camera.take_photo()
# Check that picture saved to SD card
Wait(self.marionette).until(lambda m: len(self.data_layer.picture_files) ==
self.previous_number_of_pictures + 1)
# Verify the Camera app is still open, by checking for the presence of thumbnail
self.assertTrue(camera.is_thumbnail_visible)