Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Nov 22, 2023
1 parent 7fedf38 commit 9aeef58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/gui/shared/scripts/helpers/SetupClientHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def getClientDetails(context):
'user': '',
'password': '',
'sync_folder': '',
'auth_type': 'basic', # basic, oauth2 or oidc (used to determine the auth method)
'oauth': False,
}
for row in context.table[0:]:
row[1] = substituteInLineCodes(row[1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ def acceptCertificate():
)

@staticmethod
def addUserCreds(username, password, auth_type=None):
def addUserCreds(username, password, oauth=False):
if get_config('ocis'):
AccountConnectionWizard.oidcLogin(username, password)
elif auth_type == 'oauth2':
elif oauth:
AccountConnectionWizard.oauthLogin(username, password)
else:
AccountConnectionWizard.basicLogin(username, password)
Expand Down Expand Up @@ -264,7 +264,7 @@ def addAccountInformation(account_details):
AccountConnectionWizard.addUserCreds(
account_details['user'],
account_details['password'],
account_details['auth_type'],
account_details['oauth'],
)
sync_path = ''
if account_details['sync_folder']:
Expand Down
2 changes: 1 addition & 1 deletion test/gui/shared/steps/account_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def step(context):
@When('the user adds the following oauth2 account:')
def step(context):
account_details = getClientDetails(context)
account_details.update({'auth_type': "oauth2"})
account_details.update({'oauth': True})
AccountConnectionWizard.addAccount(account_details)
# wait for files to sync
waitForInitialSyncToComplete(getResourcePath('/', account_details["user"]))
Expand Down

0 comments on commit 9aeef58

Please sign in to comment.