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
fd6c9bed
Commit
fd6c9bed
authored
Sep 29, 2014
by
John Eskew
Committed by
Don Mitchell
Oct 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix course export/updates and upload CMS acceptance tests.
parent
edffa735
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
9 deletions
+32
-9
cms/djangoapps/contentstore/features/course-export.py
+2
-2
cms/djangoapps/contentstore/features/course-updates.feature
+6
-6
cms/djangoapps/contentstore/features/course-updates.py
+17
-0
cms/djangoapps/contentstore/features/upload.py
+7
-1
No files found.
cms/djangoapps/contentstore/features/course-export.py
View file @
fd6c9bed
...
...
@@ -60,10 +60,10 @@ def i_click_on_error_dialog(step):
))
# we don't know the actual ID of the vertical. So just check that we did go to a
# vertical page in the course (there should only be one).
vertical_usage_key
=
world
.
scenario_dict
[
'COURSE'
]
.
id
.
make_usage_key
(
"vertical"
,
None
)
vertical_usage_key
=
world
.
scenario_dict
[
'COURSE'
]
.
id
.
make_usage_key
(
"vertical"
,
"test"
)
vertical_url
=
reverse_usage_url
(
'container_handler'
,
vertical_usage_key
)
# Remove the trailing "/None" from the URL - we don't know the course ID, so we just want to
# check that we visited a vertical URL.
if
vertical_url
.
endswith
(
"/
None
"
):
if
vertical_url
.
endswith
(
"/
test"
)
or
vertical_url
.
endswith
(
"@test
"
):
vertical_url
=
vertical_url
[:
-
5
]
assert_equal
(
1
,
world
.
browser
.
url
.
count
(
vertical_url
))
cms/djangoapps/contentstore/features/course-updates.feature
View file @
fd6c9bed
...
...
@@ -60,22 +60,22 @@ Feature: CMS.Course updates
And
I go to the course updates page
When
I add a new update with the text
"<img src='/static/my_img.jpg'/>"
# Can only do partial text matches because of the quotes with in quotes (and regexp step matching).
Then
I should see the
update
"/c4x/MITx/999/asset/
my_img.jpg"
Then
I should see the
asset update to
"
my_img.jpg"
And
I change the update from
"/static/my_img.jpg"
to
"<img src='/static/modified.jpg'/>"
Then
I should see the
update
"/c4x/MITx/999/asset/
modified.jpg"
Then
I should see the
asset update to
"
modified.jpg"
And
when I reload the page
Then
I should see the
update
"/c4x/MITx/999/asset/
modified.jpg"
Then
I should see the
asset update to
"
modified.jpg"
Scenario
:
Static links are rewritten when previewing handouts
Given
I have opened a new course in Studio
And
I go to the course updates page
When
I modify the handout to
"<ol><img src='/static/my_img.jpg'/></ol>"
# Can only do partial text matches because of the quotes with in quotes (and regexp step matching).
Then
I see the handout
"/c4x/MITx/999/asset/
my_img.jpg"
Then
I see the handout
image link
"
my_img.jpg"
And
I change the handout from
"/static/my_img.jpg"
to
"<img src='/static/modified.jpg'/>"
Then
I see the handout
"/c4x/MITx/999/asset/
modified.jpg"
Then
I see the handout
image link
"
modified.jpg"
And
when I reload the page
Then
I see the handout
"/c4x/MITx/999/asset/
modified.jpg"
Then
I see the handout
image link
"
modified.jpg"
Scenario
:
Users cannot save handouts with bad html until edit or update it properly
Given
I have opened a new course in Studio
...
...
cms/djangoapps/contentstore/features/course-updates.py
View file @
fd6c9bed
...
...
@@ -4,6 +4,7 @@
from
lettuce
import
world
,
step
from
selenium.webdriver.common.keys
import
Keys
from
common
import
type_in_codemirror
,
get_codemirror_value
from
opaque_keys.edx.locations
import
CourseLocator
from
nose.tools
import
assert_in
# pylint: disable=E0611
...
...
@@ -29,6 +30,14 @@ def check_update(_step, text):
assert_in
(
text
,
update_html
)
@step
(
u'I should see the asset update to "([^"]*)"$'
)
def
check_asset_update
(
_step
,
asset_file
):
update_css
=
'div.update-contents'
update_html
=
world
.
css_find
(
update_css
)
.
html
asset_key
=
world
.
scenario_dict
[
'COURSE'
]
.
id
.
make_asset_key
(
asset_type
=
'asset'
,
path
=
asset_file
)
assert_in
(
unicode
(
asset_key
),
update_html
)
@step
(
u'I should not see the update "([^"]*)"$'
)
def
check_no_update
(
_step
,
text
):
update_css
=
'div.update-contents'
...
...
@@ -90,6 +99,14 @@ def check_handout(_step, handout):
assert_in
(
handout
,
world
.
css_html
(
handout_css
))
@step
(
u'I see the handout image link "([^"]*)"$'
)
def
check_handout_image_link
(
_step
,
image_file
):
handout_css
=
'div.handouts-content'
handout_html
=
world
.
css_html
(
handout_css
)
asset_key
=
world
.
scenario_dict
[
'COURSE'
]
.
id
.
make_asset_key
(
asset_type
=
'asset'
,
path
=
image_file
)
assert_in
(
unicode
(
asset_key
),
handout_html
)
@step
(
u'I see the handout error text'
)
def
check_handout_error
(
_step
):
handout_error_css
=
'div#handout_error'
...
...
cms/djangoapps/contentstore/features/upload.py
View file @
fd6c9bed
...
...
@@ -185,7 +185,13 @@ def open_course_with_locked(step, lock_state):
@step
(
u'Then the asset is (viewable|protected)$'
)
def
view_asset
(
_step
,
status
):
url
=
django_url
(
'/c4x/MITx/999/asset/asset.html'
)
asset_loc
=
world
.
scenario_dict
[
'COURSE'
]
.
id
.
make_asset_key
(
asset_type
=
'asset'
,
path
=
'asset.html'
)
svr_loc
=
django_url
()
asset_url
=
unicode
(
asset_loc
)
divider
=
'/'
if
asset_url
[
0
]
==
'/'
:
divider
=
''
url
=
'{}{}{}'
.
format
(
svr_loc
,
divider
,
asset_url
)
if
status
==
'viewable'
:
expected_text
=
'test file'
else
:
...
...
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