Created
June 20, 2016 21:55
-
-
Save abstatic/ac3cab3c9164c42a0984755bd2d0ad09 to your computer and use it in GitHub Desktop.
Upload function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test030_upload(self): | |
""" | |
This test is for checking if we can successfully upload a profile | |
""" | |
print "Test#3 Profile upload test" | |
# login into the app | |
driver = self.driver | |
driver.get("http://localhost:8080/") | |
self.login(driver) | |
# make sure that we are logged in | |
wait = WebDriverWait(driver, 60) | |
assert wait.until( | |
EC.element_to_be_clickable((By.ID, "signout"))).is_displayed() | |
# go to the upload page | |
driver.get("http://localhost:8080/upload") | |
# in the upload file field, upload the file | |
upload_field = driver.find_element_by_id("id_file") | |
test_profile_path = self.test_profile_path | |
upload_field.send_keys(test_profile_path) | |
# we need to use the submit() button | |
# because when we submit forms via click | |
# the whole thing has been found to freeze. | |
elem = driver.find_element_by_id("submit_button") | |
elem.submit() | |
assert wait.until( | |
EC.presence_of_element_located((By.ID, "success"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment