Skip to content

Commit

Permalink
[tests-only] refactor steps (#8845)
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha authored Aug 2, 2021
1 parent 89a8085 commit 6882ece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 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
6 changes: 3 additions & 3 deletions test/gui/tst_sharing/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Sharing

Scenario: Collaborator should not see to whom a file is shared.
Given user "Brian" has been created on the server with default attributes and without skeleton files
And user "Alice" has uploaded on the server file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" on the server
And user "Alice" has shared file "/textfile0.txt" on the server with user "Brian" with "read, share" permission
And user "Brian" has set up a client with default settings
When user "Brian" opens the sharing dialog of "%client_sync_path%/textfile0.txt" using the client-UI
Expand All @@ -37,7 +37,7 @@ Feature: Sharing

Scenario: Group sharing
Given group "grp1" has been created on the server
And user "Alice" has uploaded on the server file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" on the server
And user "Alice" has set up a client with default settings
When the user adds group "grp1" as collaborator of resource "%client_sync_path%/textfile0.txt" with permissions "edit,share" using the client-UI
Then group "grp1" should be listed in the collaborators list for file "%client_sync_path%/textfile0.txt" with permissions "edit,share" on the client-UI
Expand All @@ -47,7 +47,7 @@ Feature: Sharing
Given user "Brian" has been created on the server with default attributes and without skeleton files
And group "grp1" has been created on the server
And user "Brian" on the server has been added to group "grp1"
And user "Alice" has uploaded on the server file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" on the server
And user "Alice" has shared file "/textfile0.txt" on the server with user "Brian" with "read, share, update" permission
And user "Alice" has shared file "/textfile0.txt" on the server with group "grp1" with "read, share, update" permission
And user "Brian" has set up a client with default settings
Expand Down

0 comments on commit 6882ece

Please sign in to comment.