Fixed errors in spacing and refactoring out of scenario
This commit is contained in:
@@ -8,7 +8,6 @@ Feature: Navigate Course
|
||||
When I click on section "2"
|
||||
Then I should see the content of section "2"
|
||||
|
||||
|
||||
Scenario: I can navigate to subsections
|
||||
Given I am viewing a section with multiple subsections
|
||||
When I click on subsection "2"
|
||||
@@ -23,4 +22,4 @@ Feature: Navigate Course
|
||||
Given I am viewing a course with multiple sections
|
||||
When I click on section "2"
|
||||
And I return later
|
||||
Then I should see "You were most recently in Test Section2" somewhere on the page
|
||||
Then I should see that I was most recently in section "2"
|
||||
|
||||
@@ -21,19 +21,19 @@ def view_course_multiple_sections(step):
|
||||
create_course()
|
||||
# Add a section to the course to contain problems
|
||||
section1 = world.ItemFactory.create(parent_location=COURSE_LOC,
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
# Add a section to the course to contain problems
|
||||
section2 = world.ItemFactory.create(parent_location=COURSE_LOC,
|
||||
display_name=TEST_SECTION_NAME+"2")
|
||||
display_name=section_name(2))
|
||||
|
||||
world.ItemFactory.create(parent_location=section1.location,
|
||||
template='i4x://edx/templates/sequential/Empty',
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
world.ItemFactory.create(parent_location=section2.location,
|
||||
template='i4x://edx/templates/sequential/Empty',
|
||||
display_name=TEST_SECTION_NAME+"2")
|
||||
display_name=section_name(2))
|
||||
|
||||
add_problem_to_course_section('model_course', 'multiple choice', section=1)
|
||||
add_problem_to_course_section('model_course', 'drop down', section=2)
|
||||
@@ -47,14 +47,14 @@ def view_course_multiple_subsections(step):
|
||||
|
||||
# Add a section to the course to contain problems
|
||||
section1 = world.ItemFactory.create(parent_location=COURSE_LOC,
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
world.ItemFactory.create(parent_location=section1.location,
|
||||
template='i4x://edx/templates/sequential/Empty',
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
section2 = world.ItemFactory.create(parent_location=section1.location,
|
||||
display_name=TEST_SECTION_NAME+"2")
|
||||
display_name=section_name(2))
|
||||
|
||||
global SUBSECTION_2_LOC
|
||||
SUBSECTION_2_LOC = section2.location
|
||||
@@ -70,12 +70,12 @@ def view_course_multiple_sequences(step):
|
||||
create_course()
|
||||
# Add a section to the course to contain problems
|
||||
section1 = world.ItemFactory.create(parent_location=COURSE_LOC,
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
|
||||
world.ItemFactory.create(parent_location=section1.location,
|
||||
template='i4x://edx/templates/sequential/Empty',
|
||||
display_name=TEST_SECTION_NAME+"1")
|
||||
display_name=section_name(1))
|
||||
|
||||
add_problem_to_course_section('model_course', 'multiple choice', section=1)
|
||||
add_problem_to_course_section('model_course', 'drop down', section=1)
|
||||
@@ -125,11 +125,20 @@ def return_to_course(step):
|
||||
world.click_link("View Course")
|
||||
world.click_link("Courseware")
|
||||
|
||||
|
||||
@step(u'I should see that I was most recently in section "([^"]*)"')
|
||||
def see_recent_section(step, section):
|
||||
step.given('I should see "You were most recently in %s" somewhere on the page' % section_name(int(section)))
|
||||
|
||||
#####################
|
||||
# HELPERS
|
||||
#####################
|
||||
|
||||
|
||||
def section_name(section):
|
||||
return TEST_SECTION_NAME+str(section)
|
||||
|
||||
|
||||
def create_course():
|
||||
world.clear_courses()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user