Commit 2a8067ff authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

session.sign_in_page_login(): code reordering

it will be later convenient for `user` to be available before
the web form specifics.
parent d7f2d49a16db
...@@ -40,14 +40,15 @@ def sign_in_page_login(driver, heptapod, user_name, password=None): ...@@ -40,14 +40,15 @@ def sign_in_page_login(driver, heptapod, user_name, password=None):
If password is not specified, it is read from the heptapod object. If password is not specified, it is read from the heptapod object.
If it is, it'll be stored in the heptapod object If it is, it'll be stored in the heptapod object
""" """
elem = driver.find_element_by_name('user[login]')
elem.send_keys(user_name)
elem = driver.find_element_by_name('user[password]')
user = heptapod.users[user_name] user = heptapod.users[user_name]
if password is None: if password is None:
password = user.password password = user.password
else: else:
user.password = password user.password = password
elem = driver.find_element_by_name('user[login]')
elem.send_keys(user_name)
elem = driver.find_element_by_name('user[password]')
elem.send_keys(password) elem.send_keys(password)
elem.send_keys(Keys.RETURN) elem.send_keys(Keys.RETURN)
......
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