Fixed the upload test

This commit is contained in:
JonahStanley
2013-08-07 13:06:25 -04:00
parent 5919456f24
commit a38f71cdbc

View File

@@ -24,13 +24,10 @@ def go_to_uploads(_step):
def upload_file(_step, file_name):
upload_css = 'a.upload-button'
world.css_click(upload_css)
file_css = 'input.file-input'
upload = world.css_find(file_css)
#uploading the file itself
path = os.path.join(TEST_ROOT, 'uploads/', file_name)
upload._element.send_keys(os.path.abspath(path))
world.browser.execute_script("$('input.file-input').css('display', 'block')")
world.browser.attach_file('file', os.path.abspath(path))
close_css = 'a.close-button'
world.css_click(close_css)