Skip to content

Commit

Permalink
Replace sleep with explicit wait and re-enable: video player test
Browse files Browse the repository at this point in the history
  • Loading branch information
zacc committed Dec 11, 2012
1 parent 5345879 commit 91f8044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion gaiatest/tests/manifest.ini
Expand Up @@ -58,6 +58,5 @@ carrier = true
disabled = TODO
[test_video_player.py]
sdcard = true
disabled = Often failing due to timing issues - github issue #165
[test_launch_app.py]
wifi = true
10 changes: 5 additions & 5 deletions gaiatest/tests/test_video_player.py
Expand Up @@ -48,16 +48,16 @@ def test_play_video(self):
self.wait_for_element_displayed(*self._video_frame_locator)
self.wait_for_element_displayed(*self._video_loaded_locator)

# Wait for vid to have started playing
self.assertTrue(self.marionette.execute_script("return window.wrappedJSObject.playing;"))

# Tap to make toolbar visible
self.marionette.tap(self.marionette.find_element(*self._video_frame_locator))

# Let video play for one second
time.sleep(1)

# The elapsed time > 0:00 is the only indication of the video playing
self.assertIsNotNone(self.marionette.find_element(*self._elapsed_text_locator).text)
# The elapsed time != 0:00 is the only indication of the toolbar visible
self.assertNotEqual(self.marionette.find_element(*self._elapsed_text_locator).text, "00:00")

# Check the name too. This will only work if the toolbar is visible
self.assertEqual(first_video_name,
self.marionette.find_element(*self._video_title_locator).text)

Expand Down

0 comments on commit 91f8044

Please sign in to comment.