當前位置: 首頁>>代碼示例>>Python>>正文


Python VideoPlayer.wait_for_progress_bar_complete方法代碼示例

本文整理匯總了Python中gaiatest.apps.videoplayer.app.VideoPlayer.wait_for_progress_bar_complete方法的典型用法代碼示例。如果您正苦於以下問題:Python VideoPlayer.wait_for_progress_bar_complete方法的具體用法?Python VideoPlayer.wait_for_progress_bar_complete怎麽用?Python VideoPlayer.wait_for_progress_bar_complete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gaiatest.apps.videoplayer.app.VideoPlayer的用法示例。


在下文中一共展示了VideoPlayer.wait_for_progress_bar_complete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_play_webm_video

# 需要導入模塊: from gaiatest.apps.videoplayer.app import VideoPlayer [as 別名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import wait_for_progress_bar_complete [as 別名]
    def test_play_webm_video(self):
        """https://moztrap.mozilla.org/manage/case/2478/"""

        video_player = VideoPlayer(self.marionette)
        video_player.launch()
        video_player.wait_for_progress_bar_complete()

        # Assert that there is at least one video available
        self.assertGreater(video_player.total_video_count, 0)

        first_video_name = video_player.first_video_name

        # Click on the first video
        fullscreen_video = video_player.tap_first_video_item()

        # Video will play automatically
        # We'll wait for the controls to clear so we're 'safe' to proceed
        time.sleep(2)

        # We cannot tap the toolbar so let's just enable it with javascript
        fullscreen_video.display_controls_with_js()

        # The elapsed time > 0:00 denote the video is playing
        zero_time = time.strptime('00:00', '%M:%S')
        self.assertGreater(fullscreen_video.elapsed_time, zero_time)

        # Check the name too. This will only work if the toolbar is visible
        self.assertEqual(first_video_name, fullscreen_video.name)
開發者ID:Allan019,項目名稱:gaia,代碼行數:30,代碼來源:test_play_webm_video.py


注:本文中的gaiatest.apps.videoplayer.app.VideoPlayer.wait_for_progress_bar_complete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。