Merge pull request #6522 from edx/zoldak/video-troubleshooting
Add debug logging to video tests
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user