Skip to content

Commit

Permalink
make methods DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha committed Jul 29, 2021
1 parent 04542d3 commit 67e325b
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions test/gui/shared/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,7 @@ def collaboratorShouldBeListed(context, receiver, resource, permissions):

@When('the user waits for the files to sync')
def step(context):
waitFor(
lambda: isFolderSynced(context.userData['clientSyncPath']),
context.userData['clientSyncTimeout'] * 1000,
)
waitForFolderToBeSynced(context, '/')


@When('the user waits for file "|any|" to be synced')
Expand Down Expand Up @@ -326,10 +323,7 @@ def step(context, filePath):

@Given('the user has paused the file sync')
def step(context):
waitFor(
lambda: isFolderSynced(context.userData['clientSyncPath']),
context.userData['clientSyncTimeout'] * 1000,
)
waitForFolderToBeSynced(context, '/')
syncWizard = SyncWizard()
syncWizard.performAction("Pause sync")

Expand Down Expand Up @@ -606,10 +600,7 @@ def step(context, username):

@Given('user "|any|" has logged out of the client-UI')
def step(context, username):
waitFor(
lambda: isFolderSynced(context.userData['clientSyncPath']),
context.userData['clientSyncTimeout'] * 1000,
)
waitForFolderToBeSynced(context, '/')
# TODO: find some way to dynamically to check if files are synced
# It might take some time for all files to sync
snooze(5)
Expand Down Expand Up @@ -651,10 +642,7 @@ def step(context, username, host):
)
)

waitFor(
lambda: isFolderSynced(context.userData['clientSyncPath']),
context.userData['clientSyncTimeout'] * 1000,
)
waitForFolderToBeSynced(context, '/')
accountStatus = AccountStatus()
accountStatus.removeConnection()

Expand Down

0 comments on commit 67e325b

Please sign in to comment.