LMS: new UI for video player + AFontGarde iconfonts
This commit is contained in:
@@ -14,7 +14,8 @@ import logging
|
||||
log = logging.getLogger('VideoPage')
|
||||
|
||||
VIDEO_BUTTONS = {
|
||||
'CC': '.hide-subtitles',
|
||||
'transcript': '.lang',
|
||||
'transcript_button': '.toggle-transcript',
|
||||
'volume': '.volume',
|
||||
'play': '.video_control.play',
|
||||
'pause': '.video_control.pause',
|
||||
@@ -32,12 +33,12 @@ CSS_CLASS_NAMES = {
|
||||
'captions': '.subtitles',
|
||||
'captions_text': '.subtitles > li',
|
||||
'error_message': '.video .video-player h3',
|
||||
'video_container': 'div.video',
|
||||
'video_container': '.video',
|
||||
'video_sources': '.video-player video source',
|
||||
'video_spinner': '.video-wrapper .spinner',
|
||||
'video_xmodule': '.xmodule_VideoModule',
|
||||
'video_init': '.is-initialized',
|
||||
'video_time': 'div.vidtime',
|
||||
'video_time': '.vidtime',
|
||||
'video_display_name': '.vert h2',
|
||||
'captions_lang_list': '.langs-list li',
|
||||
'video_speed': '.speeds .value',
|
||||
@@ -45,8 +46,8 @@ CSS_CLASS_NAMES = {
|
||||
}
|
||||
|
||||
VIDEO_MODES = {
|
||||
'html5': 'div.video video',
|
||||
'youtube': 'div.video iframe'
|
||||
'html5': '.video video',
|
||||
'youtube': '.video iframe'
|
||||
}
|
||||
|
||||
VIDEO_MENUS = {
|
||||
@@ -99,7 +100,7 @@ class VideoPage(PageObject):
|
||||
video_player_buttons.append('play')
|
||||
|
||||
for button in video_player_buttons:
|
||||
self.wait_for_element_visibility(VIDEO_BUTTONS[button], '{} button is visible'.format(button.title()))
|
||||
self.wait_for_element_visibility(VIDEO_BUTTONS[button], '{} button is visible'.format(button))
|
||||
|
||||
def _is_finished_loading():
|
||||
"""
|
||||
@@ -126,7 +127,7 @@ class VideoPage(PageObject):
|
||||
|
||||
video_player_buttons = ['do_not_show_again', 'skip_bumper', 'volume']
|
||||
for button in video_player_buttons:
|
||||
self.wait_for_element_visibility(VIDEO_BUTTONS[button], '{} button is visible'.format(button.title()))
|
||||
self.wait_for_element_visibility(VIDEO_BUTTONS[button], '{} button is visible'.format(button))
|
||||
|
||||
@property
|
||||
def is_poster_shown(self):
|
||||
@@ -316,13 +317,13 @@ class VideoPage(PageObject):
|
||||
states = {True: 'Shown', False: 'Hidden'}
|
||||
state = states[captions_new_state]
|
||||
|
||||
# Make sure that the CC button is there
|
||||
EmptyPromise(lambda: self.is_button_shown('CC'),
|
||||
"CC button is shown").fulfill()
|
||||
# Make sure that the transcript button is there
|
||||
EmptyPromise(lambda: self.is_button_shown('transcript_button'),
|
||||
"transcript button is shown").fulfill()
|
||||
|
||||
# toggle captions visibility state if needed
|
||||
if self.is_captions_visible() != captions_new_state:
|
||||
self.click_player_button('CC')
|
||||
self.click_player_button('transcript_button')
|
||||
|
||||
# Verify that captions state is toggled/changed
|
||||
EmptyPromise(lambda: self.is_captions_visible() == captions_new_state,
|
||||
@@ -371,7 +372,7 @@ class VideoPage(PageObject):
|
||||
hover = ActionChains(self.browser).move_to_element(element_to_hover_over)
|
||||
hover.perform()
|
||||
|
||||
speed_selector = self.get_element_selector('li[data-speed="{speed}"] a'.format(speed=speed))
|
||||
speed_selector = self.get_element_selector('li[data-speed="{speed}"] .control'.format(speed=speed))
|
||||
self.q(css=speed_selector).first.click()
|
||||
|
||||
def verify_speed_changed(self, expected_speed):
|
||||
@@ -548,8 +549,8 @@ class VideoPage(PageObject):
|
||||
"""
|
||||
self.wait_for_ajax()
|
||||
|
||||
# mouse over to CC button
|
||||
cc_button_selector = self.get_element_selector(VIDEO_BUTTONS["CC"])
|
||||
# mouse over to transcript button
|
||||
cc_button_selector = self.get_element_selector(VIDEO_BUTTONS["transcript"])
|
||||
element_to_hover_over = self.q(css=cc_button_selector).results[0]
|
||||
ActionChains(self.browser).move_to_element(element_to_hover_over).perform()
|
||||
|
||||
|
||||
@@ -267,11 +267,11 @@ class CMSVideoTest(CMSVideoBaseTest):
|
||||
"""
|
||||
self._create_course_unit(subtitles=True)
|
||||
|
||||
self.video.click_player_button('CC')
|
||||
self.video.click_player_button('transcript_button')
|
||||
|
||||
self.assertFalse(self.video.is_captions_visible())
|
||||
|
||||
self.video.click_player_button('CC')
|
||||
self.video.click_player_button('transcript_button')
|
||||
|
||||
self.assertTrue(self.video.is_captions_visible())
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ class YouTubeVideoTest(VideoBaseTest):
|
||||
Then the "CC" button is hidden
|
||||
"""
|
||||
self.navigate_to_video()
|
||||
self.assertFalse(self.video.is_button_shown('CC'))
|
||||
self.assertFalse(self.video.is_button_shown('transcript_button'))
|
||||
|
||||
def test_fullscreen_video_alignment_with_transcript_hidden(self):
|
||||
"""
|
||||
@@ -351,8 +351,8 @@ class YouTubeVideoTest(VideoBaseTest):
|
||||
# check if video aligned correctly with enabled transcript
|
||||
self.assertTrue(self.video.is_aligned(True))
|
||||
|
||||
# click video button "CC"
|
||||
self.video.click_player_button('CC')
|
||||
# click video button "transcript"
|
||||
self.video.click_player_button('transcript_button')
|
||||
|
||||
# check if video aligned correctly without enabled transcript
|
||||
self.assertTrue(self.video.is_aligned(False))
|
||||
@@ -459,7 +459,7 @@ class YouTubeVideoTest(VideoBaseTest):
|
||||
|
||||
self.assertTrue(self.video.is_video_rendered('html5'))
|
||||
# check if caption button is visible
|
||||
self.assertTrue(self.video.is_button_shown('CC'))
|
||||
self.assertTrue(self.video.is_button_shown('transcript_button'))
|
||||
self._verify_caption_text('Welcome to edX.')
|
||||
|
||||
def test_download_transcript_button_works_correctly(self):
|
||||
|
||||
Reference in New Issue
Block a user