external_media_harness package

Test case classes for use in video tests

external_media_harness.testcase module

class external_media_harness.testcase.MediaTestCase(*args, **kwargs)[source]

Bases: firefox_puppeteer.mixins.PuppeteerMixin, marionette_harness.marionette_test.testcases.MarionetteTestCase

Necessary methods for MSE playback

Parameters:video_urls – Urls you are going to play as part of the tests.
check_playback_starts(video)[source]

Check to see if a given video will start. Raises if the video does not start.

Parameters:video – VideoPuppeteer instance to play.
log_video_debug_lines(video)[source]

Log the debugging information that Firefox provides for video elements.

run_playback(video)[source]

Play the video all of the way through, or for the requested duration, whichever comes first. Raises if the video stalls for too long.

Parameters:video – VideoPuppeteer instance to play.
save_screenshot()[source]

Make a screenshot of the window that is currently playing the video element.

skipTest(reason)[source]

Skip this test.

Skip with marionette.marionette_test import SkipTest so that it gets recognized a skip in marionette.marionette_test.CommonTestCase.run

class external_media_harness.testcase.NetworkBandwidthTestCase(*args, **kwargs)[source]

Bases: external_media_harness.testcase.MediaTestCase

Test MSE playback while network bandwidth is limited. Uses browsermobproxy (https://bmp.lightbody.net/). Please see https://developer.mozilla.org/en-US/docs/Mozilla/QA/external-media-tests for more information on setting up browsermob_proxy.

run_videos(timeout=60)[source]

Run each of the videos in the video list. Raises if something goes wrong in playback.

class external_media_harness.testcase.VideoPlaybackTestsMixin[source]

Bases: object

Test MSE playback in HTML5 video element.

These tests should pass on any site where a single video element plays upon loading and is uninterrupted (by ads, for example).

This tests both starting videos and performing partial playback at one minute each, and is the test that should be run frequently in automation.

test_playback_starts()[source]

Test to make sure that playback of the video element starts for each video.

test_video_playback_partial()[source]

Test to make sure that playback of 60 seconds works for each video.