diff --git a/common/djangoapps/terrain/browser.py b/common/djangoapps/terrain/browser.py index bb938347e1..c02ad7a2f9 100644 --- a/common/djangoapps/terrain/browser.py +++ b/common/djangoapps/terrain/browser.py @@ -197,7 +197,7 @@ def screenshot_on_error(scenario): LOGGER.error('Could not capture a screenshot') -@after.all +@after.harvest def teardown_browser(total): """ Quit the browser after executing the tests. diff --git a/lms/djangoapps/instructor/features/bulk_email.feature b/lms/djangoapps/instructor/features/bulk_email.feature index 8d3784c1ea..695fe3b9cb 100644 --- a/lms/djangoapps/instructor/features/bulk_email.feature +++ b/lms/djangoapps/instructor/features/bulk_email.feature @@ -1,5 +1,5 @@ @shard_2 -Feature: Bulk Email +Feature: LMS.Bulk Email As an instructor or course staff, In order to communicate with students and staff I want to send email to staff and students in a course. @@ -17,4 +17,3 @@ Feature: Bulk Email | staff | myself | | staff | course staff | | staff | students, staff, and instructors | - diff --git a/lms/djangoapps/instructor/features/bulk_email.py b/lms/djangoapps/instructor/features/bulk_email.py index 220ab9ecee..d08b81c9c1 100644 --- a/lms/djangoapps/instructor/features/bulk_email.py +++ b/lms/djangoapps/instructor/features/bulk_email.py @@ -12,12 +12,22 @@ from django.core.management import call_command from django.conf import settings -@step(u'I am an instructor for a course') -def i_am_an_instructor(step): # pylint: disable=W0613 +@step(u'Given I am "([^"]*)" for a course') +def i_am_an_instructor(step, role): # pylint: disable=W0613 + + # Store the role + assert_in(role, ['instructor', 'staff']) # Clear existing courses to avoid conflicts world.clear_courses() + # Create a new course + course = world.CourseFactory.create( + org='edx', + number='999', + display_name='Test Course' + ) + # Register the instructor as staff for the course world.register_by_course_id( 'edx/999/Test_Course', @@ -44,14 +54,22 @@ def i_am_an_instructor(step): # pylint: disable=W0613 is_staff=False ) - # Log in as the instructor for the course + # Log in as the an instructor or staff for the course world.log_in( - username='instructor', + username=role, password='password', email="instructor@edx.org", name="Instructor" ) + # Store the expected recipients + # given each "send to" option + world.expected_addresses = { + 'myself': [role + '@edx.org'], + 'course staff': ['instructor@edx.org', 'staff@edx.org'], + 'students, staff, and instructors': ['instructor@edx.org', 'staff@edx.org', 'student@edx.org'] + } + # Dictionary mapping a description of the email recipient # to the corresponding