diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 9987eed8d..ec73a0be9 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -234,7 +234,13 @@ def _create_admin_account(browser, username, password): submit(browser) -def login(browser, url, username, password): +def login(browser): + """Login to the interface.""" + login_with_account(browser, base_url, config['DEFAULT']['username'], + config['DEFAULT']['password']) + + +def login_with_account(browser, url, username, password): # XXX: Find a way to remove the hardcoded jsxc URL if '/plinth/' not in browser.url or '/jsxc/jsxc' in browser.url: diff --git a/plinth/tests/functional/step_definitions.py b/plinth/tests/functional/step_definitions.py index 034c002af..76fc56984 100644 --- a/plinth/tests/functional/step_definitions.py +++ b/plinth/tests/functional/step_definitions.py @@ -13,9 +13,7 @@ from plinth.tests import functional @given("I'm a logged in user") def logged_in_user(session_browser): - functional.login(session_browser, functional.base_url, - functional.config['DEFAULT']['username'], - functional.config['DEFAULT']['password']) + functional.login(session_browser) @given("I'm a logged out user")