From e77acdf40176b55b712ce0d05905e8c1efb9cc3b Mon Sep 17 00:00:00 2001 From: Jesse Zoldak Date: Fri, 26 Sep 2014 11:43:24 -0400 Subject: [PATCH] Add debug logging to video tests --- common/test/acceptance/pages/lms/video/video.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/test/acceptance/pages/lms/video/video.py b/common/test/acceptance/pages/lms/video/video.py index 0e73aafa7a..0b13dd5f97 100644 --- a/common/test/acceptance/pages/lms/video/video.py +++ b/common/test/acceptance/pages/lms/video/video.py @@ -9,6 +9,8 @@ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, Promise from bok_choy.javascript import wait_for_js, js_defined +import logging +log = logging.getLogger('VideoPage') VIDEO_BUTTONS = { 'CC': '.hide-subtitles', @@ -661,6 +663,11 @@ class VideoPage(PageObject): state_selector = self.get_element_selector(CSS_CLASS_NAMES['video_container']) current_state = self.q(css=state_selector).attrs('class')[0] + # For troubleshooting purposes show what the current state is. + # The debug statements will only be displayed in the event of a failure. + logging.debug("Current state of '{}' element is '{}'".format(state_selector, current_state)) + + # See the JS video player's onStateChange function if 'is-playing' in current_state: return 'playing' elif 'is-paused' in current_state: