From 3e44f8a213b8959b63185e3dca51e2938f019c18 Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Tue, 2 Jul 2013 09:05:58 -0400 Subject: [PATCH 1/2] Component test now fails with useful information --- cms/djangoapps/contentstore/features/component.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index 64f088f056..3fad581718 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -2,6 +2,7 @@ #pylint: disable=W0621 from lettuce import world, step +from nose.tools import assert_true DATA_LOCATION = 'i4x://edx/templates' @@ -26,7 +27,7 @@ def add_components(step): def check_components(step): for component in [step_hash['Component'] for step_hash in step.hashes]: assert component in COMPONENT_DICTIONARY - assert COMPONENT_DICTIONARY[component]['found_func']() + assert_true(COMPONENT_DICTIONARY[component]['found_func'](), "{} couldn't be found".format(component)) @step(u'I delete all components') From 47158d70792ae385a1690f910b1a2283f80925f6 Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Tue, 2 Jul 2013 11:05:31 -0400 Subject: [PATCH 2/2] Using the success condition Got rid of announcement test Removed assumption about uniqueness of css steps --- cms/djangoapps/contentstore/features/component.feature | 3 --- cms/djangoapps/contentstore/features/component.py | 4 ---- 2 files changed, 7 deletions(-) diff --git a/cms/djangoapps/contentstore/features/component.feature b/cms/djangoapps/contentstore/features/component.feature index 6a18dfa7ab..8b907f152c 100644 --- a/cms/djangoapps/contentstore/features/component.feature +++ b/cms/djangoapps/contentstore/features/component.feature @@ -7,7 +7,6 @@ Feature: Component Adding When I add the following components: | Component | | Discussion | - | Announcement | | Blank HTML | | LaTex | | Blank Problem| @@ -26,7 +25,6 @@ Feature: Component Adding Then I see the following components: | Component | | Discussion | - | Announcement | | Blank HTML | | LaTex | | Blank Problem| @@ -50,7 +48,6 @@ Feature: Component Adding And I add the following components: | Component | | Discussion | - | Announcement | | Blank HTML | | LaTex | | Blank Problem| diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index 3fad581718..217ad84591 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -62,10 +62,6 @@ COMPONENT_DICTIONARY = { 'steps': step_selector_list('discussion', None), 'found_func': found_css_func('section.xmodule_DiscussionModule') }, - 'Announcement': { - 'steps': step_selector_list('html', 'Announcement'), - 'found_func': found_text_func('Heading of document') - }, 'Blank HTML': { 'steps': step_selector_list('html', 'Blank_HTML_Page'), #this one is a blank html so a more refined search is being done