Commit e6466fdd by Will Daly

Changed user creation so that it creates the user only if it doesn't

already exist

Updated login dialog handling to workaround multiple login dialogs
that sometimes appear on a page (where the first one is hidden)
parent 56a6363d
...@@ -142,9 +142,14 @@ def log_in(email, password): ...@@ -142,9 +142,14 @@ def log_in(email, password):
# wait for the login dialog to load # wait for the login dialog to load
assert(world.browser.is_element_present_by_css('form#login_form', wait_time=10)) assert(world.browser.is_element_present_by_css('form#login_form', wait_time=10))
login_form = world.browser.find_by_css('form#login_form') # For some reason, the page sometimes includes two #login_form
login_form.find_by_name('email').type(email) # elements, the first of which is not visible.
login_form.find_by_name('password').type(password) # To avoid this, we always select the last of the two #login_form
# dialogs
login_form = world.browser.find_by_css('form#login_form').last
login_form.find_by_name('email').fill(email)
login_form.find_by_name('password').fill(password)
login_form.find_by_name('submit').click() login_form.find_by_name('submit').click()
# wait for the page to redraw # wait for the page to redraw
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment