Fix hardcoded course urls

This commit is contained in:
Don Mitchell
2014-10-01 15:40:27 -04:00
parent 2a8529d37a
commit 4f795f8270
5 changed files with 18 additions and 15 deletions

View File

@@ -5,10 +5,10 @@ Feature: LMS.Events
Scenario Outline: An event is emitted for each request
Given: I am registered for the course "6.002x"
And I visit the url "<url>"
Then a "<url>" server event is emitted
Then a course url "<url>" event is emitted
Examples:
| url |
| /dashboard |
| /courses/edx/6.002x/Test_Course/info |
| /courses/edx/6.002x/Test_Course/courseware |
| url |
| /dashboard |
| /courses/{}/info |
| /courses/{}/courseware |

View File

@@ -36,6 +36,11 @@ def reset_between_outline_scenarios(_scenario, order, outline, reasons_to_fail):
world.event_collection.drop()
@step(r'[aA]n? course url "(.*)" event is emitted$')
def course_url_event_is_emitted(_step, url_regex):
event_type = url_regex.format(world.scenario_dict['COURSE'].id)
n_events_are_emitted(_step, 1, event_type, "server")
@step(r'([aA]n?|\d+) "(.*)" (server|browser) events? is emitted$')
def n_events_are_emitted(_step, count, event_type, event_source):

View File

@@ -34,8 +34,8 @@ Feature: LMS.Login in as a registered user
And The course "6.002x" exists
And I am registered for the course "6.002x"
And I am not logged in
And I visit the url "/courses/edx/6.002x/Test_Course/courseware"
And I should see that the path is "/accounts/login?next=/courses/edx/6.002x/Test_Course/courseware"
And I visit the url "/courses/{}/courseware"
And I should see that the path is "/accounts/login?next=/courses/{}/courseware"
When I submit my credentials on the login form
And I wait for "2" seconds
Then the page title should contain "6.002x Courseware"