From 792bca88a3ec354c5ce12d7f15cb7fd7f45d729e Mon Sep 17 00:00:00 2001 From: raeeschachar Date: Fri, 11 Mar 2016 17:40:42 +0500 Subject: [PATCH] Removed annotatable.feature and events.feature and related py files --- .../courseware/features/annotatable.feature | 9 -- .../courseware/features/annotatable.py | 105 ------------------ .../courseware/features/events.feature | 14 --- 3 files changed, 128 deletions(-) delete mode 100644 lms/djangoapps/courseware/features/annotatable.feature delete mode 100644 lms/djangoapps/courseware/features/annotatable.py delete mode 100644 lms/djangoapps/courseware/features/events.feature diff --git a/lms/djangoapps/courseware/features/annotatable.feature b/lms/djangoapps/courseware/features/annotatable.feature deleted file mode 100644 index 619ad7d369..0000000000 --- a/lms/djangoapps/courseware/features/annotatable.feature +++ /dev/null @@ -1,9 +0,0 @@ -@shard_2 -Feature: LMS.Annotatable Component - As a student, I want to view an Annotatable component in the LMS - - Scenario: An Annotatable component can be rendered in the LMS - Given that a course has an annotatable component with 2 annotations - When I view the annotatable component - Then the annotatable component has rendered - And the annotatable component has 2 highlighted passages diff --git a/lms/djangoapps/courseware/features/annotatable.py b/lms/djangoapps/courseware/features/annotatable.py deleted file mode 100644 index 3040a23a7f..0000000000 --- a/lms/djangoapps/courseware/features/annotatable.py +++ /dev/null @@ -1,105 +0,0 @@ -import textwrap - -from lettuce import world, steps -from nose.tools import assert_in, assert_equals - -from common import i_am_registered_for_the_course, visit_scenario_item - -DATA_TEMPLATE = textwrap.dedent("""\ - - Instruction text -

{}

-
-""") - -ANNOTATION_TEMPLATE = textwrap.dedent("""\ - Before {0}. - - Region Contents {0} - - After {0}. -""") - -PROBLEM_TEMPLATE = textwrap.dedent("""\ - - - - Question {number} - Region Contents {number} - What number is this region? - Type your response below: - What number is this region? - - {options} - - - - - This problem is checking region {number} - - -""") - -OPTION_TEMPLATE = """""" - - -def _correctness(choice, target): - if choice == target: - return "correct" - elif abs(choice - target) == 1: - return "partially-correct" - else: - return "incorrect" - - -@steps -class AnnotatableSteps(object): - - def __init__(self): - self.annotations_count = None - self.active_problem = None - - def define_component(self, step, count): - r"""that a course has an annotatable component with (?P\d+) annotations$""" - - count = int(count) - coursenum = 'test_course' - i_am_registered_for_the_course(step, coursenum) - - world.scenario_dict['ANNOTATION_VERTICAL'] = world.ItemFactory( - parent_location=world.scenario_dict['SECTION'].location, - category='vertical', - display_name="Test Annotation Vertical" - ) - - world.scenario_dict['ANNOTATABLE'] = world.ItemFactory( - parent_location=world.scenario_dict['ANNOTATION_VERTICAL'].location, - category='annotatable', - display_name="Test Annotation Module", - data=DATA_TEMPLATE.format("\n".join(ANNOTATION_TEMPLATE.format(i) for i in xrange(count))) - ) - self.annotations_count = count - - def view_component(self, step): - r"""I view the annotatable component$""" - visit_scenario_item('ANNOTATABLE') - - def check_rendered(self, step): - r"""the annotatable component has rendered$""" - world.wait_for_js_variable_truthy('$(".xblock-student_view[data-type=Annotatable]").data("initialized")') - annotatable_text = world.css_find('.xblock-student_view[data-type=Annotatable]').first.text - assert_in("Instruction text", annotatable_text) - - for i in xrange(self.annotations_count): - assert_in("Region Contents {}".format(i), annotatable_text) - - def count_passages(self, step, count): - r"""the annotatable component has (?P\d+) highlighted passages$""" - count = int(count) - assert_equals(len(world.css_find('.annotatable-span')), count) - assert_equals(len(world.css_find('.annotatable-span.highlight')), count) - assert_equals(len(world.css_find('.annotatable-span.highlight-yellow')), count) - -# This line is required by @steps in order to actually bind the step -# regexes -AnnotatableSteps() diff --git a/lms/djangoapps/courseware/features/events.feature b/lms/djangoapps/courseware/features/events.feature deleted file mode 100644 index 6cb02363f4..0000000000 --- a/lms/djangoapps/courseware/features/events.feature +++ /dev/null @@ -1,14 +0,0 @@ -@shard_2 -Feature: LMS.Events - As a researcher, I want to be able to track events in the LMS - - Scenario Outline: An event is emitted for each request - Given: I am registered for the course "6.002x" - And I visit the url "" - Then a course url "" event is emitted - - Examples: - | url | - | /dashboard | - | /courses/{}/info | - | /courses/{}/courseware |