예제 #1
0
    def test_music_songs_tileview_fullplay(self):
        """
        play a song until the end in the tile view
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        songs = TileView(self.marionette)
        main_song_player_view = songs.tap_main_song()
        play_time = time.strptime('00:20', '%M:%S')
        Wait(self.marionette, timeout=30).until(
            lambda m: main_song_player_view.player_elapsed_time >= play_time,
            message='song did not reach the end')
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # Once the song is done, it'll return to the tile view
        sub_song_player_view = songs.tap_sub_song(0)
        play_time = time.strptime('00:10', '%M:%S')
        Wait(self.marionette, timeout=20).until(
            lambda m: sub_song_player_view.player_elapsed_time >= play_time,
            message = 'song did not reach the end')
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()
예제 #2
0
    def test_select_album_play(self):
        # https://moztrap.mozilla.org/manage/case/4031/
        music_app = Music(self.marionette)
        music_app.launch()

        # switch to albums view
        list_view = music_app.tap_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.albums
        self.assertGreater(len(albums), 0, 'no albums found')

        # select an album
        sublist_view = albums[0].tap()

        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_play()

        # play for a short duration
        self.wait_for_condition(lambda m: player_view.player_elapsed_time == '00:05')
        self.assertNotEqual(
            player_view.player_current_timestamp,
            player_view.player_playback_duration)

        # validate playback
        self.assertTrue(player_view.is_player_playing())

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing())
예제 #3
0
    def test_select_album_play(self):
        # https://moztrap.mozilla.org/manage/case/4031/
        music_app = Music(self.marionette)
        music_app.launch()

        # switch to albums view
        list_view = music_app.tap_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.albums
        self.assertGreater(len(albums), 0, 'The mp3 file could not be found')

        # select an album
        sublist_view = albums[0].tap()

        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_play()

        # play for a short duration
        self.wait_for_condition(lambda m: player_view.player_elapsed_time == '00:05',
                                message='Mp3 sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(), 'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(), 'The player did not stop playing')
예제 #4
0
    def test_select_songs_play_3gp_file(self):

        music_app = Music(self.marionette)
        music_app.launch()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The 3gp file could not be found')

        player_view = songs[0].tap_first_song()

        self.wait_for_condition(
            lambda m: player_view.player_elapsed_time == '00:05',
            message='3gp sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(),
                        'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(),
                         'The player did not stop playing')
예제 #5
0
    def test_select_songs_play_3gp_file(self):

        music_app = Music(self.marionette)
        music_app.launch()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The 3gp file could not be found')

        player_view = songs[0].tap_first_song()

        self.wait_for_condition(lambda m: player_view.player_elapsed_time == '00:05',
                                message='3gp sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(), 'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(), 'The player did not stop playing')
    def test_music_songview_fullplay(self):
        """
        play a song until the end in the song list view
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # switch to songs view and play it from there too
        list_view = music_app.tap_songs_tab()
        music_app.wait_for_view_displayed('Songs')
        self.take_screenshot()
        songs = list_view.media
        from_list_player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:20', '%M:%S')
        Wait(self.marionette, timeout=30).until(
            lambda m: from_list_player_view.player_elapsed_time >= play_time,
            message='song did not reach the end')

        # wait until next song kicks in (elapsed time will reset)
        Wait(self.marionette, timeout = 30).until(
            lambda m: from_list_player_view.player_elapsed_time < play_time,
            message='next song did not start')

        # once the first song completes, it will play the next song automatically
        play_time = time.strptime('00:13', '%M:%S')
        Wait(self.marionette, timeout=20).until(
            lambda m: from_list_player_view.player_elapsed_time >= play_time,
            message='song did not reach the end')

        music_app.wait_for_view_displayed('Songs')
        self.take_screenshot()
예제 #7
0
    def test_select_album_play(self):
        # https://moztrap.mozilla.org/manage/case/4031/
        music_app = Music(self.marionette)
        music_app.launch()

        # switch to albums view
        list_view = music_app.tap_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.media
        self.assertGreater(len(albums), 0, 'The mp3 file could not be found')

        # select an album
        sublist_view = albums[0].tap_first_album()

        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_play()

        # play for a short duration
        self.wait_for_condition(
            lambda m: player_view.player_elapsed_time == '00:05',
            message='Mp3 sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(),
                        'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(),
                         'The player did not stop playing')
예제 #8
0
    def test_empty_music(self):
        """https://moztrap.mozilla.org/manage/case/3668/"""

        # Requires there to be no songs on SDCard which is the default
        music_app = Music(self.marionette)
        music_app.launch()

        music_app.wait_for_empty_message_to_load()
