From d3ec1cb915eb8b3fd2eeeda009bf7aa520ca88f5 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Mon, 3 Jun 2013 14:57:34 -0400 Subject: [PATCH] Add tests for single-click discussion creation. --- .../contentstore/features/discussion-editor.feature | 4 ++++ cms/djangoapps/contentstore/features/discussion-editor.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/cms/djangoapps/contentstore/features/discussion-editor.feature b/cms/djangoapps/contentstore/features/discussion-editor.feature index 24683c3297..8fb14c3205 100644 --- a/cms/djangoapps/contentstore/features/discussion-editor.feature +++ b/cms/djangoapps/contentstore/features/discussion-editor.feature @@ -11,3 +11,7 @@ Feature: Discussion Component Editor And I edit and select Settings Then I can modify the display name And my display name change is persisted on save + + Scenario: Creating a discussion takes a single click + Given I have clicked the new unit button + Then creating a discussion takes a single click diff --git a/cms/djangoapps/contentstore/features/discussion-editor.py b/cms/djangoapps/contentstore/features/discussion-editor.py index aced4c2c88..ae3da3c458 100644 --- a/cms/djangoapps/contentstore/features/discussion-editor.py +++ b/cms/djangoapps/contentstore/features/discussion-editor.py @@ -21,3 +21,10 @@ def i_see_only_the_settings_and_values(step): ['Display Name', "Discussion Tag", True], ['Subcategory', "Topic-Level Student-Visible Label", True] ]) + + +@step('creating a discussion takes a single click') +def discussion_takes_a_single_click(step): + assert(not world.is_css_present('.xmodule_DiscussionModule')) + world.css_click("a[data-location='i4x://edx/templates/discussion/Discussion_Tag']") + assert(world.is_css_present('.xmodule_DiscussionModule'))