diff options
author | swoichha <swoichhaa@gmail.com> | 2021-04-15 12:42:38 +0300 |
---|---|---|
committer | Artur Neumann <artur@jankaritech.com> | 2021-04-15 14:23:09 +0300 |
commit | d9a9d2105e5c5ae0eaf2127c135289c434ab411c (patch) | |
tree | 64c8dab4a736a8e497a2983c1768bb2befcbf5e9 /test | |
parent | 850aa0486c34f1b96fb9e73b257e14f80a936a00 (diff) |
refactor step with poll interval
Diffstat (limited to 'test')
-rw-r--r-- | test/gui/shared/steps/steps.py | 38 | ||||
-rw-r--r-- | test/gui/tst_sharing/test.feature | 2 | ||||
-rw-r--r-- | test/gui/tst_syncing/test.feature | 6 |
3 files changed, 39 insertions, 7 deletions
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index 06e9125e9..b4eaa8efd 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -20,6 +20,29 @@ confdir = '/tmp/bdd-tests-owncloud-client/' confFilePath = confdir + 'owncloud.cfg' socketConnect = None +passwords = { + 'alt1': '1234', + 'alt2': 'AaBb2Cc3Dd4', + 'alt3': 'aVeryLongPassword42TheMeaningOfLife' +} + +defaultUsers = { + 'Alice': { + 'displayname': 'Alice Hansen', + 'password': passwords['alt1'], + 'email': 'alice@example.org' + }, + 'Brian': { + 'displayname': 'Brian Murphy', + 'password': passwords['alt2'], + 'email': 'brian@example.org' + }, + 'Carol': { + 'displayname': 'Carol King', + 'password': passwords['alt3'], + 'email': 'carol@example.org' + } +} @OnScenarioStart def hook(context): @@ -88,11 +111,20 @@ def setUpClient(context, username, password, pollingInterval): except LookupError: pass -@Given('user "|any|" has set up a client with poll interval settings and password "|any|"') -def step(context, username, password): +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=5000 + 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|"') diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature index 7dfef9445..d2eecdd9e 100644 --- a/test/gui/tst_sharing/test.feature +++ b/test/gui/tst_sharing/test.feature @@ -30,7 +30,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 poll interval settings and password "AaBb2Cc3Dd4" + And user "Brian" has set up a client with default settings and polling interval "5000" 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 bd8125bea..25871df88 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -6,7 +6,7 @@ Feature: Syncing files Scenario: Syncing a file to the server Given user "Alice" has been created on the server with default attributes - And user "Alice" has set up a client with poll interval settings and password "1234" + And user "Alice" has set up a client with default settings and polling interval "5000" When the user creates a file "lorem-for-upload.txt" with the following content on the file system """ test content @@ -16,7 +16,7 @@ Feature: Syncing files Scenario: Syncing a file from the server Given user "Alice" has been created on the server with default attributes - And user "Alice" has set up a client with poll interval settings and password "1234" + And user "Alice" has set up a client with default settings and polling interval "5000" 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 @@ -26,7 +26,7 @@ Feature: Syncing files Scenario: Syncing a file from the server and creating a conflict Given user "Alice" has been created on the server with default attributes - And user "Alice" has set up a client with poll interval settings and password "1234" + And user "Alice" has set up a client with default settings and polling interval "5000" And user "Alice" has uploaded file on the server with content "test content" to "uploaded-lorem.txt" And the user has waited for file "conflict.txt" to be synced And the user has paused the file sync |