예제 #9
0
    def test_empty_music(self):
        # Requires there to be no songs on SDCard which is the default
        music_app = Music(self.marionette)
        music_app.launch()

        music_app.wait_for_empty_message_to_load()

        # Check that view elements are hidden when the overlay is showing.
        self.assertTrue(self.accessibility.is_hidden(music_app.tabs))
        self.assertTrue(self.accessibility.is_hidden(music_app.views))
예제 #10
0
    def prepare_app(self):
        music_count = WORKLOADS['heavy']['music']
        tracks_per_album = 10
        self.device.b2gpopulate.populate_music(
            music_count, tracks_per_album=tracks_per_album)

        app = Music(self.device.marionette)
        app.launch()
        # Bug 922610 - Wait for the music app to finish scanning
        time.sleep(5)
        self.wait_for_content_ready()
예제 #11
0
    def prepare_app(self):
        music_count = 100
        tracks_per_album = 10
        self.device.b2gpopulate.populate_music(
            music_count, tracks_per_album=tracks_per_album)

        app = Music(self.device.marionette)
        app.launch()
        # Bug 922610 - Wait for the music app to finish scanning
        time.sleep(5)
        self.wait_for_content_ready()
예제 #12
0
    def test_music_album_mp3(self):
        """
        https://moztrap.mozilla.org/manage/case/4031/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # switch to albums view
        list_view = music_app.tap_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.media
        self.assertGreater(len(albums), 0, 'The mp3 file could not be found')
        self.take_screenshot()

        # select an album
        sublist_view = albums[0].tap_first_album()
        self.take_screenshot()
        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_first_song()
        # play for a short duration
        play_time = time.strptime('00:03', '%M:%S')
        Wait(self.marionette).until(
            lambda m: player_view.player_elapsed_time >= play_time,
            message='Mp3 sample did not start playing')
        player_view.tap_forward()
        self.take_screenshot()
예제 #13
0
    def test_select_songs_play_3gp_file(self):
        """https://moztrap.mozilla.org/manage/case/4031/"""

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The 3gp file could not be found')

        player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:03', '%M:%S')
        self.wait_for_condition(
            lambda m: player_view.player_elapsed_time >= play_time,
            timeout=10,
            message='3gp sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(),
                        'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(),
                         'The player did not stop playing')
예제 #14
0
    def music_playback(self, screen_flag):
        self.push_resource(os.path.abspath('source/MP3_Au4.mp3'))
        lock_screen = LockScreen(self.marionette)
        homescreen = lock_screen.unlock()
        #self.wait_for_condition(lambda m: self.apps.displayed_app.name == homescreen.name)

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The file could not be found')

        player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:10', '%M:%S')
        self.wait_for_condition(lambda m: player_view.player_elapsed_time >= play_time)

        # validate playback
        # self.assertTrue(player_view.is_player_playing(), 'The player is not playing')

        self.marionette.switch_to_frame()
        print ""
        if screen_flag:
            print "Running Music Test (screen on)"
            test_name = "music_playback"
        else:
            self.device.turn_screen_off()
            print "Running Music Test (screen off)"
            test_name = "background_music_playback"
        self.runPowerTest(test_name, "Music", "music")
예제 #15
0
    def test_music_change_rating(self):
        """
        https://moztrap.mozilla.org/manage/case/2683/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view, and play the first one on the list
        list_view = music_app.tap_songs_tab()
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The ogg file could not be found')
        player_view = songs[0].tap_first_song()

        # wait until the player view is shown, then pause the play
        play_time = time.strptime('00:02', '%M:%S')
        Wait(self.marionette).until(
            lambda m: player_view.player_elapsed_time >= play_time)
        player_view.tap_play()
        self.assertFalse(player_view.is_player_playing(),
                         'The player did not stop playing')

        # give rating of 4
        player_view.tap_star(4)
        player_view.tap_cover_in_player_view(
        )  # tap again in case the overlay disappears due to timeout
        Wait(self.marionette).until(lambda m: player_view.star_rating == 4)

        #change the rating to 1
        player_view.tap_star(1)
        player_view.tap_cover_in_player_view(
        )  # tap again in case the overlay disappears due to timeout
        Wait(self.marionette).until(lambda m: player_view.star_rating == 1)
예제 #16
0
    def test_music_songs_3gp(self):
        """https://moztrap.mozilla.org/manage/case/4031/"""

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The 3gp file could not be found')
        self.take_screenshot()

        player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:03', '%M:%S')
        Wait(self.marionette).until(
            lambda m: player_view.player_elapsed_time >= play_time,
            message='3gp sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(),
                        'The player is not playing')

        # select stop, then FF to the end of the song
        player_view.tap_play()
        ff_button = self.marionette.find_element(
            *self._player_controls_next_locator)
        Actions(self.marionette).tap(ff_button).perform()
        self.take_screenshot()
