Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4f795f82
Commit
4f795f82
authored
Oct 01, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix hardcoded course urls
parent
2a8529d3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
15 deletions
+18
-15
cms/djangoapps/contentstore/features/grading.py
+2
-8
common/djangoapps/terrain/steps.py
+4
-0
lms/djangoapps/courseware/features/events.feature
+5
-5
lms/djangoapps/courseware/features/events.py
+5
-0
lms/djangoapps/courseware/features/login.feature
+2
-2
No files found.
cms/djangoapps/contentstore/features/grading.py
View file @
4f795f82
...
@@ -61,20 +61,14 @@ def change_assignment_name(step, old_name, new_name):
...
@@ -61,20 +61,14 @@ def change_assignment_name(step, old_name, new_name):
index
=
get_type_index
(
old_name
)
index
=
get_type_index
(
old_name
)
f
=
world
.
css_find
(
name_id
)[
index
]
f
=
world
.
css_find
(
name_id
)[
index
]
assert_not_equal
(
index
,
-
1
)
assert_not_equal
(
index
,
-
1
)
for
count
in
range
(
len
(
old_name
)):
for
__
in
x
range
(
len
(
old_name
)):
f
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
f
.
_element
.
send_keys
(
Keys
.
END
,
Keys
.
BACK_SPACE
)
f
.
_element
.
send_keys
(
new_name
)
f
.
_element
.
send_keys
(
new_name
)
@step
(
u'I go back to the main course page'
)
@step
(
u'I go back to the main course page'
)
def
main_course_page
(
step
):
def
main_course_page
(
step
):
course_name
=
world
.
scenario_dict
[
'COURSE'
]
.
display_name
.
replace
(
' '
,
'_'
)
main_page_link
=
reverse_course_url
(
'course_handler'
,
world
.
scenario_dict
[
'COURSE'
]
.
id
)
course_key
=
SlashSeparatedCourseKey
(
world
.
scenario_dict
[
'COURSE'
]
.
org
,
world
.
scenario_dict
[
'COURSE'
]
.
number
,
course_name
)
main_page_link
=
reverse_course_url
(
'course_handler'
,
course_key
)
world
.
visit
(
main_page_link
)
world
.
visit
(
main_page_link
)
assert_in
(
'Course Outline'
,
world
.
css_text
(
'h1.page-header'
))
assert_in
(
'Course Outline'
,
world
.
css_text
(
'h1.page-header'
))
...
...
common/djangoapps/terrain/steps.py
View file @
4f795f82
...
@@ -81,6 +81,8 @@ def click_the_link_with_the_text_group1(step, linktext):
...
@@ -81,6 +81,8 @@ def click_the_link_with_the_text_group1(step, linktext):
@step
(
'I should see that the path is "([^"]*)"$'
)
@step
(
'I should see that the path is "([^"]*)"$'
)
def
i_should_see_that_the_path_is
(
step
,
path
):
def
i_should_see_that_the_path_is
(
step
,
path
):
if
'COURSE'
in
world
.
scenario_dict
:
path
=
path
.
format
(
world
.
scenario_dict
[
'COURSE'
]
.
id
)
assert
world
.
url_equals
(
path
),
(
assert
world
.
url_equals
(
path
),
(
"path should be {!r} but is {!r}"
.
format
(
path
,
world
.
browser
.
url
)
"path should be {!r} but is {!r}"
.
format
(
path
,
world
.
browser
.
url
)
)
)
...
@@ -185,6 +187,8 @@ def dialogs_are_closed(step):
...
@@ -185,6 +187,8 @@ def dialogs_are_closed(step):
@step
(
u'visit the url "([^"]*)"'
)
@step
(
u'visit the url "([^"]*)"'
)
def
visit_url
(
step
,
url
):
def
visit_url
(
step
,
url
):
if
'COURSE'
in
world
.
scenario_dict
:
url
=
url
.
format
(
world
.
scenario_dict
[
'COURSE'
]
.
id
)
world
.
browser
.
visit
(
lettuce
.
django
.
django_url
(
url
))
world
.
browser
.
visit
(
lettuce
.
django
.
django_url
(
url
))
...
...
lms/djangoapps/courseware/features/events.feature
View file @
4f795f82
...
@@ -5,10 +5,10 @@ Feature: LMS.Events
...
@@ -5,10 +5,10 @@ Feature: LMS.Events
Scenario Outline
:
An
event is emitted for each request
Scenario Outline
:
An
event is emitted for each request
Given
:
I
am registered for the course
"6.002x"
Given
:
I
am registered for the course
"6.002x"
And
I visit the url
"<url>"
And
I visit the url
"<url>"
Then
a
"<url>"
server
event is emitted
Then
a
course url
"<url>"
event is emitted
Examples
:
Examples
:
|
url
|
|
url
|
|
/dashboard
|
|
/dashboard
|
|
/courses/
edx/6.002x/Test_Course
/info
|
|
/courses/
{}
/info
|
|
/courses/
edx/6.002x/Test_Course
/courseware
|
|
/courses/
{}
/courseware
|
lms/djangoapps/courseware/features/events.py
View file @
4f795f82
...
@@ -36,6 +36,11 @@ def reset_between_outline_scenarios(_scenario, order, outline, reasons_to_fail):
...
@@ -36,6 +36,11 @@ def reset_between_outline_scenarios(_scenario, order, outline, reasons_to_fail):
world
.
event_collection
.
drop
()
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$'
)
@step
(
r'([aA]n?|\d+) "(.*)" (server|browser) events? is emitted$'
)
def
n_events_are_emitted
(
_step
,
count
,
event_type
,
event_source
):
def
n_events_are_emitted
(
_step
,
count
,
event_type
,
event_source
):
...
...
lms/djangoapps/courseware/features/login.feature
View file @
4f795f82
...
@@ -34,8 +34,8 @@ Feature: LMS.Login in as a registered user
...
@@ -34,8 +34,8 @@ Feature: LMS.Login in as a registered user
And
The course
"6.002x"
exists
And
The course
"6.002x"
exists
And
I am registered for the course
"6.002x"
And
I am registered for the course
"6.002x"
And
I am not logged in
And
I am not logged in
And
I visit the url
"/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/
edx/6.002x/Test_Course
/courseware"
And
I should see that the path is
"/accounts/login?next=/courses/
{}
/courseware"
When
I submit my credentials on the login form
When
I submit my credentials on the login form
And
I wait for
"2"
seconds
And
I wait for
"2"
seconds
Then
the page title should contain
"6.002x Courseware"
Then
the page title should contain
"6.002x Courseware"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment