diff --git a/cms/djangoapps/contentstore/features/video.feature b/cms/djangoapps/contentstore/features/video.feature index e6a02fb6b2..aa8cfc864d 100644 --- a/cms/djangoapps/contentstore/features/video.feature +++ b/cms/djangoapps/contentstore/features/video.feature @@ -46,16 +46,26 @@ Feature: CMS.Video Component Scenario: Closed captions become visible when the mouse hovers over CC button Given I have created a Video component with subtitles And Make sure captions are closed - Then Captions become invisible + Then Captions become invisible after 3 seconds And Hover over CC button - Then Captions become visible + Then Captions become visible after 0 seconds + And Hover over volume button + Then Captions become invisible after 3 seconds # 8 Scenario: Open captions never become invisible Given I have created a Video component with subtitles And Make sure captions are open - Then Captions become visible + Then Captions are visible after 0 seconds And Hover over CC button - Then Captions become visible + Then Captions are visible after 3 seconds And Hover over volume button - Then Captions become visible + Then Captions are visible after 3 seconds + + # 9 + Scenario: Closed captions are invisible when mouse doesn't hover on CC button + Given I have created a Video component with subtitles + And Make sure captions are closed + Then Captions become invisible after 3 seconds + And Hover over volume button + Then Captions are invisible after 0 seconds diff --git a/cms/djangoapps/contentstore/features/video.py b/cms/djangoapps/contentstore/features/video.py index a6a634024a..eae4d7b966 100644 --- a/cms/djangoapps/contentstore/features/video.py +++ b/cms/djangoapps/contentstore/features/video.py @@ -135,13 +135,21 @@ def hover_over_button(_step, button): world.browser.find_by_css('.volume').mouse_over() -@step('Captions become (.+)$') -def captions_become_visible(_step, visibility_state): - # Captions become invisible by fading out. We must wait. - world.wait(2) +@step('Captions become (.+) after (.+) seconds$') +def check_captions_visibility_state(_step, visibility_state, timeout): + timeout = int(timeout.strip()) + + # Captions become invisible by fading out. We must wait by a specified + # time. + world.wait(timeout) if visibility_state == 'visible': assert world.css_visible('.subtitles') else: assert not world.css_visible('.subtitles') + +@step('Captions are (.+) after (.+) seconds$') +def check_captions_visibility_state2(_step, visibility_state, timeout): + check_captions_visibility_state(_step, visibility_state, timeout) +