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
f10cf294
Commit
f10cf294
authored
Sep 24, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update upload test for what actually works now.
parent
370872f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
10 deletions
+35
-10
cms/djangoapps/contentstore/features/upload.feature
+13
-8
cms/djangoapps/contentstore/features/upload.py
+22
-2
No files found.
cms/djangoapps/contentstore/features/upload.feature
View file @
f10cf294
...
...
@@ -82,18 +82,22 @@ Feature: CMS.Upload Files
Then
"test"
is
unlocked
# Uploading isn't working on safari with sauce labs
@skip_safari
Scenario
:
Locked assets can't be viewed if logged in as unregistered user
Given
I have opened a course with a locked asset
"locked.html"
# Then the asset "locked.html" is viewable
And
the user
"bob"
exists
And
"bob"
logs
in
Then
the asset
"locked.html"
is protected
# TODO: work with Jay
# @skip_safari
# Scenario: Locked assets can't be viewed if logged in as unregistered user
# Given I have opened a course with a locked asset "locked.html"
# Then the asset "locked.html" can be clicked from the asset index
# And the user "bob" exists
# And "bob" logs in
# Then the asset "locked.html" is protected
# Uploading isn't working on safari with sauce labs
@skip_safari
Scenario
:
Locked assets can't be viewed if logged out
Given
I have opened a course with a locked asset
"locked.html"
# Note that logging out doesn't really matter at the moment-
# the asset will be protected because the user sent to middleware is the anonymous user.
# Need to work with Jay.
And
I log out
Then
the asset
"locked.html"
is protected
...
...
@@ -102,7 +106,8 @@ Feature: CMS.Upload Files
Scenario
:
Locked assets can be viewed with is_staff account
Given
I have opened a course with a locked asset
"locked.html"
And
the user
"staff"
exists as a course is_staff
# Then the asset "locked.html" is viewable
And
"staff"
logs
in
Then
the asset
"locked.html"
can be clicked from the asset index
# Uploading isn't working on safari with sauce labs
@skip_safari
...
...
cms/djangoapps/contentstore/features/upload.py
View file @
f10cf294
...
...
@@ -153,11 +153,11 @@ def open_course_with_locked(step, lock_state, file_name):
@step
(
u'Then the asset "([^"]*)" is (viewable|protected)'
)
def
view_asset
(
step
,
file_name
,
status
):
def
view_asset
(
_
step
,
file_name
,
status
):
url
=
'/c4x/MITx/999/asset/'
+
file_name
if
status
==
'viewable'
:
world
.
visit
(
url
)
assert
world
.
css_text
(
'body'
)
==
'test file'
_verify_body_text
()
else
:
error_thrown
=
False
try
:
...
...
@@ -168,6 +168,26 @@ def view_asset(step, file_name, status):
assert
error_thrown
@step
(
u'Then the asset "([^"]*)" can be clicked from the asset index'
)
def
click_asset_from_index
(
step
,
file_name
):
# This is not ideal, but I'm having trouble with the middleware not having
# the same user in the request when I hit the URL directly.
course_link_css
=
'a.course-link'
world
.
css_click
(
course_link_css
)
step
.
given
(
"I go to the files and uploads page"
)
index
=
get_index
(
file_name
)
assert
index
!=
-
1
world
.
css_click
(
'a.filename'
,
index
=
index
)
_verify_body_text
()
def
_verify_body_text
():
def
verify_text
(
driver
):
return
world
.
css_text
(
'body'
)
==
'test file'
world
.
wait_for
(
verify_text
)
@step
(
'I see a confirmation that the file was deleted'
)
def
i_see_a_delete_confirmation
(
_step
):
alert_css
=
'#notification-confirmation'
...
...
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