Commit d05d491a authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Preparations: made root webdriver lazy

This is a bit different than for regular users, since
we have potentially the root password first initialization
sequence.
parent f8b865f4cc43
......@@ -126,8 +126,17 @@ class Heptapod:
logger.info("Initializing a signed-in webdriver for user %r",
user_name)
driver = session.make_webdriver(self, user_name, info['password'])
info['webdriver'] = driver
if user_name == 'root':
driver = self.new_webdriver()
# guaranteeing driver to be available for teardown
# as soon as created
info['webdriver'] = driver
session.login_as_root(driver, self, info['password'])
else:
# TODO should init webdriver from here and store it before login
# attempt as well
driver = session.make_webdriver(self, user_name, info['password'])
info['webdriver'] = driver
return driver
def wait_startup(self, first_response_timeout=INITIAL_TIMEOUT,
......@@ -217,10 +226,7 @@ class Heptapod:
logger.info("Preparing root user.")
start = time.time()
root = self.users.setdefault('root', {})
driver = self.new_webdriver()
# guaranteeing driver to be available for teardown as soon as created
root['webdriver'] = driver
session.login_as_root(driver, self, root_password)
root['password'] = root_password
logger.info("Preparing application settings.")
# necessary if we want to listen to web hooks from these tests
......
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