Skip to content

Commit

Permalink
test: fix sync path per user
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Jul 15, 2024
1 parent 4a501a7 commit 3dc4c46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions test/gui/shared/scripts/helpers/SetupClientHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 += '''
Expand Down Expand Up @@ -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()
Expand All @@ -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)


Expand Down
6 changes: 1 addition & 5 deletions test/gui/shared/scripts/pageObjects/EnterPassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 8 additions & 5 deletions test/gui/shared/steps/account_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 3dc4c46

Please sign in to comment.