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
650a2ba4
Commit
650a2ba4
authored
Jun 18, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added deletion tests
parent
15facf8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
cms/djangoapps/contentstore/features/upload.feature
+9
-2
cms/djangoapps/contentstore/features/upload.py
+18
-4
No files found.
cms/djangoapps/contentstore/features/upload.feature
View file @
650a2ba4
...
@@ -5,7 +5,7 @@ Feature: Upload Files
...
@@ -5,7 +5,7 @@ Feature: Upload Files
Given
I have opened a new course in Studio
Given
I have opened a new course in Studio
And
I go to the files and uploads page
And
I go to the files and uploads page
When
I upload the file
"test"
When
I upload the file
"test"
Then
I see the file
"test"
was uploaded
Then
I s
hould s
ee the file
"test"
was uploaded
And
The url for the file
"test"
is valid
And
The url for the file
"test"
is valid
Scenario
:
Users can update files
Scenario
:
Users can update files
...
@@ -13,7 +13,14 @@ Feature: Upload Files
...
@@ -13,7 +13,14 @@ Feature: Upload Files
And
I go to the files and uploads page
And
I go to the files and uploads page
When
I upload the file
"test"
When
I upload the file
"test"
And
I upload the file
"test"
And
I upload the file
"test"
Then
I see only one
"test"
Then
I should see only one
"test"
Scenario
:
Users can delete uploaded files
Given
I have opened a new course in studio
And
I go to the files and uploads page
When
I upload the file
"test"
And
I delete the file
"test"
Then
I should not see the file
"test"
was uploaded
Scenario
:
Users can download files
Scenario
:
Users can download files
Given
I have opened a new course in studio
Given
I have opened a new course in studio
...
...
cms/djangoapps/contentstore/features/upload.py
View file @
650a2ba4
...
@@ -35,10 +35,13 @@ def upload_file(step, file_name):
...
@@ -35,10 +35,13 @@ def upload_file(step, file_name):
world
.
css_find
(
close_css
)
.
click
()
world
.
css_find
(
close_css
)
.
click
()
@step
(
u'I see the file "([^"]*)" was uploaded$'
)
@step
(
u'I s
hould( not)? s
ee the file "([^"]*)" was uploaded$'
)
def
check_upload
(
step
,
file_name
):
def
check_upload
(
step
,
do_not_see_file
,
file_name
):
index
=
get_index
(
file_name
)
index
=
get_index
(
file_name
)
assert
index
!=
-
1
if
do_not_see_file
:
assert
index
==
-
1
else
:
assert
index
!=
-
1
@step
(
u'The url for the file "([^"]*)" is valid$'
)
@step
(
u'The url for the file "([^"]*)" is valid$'
)
...
@@ -47,7 +50,18 @@ def check_url(step, file_name):
...
@@ -47,7 +50,18 @@ def check_url(step, file_name):
assert
r
.
status_code
==
200
assert
r
.
status_code
==
200
@step
(
u'I see only one "([^"]*)"$'
)
@step
(
u'I delete the file "([^"]*)"$'
)
def
delete_file
(
step
,
file_name
):
index
=
get_index
(
file_name
)
assert
index
!=
-
1
delete_css
=
".remove-asset-button"
world
.
css_click
(
delete_css
,
index
=
index
)
prompt_confirm_css
=
'li.nav-item > a.action-primary'
world
.
css_click
(
prompt_confirm_css
)
@step
(
u'I should see only one "([^"]*)"$'
)
def
no_duplicate
(
step
,
file_name
):
def
no_duplicate
(
step
,
file_name
):
names_css
=
'.name-col > a.filename'
names_css
=
'.name-col > a.filename'
all_names
=
world
.
css_find
(
names_css
)
all_names
=
world
.
css_find
(
names_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