Beispiel #1
0
class TestCamera(GaiaMtbfTestCase):
    def setUp(self):
        GaiaMtbfTestCase.setUp(self)

        # Turn off geolocation prompt
        self.apps.set_permission('Camera', 'geolocation', 'deny')

        self.camera = Camera(self.marionette)
        self.camera.launch()

    def test_capture_a_video(self):
        """https://moztrap.mozilla.org/manage/case/2477/"""
        self.previous_number_of_videos = len(self.data_layer.video_files)

        # Switch to video mode
        self.camera.wait_for_capture_ready()
        if self.camera.camera_mode == u'picture':
            self.camera.tap_switch_source()

        # Record 10 seconds of video
        self.camera.record_video(10)

        # Check that video saved to SD card
        self.wait_for_condition(
            lambda m: len(self.data_layer.video_files) == self.
            previous_number_of_videos + 1, 15)
        self.assertEqual(len(self.data_layer.video_files),
                         self.previous_number_of_videos + 1)

    def tearDown(self):
        GaiaMtbfTestCase.tearDown(self)
class TestCamera(GaiaMtbfTestCase):

    def setUp(self):
        GaiaMtbfTestCase.setUp(self)

        # Turn off geolocation prompt
        self.apps.set_permission('Camera', 'geolocation', 'deny')

        self.camera = Camera(self.marionette)
        self.camera.launch()

    def test_capture_a_video(self):
        """https://moztrap.mozilla.org/manage/case/2477/"""
        self.previous_number_of_videos = len(self.data_layer.video_files)

        # Switch to video mode
        self.camera.wait_for_capture_ready()
        if self.camera.camera_mode == u'picture':
            self.camera.tap_switch_source()

        # Record 10 seconds of video
        self.camera.record_video(10)

        # Check that video saved to SD card
        self.wait_for_condition(lambda m: len(self.data_layer.video_files) == self.previous_number_of_videos + 1, 15)
        self.assertEqual(len(self.data_layer.video_files), self.previous_number_of_videos + 1)

    def tearDown(self):
        GaiaMtbfTestCase.tearDown(self)
Beispiel #3
0
 def tap_switch_to_camera(self):
     self.marionette.find_element(*self._camera_locator).tap()
     from gaiatest.apps.camera.app import Camera
     camera_app = Camera(self.marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == camera_app.name)
     self.apps.switch_to_displayed_app()
     camera_app.wait_for_capture_ready()
     self.wait_for_element_not_displayed(*self._loading_screen_locator)
     return camera_app
Beispiel #4
0
 def tap_camera(self):
     self.marionette.find_element(*self._camera_button_locator).tap()
     self.wait_for_element_not_displayed(*self._actions_menu_locator)
     from gaiatest.apps.camera.app import Camera
     camera = Camera(self.marionette)
     self.wait_for_condition(lambda m: self.apps.displayed_app.name == camera.name)
     self.apps.switch_to_displayed_app()
     camera.wait_for_capture_ready()
     return camera
Beispiel #5
0
 def tap_camera(self):
     self.marionette.find_element(*self._camera_button_locator).tap()
     self.wait_for_element_not_displayed(*self._actions_menu_locator)
     from gaiatest.apps.camera.app import Camera
     camera = Camera(self.marionette)
     self.wait_for_condition(lambda m: self.apps.displayed_app.name == camera.name)
     self.apps.switch_to_displayed_app()
     camera.wait_for_capture_ready()
     return camera
 def tap_switch_to_camera(self):
     self.marionette.find_element(*self._camera_locator).tap()
     from gaiatest.apps.camera.app import Camera
     camera_app = Camera(self.marionette)
     Wait(self.marionette).until(
         lambda m: self.apps.displayed_app.name == camera_app.name)
     self.apps.switch_to_displayed_app()
     camera_app.wait_for_capture_ready()
     self.wait_for_element_not_displayed(*self._loading_screen_locator)
     return camera_app
Beispiel #7
0
 def tap_camera(self):
     actions_menu = Wait(self.marionette).until(
         expected.element_present(*self._actions_menu_locator))
     Wait(self.marionette).until(
         expected.element_displayed(actions_menu))
     self.marionette.find_element(*self._camera_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(actions_menu))
     from gaiatest.apps.camera.app import Camera
     camera = Camera(self.marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == camera.name)
     self.apps.switch_to_displayed_app()
     camera.wait_for_capture_ready()
     return camera