diff --git a/cms/djangoapps/contentstore/features/video.feature b/cms/djangoapps/contentstore/features/video.feature index 48be51a252..0ce6e1d39f 100644 --- a/cms/djangoapps/contentstore/features/video.feature +++ b/cms/djangoapps/contentstore/features/video.feature @@ -77,3 +77,13 @@ Feature: CMS.Video Component Then I focus on caption line with data-index 0 Then I press "enter" button on caption line with data-index 0 And I see caption line with data-index 0 has class "focused" + + # 11 + Scenario: When start end end times are specified, a range on slider is shown + Given I have created a Video component + And I edit the component + And Enter a start time of 10 seconds + And Enter an end time of 20 seconds + And I close the component editor + And I click Play button + Then I see a range on slider starting at 20 and running for 40 % diff --git a/cms/djangoapps/contentstore/features/video.py b/cms/djangoapps/contentstore/features/video.py index 4f15bdc9b9..f0ae693ebc 100644 --- a/cms/djangoapps/contentstore/features/video.py +++ b/cms/djangoapps/contentstore/features/video.py @@ -8,6 +8,8 @@ from selenium.webdriver.common.keys import Keys BUTTONS = { 'CC': '.hide-subtitles', 'volume': '.volume', + 'Play': '.video_control.play', + 'Save': 'save-button', } @@ -173,3 +175,26 @@ def caption_line_has_class(_step, index, className): SELECTOR = ".subtitles > li[data-index='{index}']".format(index=int(index.strip())) world.css_has_class(SELECTOR, className.strip()) + +@step('Enter (?:a|an) (.+) time of (.+) seconds$') +def enter_start_end_time(_step, type_of_time, time): + type_of_time = type_of_time.strip() + time = int(time.strip()) + + +@step('I click (.+) button$') +def click_a_button(_step, button): + button = button.strip(button) + world.browser.find_by_css(BUTTONS[button]).click() + + +@step('I close the component editor$') +def close_component_editor(_step): + _step.given('I click Save button') + + +@step('I see a range on slider starting at (.+) and running for (.+) %$') +def see_a_range_slider_with_proper_range(_step, left, width): + left = int(left.strip()) + width = int(width.strip()) +