diff options
author | Swikriti Tripathi <41103328+SwikritiT@users.noreply.github.com> | 2021-05-21 11:13:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 11:13:22 +0300 |
commit | 05a51a0dcae058a630ecb0453214744c8175aff1 (patch) | |
tree | b5c590a4bcac6527c83820c502f345d05c2473fb /test/gui | |
parent | effd2f7897d7a4d0245b6c08766ba1d0d3ba1189 (diff) |
[tests-only] Set polling interval by default (#8646)
Diffstat (limited to 'test/gui')
-rw-r--r-- | test/gui/shared/steps/steps.py | 33 | ||||
-rw-r--r-- | test/gui/tst_sharing/test.feature | 2 | ||||
-rw-r--r-- | test/gui/tst_syncing/test.feature | 8 |
3 files changed, 17 insertions, 26 deletions
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index 3c00ef760..5f107227b 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -97,7 +97,16 @@ def startClient(context): snooze(1) -def setUpClient(context, username, password, pollingInterval): +def getPollingInterval(): + pollingInterval = '''[ownCloud] + remotePollInterval={pollingInterval} + ''' + args = {'pollingInterval': 5000} + pollingInterval = pollingInterval.format(**args) + return pollingInterval + + +def setUpClient(context, username, password): userSetting = ''' [Accounts] 0/Folders/1/ignoreHiddenFiles=true @@ -116,7 +125,7 @@ def setUpClient(context, username, password, pollingInterval): version=2 ''' userFirstName = username.split() - userSetting = userSetting + pollingInterval + userSetting = userSetting + getPollingInterval() args = { 'displayUserName': username, 'davUserName': userFirstName[0].lower(), @@ -139,27 +148,9 @@ def setUpClient(context, username, password, pollingInterval): pass -def getPasswordForUser(userId): - if userId in defaultUsers.keys(): - return defaultUsers[userId]['password'] - - -@Given( - 'user "|any|" has set up a client with default settings and polling interval "|any|"' -) -def step(context, username, interval): - pollingInterval = '''[ownCloud] - remotePollInterval={pollingInterval} - ''' - args = {'pollingInterval': interval} - pollingInterval = pollingInterval.format(**args) - password = getPasswordForUser(username) - setUpClient(context, username, password, pollingInterval) - - @Given('user "|any|" has set up a client with default settings and password "|any|"') def step(context, username, password): - setUpClient(context, username, password, '') + setUpClient(context, username, password) @Given('the user has started the client') diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature index 83cb547e2..e434ed566 100644 --- a/test/gui/tst_sharing/test.feature +++ b/test/gui/tst_sharing/test.feature @@ -34,7 +34,7 @@ Feature: Sharing And user "Alice" has shared folder "simple-folder" on the server with user "Brian" And user "Brian" has accepted the share "simple-folder" on the server offered by user "Alice" And user "Brian" has shared folder "Shares/simple-folder" on the server with user "Carol" - And user "Brian" has set up a client with default settings and polling interval "5000" + And user "Brian" has set up a client with default settings and password "AaBb2Cc3Dd4" And user "Alice" has updated the share permissions on the server for folder "/simple-folder" to "read" for user "Brian" When user "Brian" opens the sharing dialog of "%client_sync_path%/Shares/simple-folder" using the client-UI Then the error text "The file can not be shared because it was shared without sharing permission." should be displayed in the sharing dialog diff --git a/test/gui/tst_syncing/test.feature b/test/gui/tst_syncing/test.feature index 1611ae276..200446bae 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -8,7 +8,7 @@ Feature: Syncing files Given user "Alice" has been created on the server with default attributes and without skeleton files Scenario: Syncing a file to the server - Given user "Alice" has set up a client with default settings and polling interval "5000" + Given user "Alice" has set up a client with default settings and password "1234" When the user creates a file "lorem-for-upload.txt" with the following content on the file system """ test content @@ -17,7 +17,7 @@ Feature: Syncing files Then as "Alice" the file "lorem-for-upload.txt" on the server should have the content "test content" Scenario: Syncing a file from the server - Given user "Alice" has set up a client with default settings and polling interval "5000" + Given user "Alice" has set up a client with default settings and password "1234" And user "Alice" has uploaded file on the server with content "test content" to "uploaded-lorem.txt" When the user waits for file "uploaded-lorem.txt" to be synced Then the file "uploaded-lorem.txt" should exist on the file system with the following content @@ -27,7 +27,7 @@ Feature: Syncing files Scenario: Syncing a file from the server and creating a conflict Given user "Alice" has uploaded file on the server with content "server content" to "/conflict.txt" - And user "Alice" has set up a client with default settings and polling interval "5000" + And user "Alice" has set up a client with default settings and password "1234" And the user has waited for file "conflict.txt" to be synced And the user has paused the file sync And the user has changed the content of local file "conflict.txt" to: @@ -47,4 +47,4 @@ Feature: Syncing files And a conflict file for "conflict.txt" should exist on the file system with the following content """ client content - """
\ No newline at end of file + """ |