From fb0fcc310bdc8830d8546ebd2e404db1b2275d63 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Tue, 16 Jul 2013 13:44:53 -0400 Subject: [PATCH] Factor out common code between module editing and course overview. --- cms/djangoapps/contentstore/features/common.py | 5 +++++ cms/djangoapps/contentstore/features/component.feature | 4 ++-- cms/djangoapps/contentstore/features/component.py | 5 ----- cms/djangoapps/contentstore/features/course-overview.feature | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index a734861e66..d357c8ae96 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -245,6 +245,11 @@ def confirm_the_prompt(step): world.css_click(prompt_css) +@step(u'I am shown a (.*)$') +def i_am_shown_a_notification(step, notification_type): + assert world.is_css_present('.wrapper-%s' % notification_type) + + def type_in_codemirror(index, text): world.css_click(".CodeMirror", index=index) g = world.css_find("div.CodeMirror.CodeMirror-focused > div > textarea") diff --git a/cms/djangoapps/contentstore/features/component.feature b/cms/djangoapps/contentstore/features/component.feature index 99330ca365..a30ce96ae6 100644 --- a/cms/djangoapps/contentstore/features/component.feature +++ b/cms/djangoapps/contentstore/features/component.feature @@ -75,7 +75,7 @@ Feature: Component Adding | Component | | Discussion | And I delete a component - Then I see a prompt + Then I am shown a prompt Scenario: I see a notification on save Given I have opened a new course in studio @@ -84,4 +84,4 @@ Feature: Component Adding | Component | | Discussion | And I edit and save a component - Then I see a notification + Then I am shown a notification diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index 3016ec9c50..15727dd992 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -52,11 +52,6 @@ def edit_and_save_component(step): world.css_click('.save-button') -@step(u'I see a (.*)$') -def i_see_a_notification(step, notification_type): - assert world.is_css_present('.wrapper-%s' % notification_type) - - def step_selector_list(data_type, path, index=1): selector_list = ['a[data-type="{}"]'.format(data_type)] if index != 1: diff --git a/cms/djangoapps/contentstore/features/course-overview.feature b/cms/djangoapps/contentstore/features/course-overview.feature index 010430bebb..b3041b9b18 100644 --- a/cms/djangoapps/contentstore/features/course-overview.feature +++ b/cms/djangoapps/contentstore/features/course-overview.feature @@ -62,4 +62,4 @@ Feature: Course Overview Given I have a course with 1 section When I navigate to the course overview page And I change an assignment's grading status - Then I see a notification + Then I am shown a notification