예제 #17
0
    def test_background_music_playback(self):
        self.push_resource(os.path.abspath('source/MP3_Au4.mp3'))
        lock_screen = LockScreen(self.marionette)
        homescreen = lock_screen.unlock()
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == homescreen.name)

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The file could not be found')

        player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:03', '%M:%S')
        self.wait_for_condition(lambda m: player_view.player_elapsed_time >= play_time)

        # validate playback
        self.assertTrue(player_view.is_player_playing(), 'The player is not playing')

        self.marionette.switch_to_frame()
        self.device.turn_screen_off()
        print ""
        print "Running Music Test (screen off)"
        self.runPowerTest("background_music_playback", "Music", "music")
예제 #18
0
    def test_music_songs_3gp(self):
        """https://moztrap.mozilla.org/manage/case/4031/"""

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # switch to songs view
        list_view = music_app.tap_songs_tab()

        # check that songs (at least one) are available
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The 3gp file could not be found')
        self.take_screenshot()

        player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:03', '%M:%S')
        Wait(self.marionette).until(
            lambda m: player_view.player_elapsed_time >= play_time,
            message='3gp sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(), 'The player is not playing')

        # select stop, then FF to the end of the song
        player_view.tap_play()
        player_view.tap_forward()
        self.take_screenshot()
예제 #19
0
    def test_music_change_rating(self):
        """
        https://moztrap.mozilla.org/manage/case/2683/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view, and play the first one on the list
        list_view = music_app.tap_songs_tab()
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The ogg file could not be found')
        player_view = songs[0].tap_first_song()

        # wait until the player view is shown, then pause the play
        play_time = time.strptime('00:02', '%M:%S')
        Wait(self.marionette).until(lambda m: player_view.player_elapsed_time >= play_time)
        player_view.tap_play()
        self.assertFalse(player_view.is_player_playing(), 'The player did not stop playing')

        # give rating of 4
        player_view.tap_star(4)
        player_view.tap_cover_in_player_view() # tap again in case the overlay disappears due to timeout
        Wait(self.marionette).until(lambda m: player_view.star_rating == 4)

        #change the rating to 1
        player_view.tap_star(1)
        player_view.tap_cover_in_player_view() # tap again in case the overlay disappears due to timeout
        Wait(self.marionette).until(lambda m: player_view.star_rating == 1)
예제 #20
0
    def test_music_share_ringtone(self):
        """
        https://moztrap.mozilla.org/manage/case/2683/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view, and play the first one on the list
        list_view = music_app.tap_songs_tab()
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The ogg file could not be found')
        player_view = songs[0].tap_first_song()

        # wait until the player view is shown, then tap the share button
        play_time = time.strptime('00:01', '%M:%S')
        Wait(self.marionette).until(lambda m: player_view.player_elapsed_time >= play_time)
        activities = player_view.tap_share_button()
        ringtone = activities.share_to_ringtones()
        ringtone.tap_save()

        system = System(self.marionette)
        self.marionette.switch_to_frame()
        system.wait_for_notification_toaster_displayed(message="Ringtone set as default.")
        system.wait_for_notification_toaster_not_displayed()

        settings = Settings(self.marionette)
        settings.launch()
        sound = settings.open_sound_settings()

        # desktop b2g doesn't have this option visible, see bug 1130538
        if sound.ring_tone_selector_visible:
            self.assertEqual(sound.current_ring_tone, 'MUS_0001')
예제 #21
0
    def test_empty_music(self):
        """https://moztrap.mozilla.org/manage/case/3668/"""

        # Requires there to be no songs on SDCard which is the default
        music_app = Music(self.marionette)
        music_app.launch()

        music_app.wait_for_empty_message_to_load()
예제 #22
0
    def test_empty_music(self):
        # Requires there to be no songs on SDCard which is the default
        music_app = Music(self.marionette)
        music_app.launch()

        music_app.wait_for_empty_message_to_load()

        # Check that view elements are hidden when the overlay is showing.
        self.assertTrue(self.accessibility.is_hidden(music_app.tabs))
        self.assertTrue(self.accessibility.is_hidden(music_app.views))
예제 #23
0
    def test_empty_music(self):
        # https://moztrap.mozilla.org/manage/case/3668/
        # Requires there to be no songs on SDCard which is the default
        music_app = Music(self.marionette)
        music_app.launch()

        music_app.wait_for_empty_message_to_load()

        # Verify title & text when no music present
        self.assertEqual(music_app.empty_music_title, self.expected_title)
        self.assertEqual(music_app.empty_music_text, self.expected_text)
예제 #24
0
    def test_select_album_play(self):
        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        list_view = music_app.a11y_click_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.media
        self.assertGreater(len(albums), 0, 'The mp3 file could not be found')

        # select an album by click
        sublist_view = albums[0].a11y_click_first_album()
        element = Wait(self.marionette).until(
            expected.element_present(*sublist_view._play_control_locator))
        Wait(self.marionette).until(expected.element_displayed(element))
        self.assertTrue(self.accessibility.is_visible(element))
예제 #25
0
    def test_select_album_play(self):
        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        list_view = music_app.a11y_click_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.media
        self.assertGreater(len(albums), 0, 'The mp3 file could not be found')

        # select an album by click
        sublist_view = albums[0].a11y_click_first_album()
        self.wait_for_element_displayed(*sublist_view._play_control_locator)
        self.assertTrue(self.accessibility.is_visible(
            self.marionette.find_element(*sublist_view._play_control_locator)))
예제 #26
0
    def test_select_artist_play(self):
        """
        https://moztrap.mozilla.org/manage/case/4031/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to artists view
        list_view = music_app.tap_artists_tab()

        # check that artists (at least one) are available
        artists = list_view.media
        self.assertGreater(len(artists), 0, 'The mp3 file could not be found')

        # select an artist
        sublist_view = artists[0].tap_first_artist()

        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_first_song()

        # play for a short duration
        play_time = time.strptime('00:03', '%M:%S')
        self.wait_for_condition(
            lambda m: player_view.player_elapsed_time >= play_time,
            timeout=10,
            message='Mp3 sample did not start playing')

        # validate playback
        self.assertTrue(player_view.is_player_playing(),
                        'The player is not playing')

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(),
                         'The player did not stop playing')
예제 #27
0
    def test_music_share_ringtone(self):
        """
        https://moztrap.mozilla.org/manage/case/2683/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to songs view, and play the first one on the list
        list_view = music_app.tap_songs_tab()
        songs = list_view.media
        self.assertGreater(len(songs), 0, 'The ogg file could not be found')
        player_view = songs[0].tap_first_song()

        # wait until the player view is shown, then tap the share button
        play_time = time.strptime('00:01', '%M:%S')
        Wait(self.marionette).until(
            lambda m: player_view.player_elapsed_time >= play_time)
        activities = player_view.tap_share_button()
        ringtone = activities.share_to_ringtones()
        ringtone.tap_save()

        system = System(self.marionette)
        self.marionette.switch_to_frame()
        system.wait_for_notification_toaster_displayed(
            message="Ringtone set as default.")
        system.wait_for_notification_toaster_not_displayed()

        settings = Settings(self.marionette)
        settings.launch()
        sound = settings.open_sound()

        # desktop b2g doesn't have this option visible, see bug 1130538
        if sound.ring_tone_selector_visible:
            self.assertEqual(sound.current_ring_tone, 'MUS_0001')
예제 #28
0
    def test_select_album_play(self):
        """
        https://moztrap.mozilla.org/manage/case/3755/
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()

        # switch to albums view
        list_view = music_app.tap_albums_tab()

        # check that albums (at least one) are available
        albums = list_view.media
        self.assertGreater(len(albums), 0, "The mp3 file could not be found")

        # select an album
        sublist_view = albums[0].tap_first_album()

        # select play
        # This wait is timing out because of bug 862156
        player_view = sublist_view.tap_play()

        # play for a short duration
        play_time = time.strptime("00:03", "%M:%S")
        self.wait_for_condition(
            lambda m: player_view.player_elapsed_time >= play_time,
            timeout=10,
            message="Mp3 sample did not start playing",
        )

        # validate playback
        self.assertTrue(player_view.is_player_playing(), "The player is not playing")

        # select stop
        player_view.tap_play()

        # validate stopped playback
        self.assertFalse(player_view.is_player_playing(), "The player did not stop playing")
예제 #29
0
    def test_music_songview_fullplay(self):
        """
        play a song until the end in the song list view
        """

        music_app = Music(self.marionette)
        music_app.launch()
        music_app.wait_for_music_tiles_displayed()
        self.take_screenshot()

        # switch to songs view and play it from there too
        list_view = music_app.tap_songs_tab()
        music_app.wait_for_view_displayed('Songs')
        self.take_screenshot()
        songs = list_view.media
        from_list_player_view = songs[0].tap_first_song()

        play_time = time.strptime('00:20', '%M:%S')
        Wait(self.marionette, timeout=30).until(
            lambda m: from_list_player_view.player_elapsed_time >= play_time,
            message='song did not reach the end')

        # wait until next song kicks in (elapsed time will reset)
        Wait(self.marionette, timeout=30).until(
            lambda m: from_list_player_view.player_elapsed_time < play_time,
            message='next song did not start')

        # once the first song completes, it will play the next song automatically
        play_time = time.strptime('00:13', '%M:%S')
        Wait(self.marionette, timeout=20).until(
            lambda m: from_list_player_view.player_elapsed_time >= play_time,
            message='song did not reach the end')

        music_app.wait_for_view_displayed('Songs')
        self.take_screenshot()