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


Python Gallery.switch_to_camera方法代码示例

本文整理汇总了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)
开发者ID:4gh,项目名称:gaia,代码行数:36,代码来源:test_endurance_gallery_camera.py

示例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)
开发者ID:AutomatedTester,项目名称:gaia,代码行数:24,代码来源:test_gallery_switch_to_camera_main_view.py


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