class TestCamera(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

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

    def test_capture_a_video(self):
        """https://moztrap.mozilla.org/manage/case/2477/"""

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that Filmstrip is visible
        self.assertTrue(self.camera.is_filmstrip_visible)

        # Check that video saved to SD card
        self.wait_for_condition(
            lambda m: len(self.data_layer.video_files) == 1)
        self.assertEqual(len(self.data_layer.video_files), 1)
Beispiel #2
0
class TestCamera(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

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

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

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # 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)
class TestCamera(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

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

    def test_capture_a_video(self):
        # https://moztrap.mozilla.org/manage/case/2477/
        self.camera = Camera(self.marionette)
        self.camera.launch()

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that Filmstrip is visible
        self.assertTrue(self.camera.is_filmstrip_visible)

        # Check that video saved to SD card
        self.wait_for_condition(lambda m: len(self.data_layer.video_files) == 1)
        self.assertEqual(len(self.data_layer.video_files), 1)
class TestCamera(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

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

    def test_capture_a_video(self):
        """https://moztrap.mozilla.org/manage/case/2477/"""

        # Check that 0 video files are present before we start the test
        self.assertEqual(len(self.data_layer.video_files), 0)

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that Filmstrip is visible
        self.assertTrue(self.camera.is_filmstrip_visible)
        self.camera.wait_for_filmstrip_not_visible()

        # Check that video saved to SD card
        self.assertIn("VID_0001.3gp", self.data_layer.video_files[0])
Beispiel #5
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(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

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

    def test_capture_a_video(self):
        """https://moztrap.mozilla.org/manage/case/2477/"""

        # Check that 0 video files are present before we start the test
        self.assertEqual(len(self.data_layer.video_files), 0)

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that Filmstrip is visible
        self.assertTrue(self.camera.is_filmstrip_visible)
        self.camera.wait_for_filmstrip_not_visible()

        # Check that video saved to SD card
        self.assertIn("VID_0001.3gp", self.data_layer.video_files[0])
class TestPreviewDelete(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

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

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

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that video saved to SD card
        self.assertEqual(
            len(self.data_layer.video_files),
            self.previous_number_of_videos + 1)

        # Tap preview icon to see the video that's just taken
        self.camera.tap_thumbnail()
        self.preview = ImagePreview(self.marionette)
        Wait(self.marionette).until(
            lambda m: self.preview.is_video_play_button_visible is True)

        # Play video, then pause it
        self.preview.tap_video_player_play_button()
        time.sleep(5)
        self.preview.tap_video_player_pause_button()

        # Tape the options icon, and delete the file
        self.preview.delete_file()

        # Check the user is back in camera preview mode, and there is no preview icon anymore
        Wait(self.marionette).until(
            lambda m: self.camera.is_thumbnail_visible is False)

        # Verify the video is deleted now
        self.assertEqual(
            len(self.data_layer.video_files), self.previous_number_of_videos)
class TestPreviewDelete(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

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

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

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

        # Switch to video mode
        self.camera.tap_switch_source()

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

        # Check that video saved to SD card
        self.assertEqual(len(self.data_layer.video_files),
                         self.previous_number_of_videos + 1)

        # Tap preview icon to see the video that's just taken
        self.camera.tap_thumbnail()
        self.preview = ImagePreview(self.marionette)
        Wait(self.marionette).until(
            lambda m: self.preview.is_video_play_button_visible is True)

        # Play video, then pause it
        self.preview.tap_video_player_play_button()
        time.sleep(5)
        self.preview.tap_video_player_pause_button()

        # Tape the options icon, and delete the file
        self.preview.delete_file()

        # Check the user is back in camera preview mode, and there is no preview icon anymore
        Wait(self.marionette).until(
            lambda m: self.camera.is_thumbnail_visible is False)

        # Verify the video is deleted now
        self.assertEqual(len(self.data_layer.video_files),
                         self.previous_number_of_videos)
    def camera_video(self):
        # Start camera
        camera_app = Camera(self.marionette)
        camera_app.launch()

        # Swtich to video
        time.sleep(5)
        camera_app.tap_switch_source()

        # Record a video for the specified duration
        camera_app.record_video(self.duration)

        # Sleep a bit and close the app
        time.sleep(5)
        self.close_app()

        # Wait between iterations
        time.sleep(5)
Beispiel #10
0
    def camera_video(self):
        # Start camera
        camera_app = Camera(self.marionette)
        camera_app.launch()

        # Swtich to video
        time.sleep(5)
        camera_app.tap_switch_source()

        # Record a video for the specified duration
        camera_app.record_video(self.duration)

        # Sleep a bit and close the app
        time.sleep(5)
        self.close_app()

        # Wait between iterations
        time.sleep(5)