diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index b26d91141b1..dbafd93105e 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -112,7 +112,7 @@ def getPollingInterval(): def generate_account_config(users, space="Personal"): - sync_paths = [] + sync_paths = {} user_setting = '' for idx, username in enumerate(users): user_setting += ''' @@ -165,7 +165,7 @@ def generate_account_config(users, space="Personal"): 'uuid_v4': generate_UUIDV4(), } user_setting = user_setting.format(**args) - sync_paths.append(sync_path) + sync_paths.update({username: sync_path}) # append extra configs user_setting += "version=13" user_setting = user_setting + getPollingInterval() @@ -180,7 +180,7 @@ def generate_account_config(users, space="Personal"): def setUpClient(username, space="Personal"): sync_paths = generate_account_config([username], space) startClient() - for sync_path in sync_paths: + for _, sync_path in sync_paths.items(): listenSyncStatusForItem(sync_path) diff --git a/test/gui/shared/scripts/pageObjects/EnterPassword.py b/test/gui/shared/scripts/pageObjects/EnterPassword.py index 33bdec07895..10ae9531831 100644 --- a/test/gui/shared/scripts/pageObjects/EnterPassword.py +++ b/test/gui/shared/scripts/pageObjects/EnterPassword.py @@ -97,11 +97,7 @@ def reLogin(self, username, password, oauth=False): else: self.enterPassword(password) - def loginAfterSetup(self, username=None, password=None): - if not username: - username = self.get_username() - password = getPasswordForUser(username) - + def loginAfterSetup(self, username, password): if get_config('ocis'): self.oidcReLogin(username, password) else: diff --git a/test/gui/shared/steps/account_context.py b/test/gui/shared/steps/account_context.py index 9be55dc56f6..8ad6ff6fe7c 100644 --- a/test/gui/shared/steps/account_context.py +++ b/test/gui/shared/steps/account_context.py @@ -77,14 +77,16 @@ def step(context): enter_password = EnterPassword(len(users) - idx) enter_password.accept_certificate() - for idx, sync_path in enumerate(sync_paths): - listenSyncStatusForItem(sync_path) + for idx, sync_path in enumerate(sync_paths.values()): # login from last dialog account_idx = len(sync_paths) - idx enter_password = EnterPassword(account_idx) - enter_password.loginAfterSetup() + username = enter_password.get_username() + password = getPasswordForUser(username) + listenSyncStatusForItem(sync_paths[username]) + enter_password.loginAfterSetup(username, password) # wait for files to sync - waitForInitialSyncToComplete(sync_path) + waitForInitialSyncToComplete(sync_paths[username]) @Given('the user has started the client') @@ -156,7 +158,8 @@ def step(context, username): def step(context, username): AccountSetting.login() password = getPasswordForUser(username) - EnterPassword.reLogin(username, password, True) + enter_password = EnterPassword() + enter_password.reLogin(username, password, True) # wait for files to sync waitForInitialSyncToComplete(getResourcePath('/', username))