move upload code for assets to AssetsView

STUD-1523
This commit is contained in:
zubiar-arbi
2014-04-18 13:15:52 +05:00
committed by zubair-arbi
parent b7816aafa2
commit 08f313f9b4
8 changed files with 304 additions and 115 deletions

View File

@@ -6,9 +6,12 @@ Feature: CMS.Upload Files
@skip_safari
Scenario: Users can upload files
Given I am at the files and upload page of a Studio course
When I upload the file "test"
When I upload the file "test" by clicking "Upload your first asset"
Then I should see the file "test" was uploaded
And The url for the file "test" is valid
When I upload the file "test2"
Then I should see the file "test2" was uploaded
And The url for the file "test2" is valid
# Uploading isn't working on safari with sauce labs
@skip_safari

View File

@@ -25,8 +25,11 @@ def go_to_uploads(_step):
@step(u'I upload the( test)? file "([^"]*)"$')
def upload_file(_step, is_test_file, file_name):
world.click_link('Upload New File')
def upload_file(_step, is_test_file, file_name, button_text=None):
if button_text:
world.click_link(button_text)
else:
world.click_link('Upload New File')
if not is_test_file:
_write_test_file(file_name, "test file")
@@ -39,6 +42,11 @@ def upload_file(_step, is_test_file, file_name):
world.css_click(close_css)
@step(u'I upload the file "([^"]*)" by clicking "([^"]*)"')
def upload_file_on_button_press(_step, file_name, button_text=None):
upload_file(_step, '', file_name, button_text)
@step(u'I upload the files "([^"]*)"$')
def upload_files(_step, files_string):
# files_string should be comma separated with no spaces.