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
035c4c02
Commit
035c4c02
authored
Sep 02, 2013
by
Julian Arni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add acceptance tests for multiple files
parent
b7971188
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
+28
-1
cms/djangoapps/contentstore/features/upload.feature
+10
-0
cms/djangoapps/contentstore/features/upload.py
+18
-1
No files found.
cms/djangoapps/contentstore/features/upload.feature
View file @
035c4c02
...
...
@@ -10,6 +10,16 @@ Feature: Upload Files
Then
I should see the file
"test"
was uploaded
And
The url for the file
"test"
is valid
@skip_safari
Scenario
:
Users can upload multiple files
Given
I have opened a new course in studio
And
I go to the files and uploads page
When
I upload the files
"test"
,"test2"
Then
I should see the file
"test"
was uploaded
And
I should see the file
"test2"
was uploaded
And
The url for the file
"test2"
is valid
And
The url for the file
"test"
is valid
# Uploading isn't working on safari with sauce labs
@skip_safari
Scenario
:
Users can update files
...
...
cms/djangoapps/contentstore/features/upload.py
View file @
035c4c02
...
...
@@ -26,7 +26,24 @@ def upload_file(_step, file_name):
#uploading the file itself
path
=
os
.
path
.
join
(
TEST_ROOT
,
'uploads/'
,
file_name
)
world
.
browser
.
execute_script
(
"$('input.file-input').css('display', 'block')"
)
world
.
browser
.
attach_file
(
'file'
,
os
.
path
.
abspath
(
path
))
world
.
browser
.
attach_file
(
'files[]'
,
os
.
path
.
abspath
(
path
))
close_css
=
'a.close-button'
world
.
css_click
(
close_css
)
@step
(
u'I upload the files (".*")$'
)
def
upload_file
(
_step
,
files_string
):
# Turn files_string to a list of file names
files
=
files_string
.
split
(
","
)
files
=
map
(
lambda
x
:
string
.
strip
(
x
,
' "'
),
files
)
upload_css
=
'a.upload-button'
world
.
css_click
(
upload_css
)
#uploading the files
for
f
in
files
:
path
=
os
.
path
.
join
(
TEST_ROOT
,
'uploads/'
,
f
)
world
.
browser
.
execute_script
(
"$('input.file-input').css('display', 'block')"
)
world
.
browser
.
attach_file
(
'files[]'
,
os
.
path
.
abspath
(
path
))
close_css
=
'a.close-button'
world
.
css_click
(
close_css
)
...
...
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