From cae6e82bf72cd26e71f99d8a348f17c5f2036a34 Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Wed, 25 Sep 2013 09:46:18 -0400 Subject: [PATCH] Knock 10 more seconds off the acceptance tests. --- .../contentstore/features/discussion-editor.py | 6 ++++-- cms/djangoapps/contentstore/features/video.py | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cms/djangoapps/contentstore/features/discussion-editor.py b/cms/djangoapps/contentstore/features/discussion-editor.py index 15a7c4b9ab..d68860ff49 100644 --- a/cms/djangoapps/contentstore/features/discussion-editor.py +++ b/cms/djangoapps/contentstore/features/discussion-editor.py @@ -26,6 +26,8 @@ def i_see_only_the_settings_and_values(step): @step('creating a discussion takes a single click') def discussion_takes_a_single_click(step): - assert(not world.is_css_present('.xmodule_DiscussionModule')) + component_css = '.xmodule_DiscussionModule' + assert world.is_css_not_present(component_css) + world.css_click("a[data-category='discussion']") - assert(world.is_css_present('.xmodule_DiscussionModule')) + assert world.is_css_present(component_css) diff --git a/cms/djangoapps/contentstore/features/video.py b/cms/djangoapps/contentstore/features/video.py index 5a5d99e4d3..59c5f2bab9 100644 --- a/cms/djangoapps/contentstore/features/video.py +++ b/cms/djangoapps/contentstore/features/video.py @@ -6,8 +6,6 @@ from xmodule.modulestore import Location from contentstore.utils import get_modulestore -############### ACTIONS #################### - @step('I have created a Video component$') def i_created_a_video_component(step): world.create_component_instance( @@ -19,7 +17,7 @@ def i_created_a_video_component(step): @step('I have created a Video component with subtitles$') -def i_created_a_video_component(step): +def i_created_a_video_component_subtitles(step): step.given('I have created a Video component') # Store the current URL so we can return here @@ -46,9 +44,11 @@ def does_not_autoplay(_step, video_type): @step('creating a video takes a single click$') def video_takes_a_single_click(_step): - assert(not world.is_css_present('.xmodule_VideoModule')) + component_css = '.xmodule_VideoModule' + assert world.is_css_not_present(component_css) + world.css_click("a[data-category='video']") - assert(world.is_css_present('.xmodule_VideoModule')) + assert world.is_css_present(component_css) @step('I edit the component$') @@ -93,7 +93,7 @@ def xml_only_video(step): # Create a new Video component, but ensure that it doesn't have # metadata. This allows us to test that we are correctly parsing # out XML - video = world.ItemFactory.create( + world.ItemFactory.create( parent_location=parent_location, category='video', data='' % youtube_id