diff options
author | Saw-jan Gurung <saw.jan.grg3e@gmail.com> | 2021-11-11 12:13:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-11 12:13:59 +0300 |
commit | 564b156e888f1396bf4303dd0ef5d904c592c517 (patch) | |
tree | ef25b42201f7ff81c07457c1e8ae5e5a37e7956b /test/gui | |
parent | 48c701ef2c881794150f77209a5528daca57843d (diff) |
create sync path per user (#9123)
remove inline sync path code
fix tests
address reviews
create sync path only when the user is being added to the client
fix sync test steps
address reviews
Diffstat (limited to 'test/gui')
-rw-r--r-- | test/gui/config.sample.ini | 3 | ||||
-rw-r--r-- | test/gui/shared/scripts/bdd_hooks.py | 39 | ||||
-rw-r--r-- | test/gui/shared/scripts/helpers/SetupClientHelper.py | 45 | ||||
-rw-r--r-- | test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py | 11 | ||||
-rw-r--r-- | test/gui/shared/scripts/pageObjects/PublicLinkDialog.py | 2 | ||||
-rw-r--r-- | test/gui/shared/steps/steps.py | 87 | ||||
-rw-r--r-- | test/gui/tst_addAccount/test.feature | 14 | ||||
-rw-r--r-- | test/gui/tst_removeAccountConnection/test.feature | 7 | ||||
-rw-r--r-- | test/gui/tst_sharing/test.feature | 52 | ||||
-rw-r--r-- | test/gui/tst_syncing/test.feature | 86 |
10 files changed, 179 insertions, 167 deletions
diff --git a/test/gui/config.sample.ini b/test/gui/config.sample.ini index e5d01dad4..6f0c18bdd 100644 --- a/test/gui/config.sample.ini +++ b/test/gui/config.sample.ini @@ -2,7 +2,6 @@ BACKEND_HOST= SECURE_BACKEND_HOST= MIDDLEWARE_URL= -CLIENT_SYNC_PATH_USER1= -CLIENT_SYNC_PATH_USER2= +CLIENT_ROOT_SYNC_PATH= CLIENT_SYNC_TIMEOUT= CLIENT_LOG_FILE=
\ No newline at end of file diff --git a/test/gui/shared/scripts/bdd_hooks.py b/test/gui/shared/scripts/bdd_hooks.py index 77622152e..848b64580 100644 --- a/test/gui/shared/scripts/bdd_hooks.py +++ b/test/gui/shared/scripts/bdd_hooks.py @@ -31,8 +31,7 @@ def hook(context): 'clientSyncTimeout': 'CLIENT_SYNC_TIMEOUT', 'middlewareUrl': 'MIDDLEWARE_URL', 'clientConfigFile': 'CLIENT_LOG_FILE', - 'clientSyncPathUser1': 'CLIENT_SYNC_PATH_USER1', - 'clientSyncPathUser2': 'CLIENT_SYNC_PATH_USER2', + 'clientRootSyncPath': 'CLIENT_ROOT_SYNC_PATH', } DEFAULT_CONFIG = { @@ -41,8 +40,7 @@ def hook(context): 'clientSyncTimeout': 60, 'middlewareUrl': 'http://localhost:3000/', 'clientConfigFile': '-', - 'clientSyncPathUser1': '/tmp/client-bdd-user1/', - 'clientSyncPathUser2': '/tmp/client-bdd-user2/', + 'clientRootSyncPath': '/tmp/client-bdd/', } # read configs from environment variables @@ -57,8 +55,8 @@ def hook(context): for key, value in context.userData.items(): if value == '': context.userData[key] = cfg.get('DEFAULT', CONFIG_ENV_MAP[key]) - except: - print("Error reading config.ini file!") + except Exception as err: + print(err) # Set the default values if empty for key, value in context.userData.items(): @@ -66,15 +64,17 @@ def hook(context): context.userData[key] = DEFAULT_CONFIG[key] elif key == 'clientSyncTimeout': context.userData[key] = builtins.int(value) - elif key == 'clientSyncPathUser1' or key == 'clientSyncPathUser2': + elif key == 'clientRootSyncPath': # make sure there is always one trailing slash context.userData[key] = value.rstrip('/') + '/' - if not os.path.exists(context.userData['clientSyncPathUser1']): - os.makedirs(context.userData['clientSyncPathUser1']) + # initially set user sync path to root + # this path will be changed according to the user added to the client + # e.g.: /tmp/client-bdd/Alice + context.userData['currentUserSyncPath'] = context.userData['clientRootSyncPath'] - if not os.path.exists(context.userData['clientSyncPathUser2']): - os.makedirs(context.userData['clientSyncPathUser2']) + if not os.path.exists(context.userData['clientRootSyncPath']): + os.makedirs(context.userData['clientRootSyncPath']) req = urllib.request.Request( os.path.join(context.userData['middlewareUrl'], 'init'), @@ -97,20 +97,9 @@ def hook(context): snooze(5) # ToDo wait smarter till the app died # delete local files/folders - for filename in os.listdir(context.userData['clientSyncPathUser1']): - test.log("Deleting :" + filename) - file_path = os.path.join(context.userData['clientSyncPathUser1'], filename) - try: - if os.path.isfile(file_path) or os.path.islink(file_path): - os.unlink(file_path) - elif os.path.isdir(file_path): - shutil.rmtree(file_path) - except Exception as e: - print('Failed to delete %s. Reason: %s' % (file_path, e)) - - for filename in os.listdir(context.userData['clientSyncPathUser2']): - test.log("Deleting :" + filename) - file_path = os.path.join(context.userData['clientSyncPathUser2'], filename) + for filename in os.listdir(context.userData['clientRootSyncPath']): + test.log("Deleting: " + filename) + file_path = os.path.join(context.userData['clientRootSyncPath'], filename) try: if os.path.isfile(file_path) or os.path.islink(file_path): os.unlink(file_path) diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index ae3a60341..0d62e17b2 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -1,5 +1,7 @@ from urllib.parse import urlparse import squish +from os import makedirs +from os.path import exists, join confdir = '/tmp/bdd-tests-owncloud-client/' @@ -12,10 +14,10 @@ def substituteInLineCodes(context, value): '%secure_local_server%', context.userData['secureLocalBackendUrl'] ) value = value.replace( - '%client_sync_path_user1%', context.userData['clientSyncPathUser1'] + '%client_root_sync_path%', context.userData['clientRootSyncPath'] ) value = value.replace( - '%client_sync_path_user2%', context.userData['clientSyncPathUser2'] + '%current_user_sync_path%', context.userData['currentUserSyncPath'] ) value = value.replace( '%local_server_hostname%', urlparse(context.userData['localBackendUrl']).netloc @@ -25,7 +27,7 @@ def substituteInLineCodes(context, value): def getClientDetails(context): - clientDetails = {'server': '', 'user': '', 'password': '', 'localfolder': ''} + clientDetails = {'server': '', 'user': '', 'password': ''} for row in context.table[0:]: row[1] = substituteInLineCodes(context, row[1]) if row[0] == 'server': @@ -34,15 +36,35 @@ def getClientDetails(context): clientDetails.update({'user': row[1]}) elif row[0] == 'password': clientDetails.update({'password': row[1]}) - elif row[0] == 'localfolder': - clientDetails.update({'localfolder': row[1]}) - try: - os.makedirs(localfolder, 0o0755) - except: - pass return clientDetails +def createUserSyncPath(context, username): + userSyncPath = join(context.userData['clientRootSyncPath'], username) + if not exists(userSyncPath): + makedirs(userSyncPath) + + setCurrentUserSyncPath(context, username) + return userSyncPath + + +def getUserSyncPath(context, username): + return createUserSyncPath(context, username) + + +def setCurrentUserSyncPath(context, user): + syncPath = join(context.userData['clientRootSyncPath'], user, '') + context.userData['currentUserSyncPath'] = syncPath + + +def getResourcePath(context, resource, user=None): + resource == resource.strip('/') + if not user == None: + return join(context.userData['clientRootSyncPath'], user, resource) + else: + return join(context.userData['currentUserSyncPath'], resource) + + def startClient(context): squish.startApplication( "owncloud -s" @@ -85,11 +107,14 @@ def setUpClient(context, username, displayName, confFilePath): ''' userFirstName = username.split() userSetting = userSetting + getPollingInterval() + + syncPath = createUserSyncPath(context, userFirstName[0]) + args = { 'displayUserName': displayName, 'davUserName': userFirstName[0].lower(), 'displayUserFirstName': userFirstName[0], - 'client_sync_path': context.userData['clientSyncPathUser1'], + 'client_sync_path': syncPath, 'local_server': context.userData['localBackendUrl'], } userSetting = userSetting.format(**args) diff --git a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py index 4fa2f233c..aaef3decd 100644 --- a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py +++ b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py @@ -1,6 +1,6 @@ import names import squish -from helpers.SetupClientHelper import getClientDetails +from helpers.SetupClientHelper import getClientDetails, createUserSyncPath import test @@ -87,6 +87,7 @@ class AccountConnectionWizard: def addUserCreds(self, context): clientDetails = getClientDetails(context) + squish.type(squish.waitForObject(self.USERNAME_BOX), clientDetails['user']) squish.type(squish.waitForObject(self.USERNAME_BOX), "<Tab>") squish.type(squish.waitForObject(self.PASSWORD_BOX), clientDetails['password']) @@ -94,6 +95,8 @@ class AccountConnectionWizard: def selectSyncFolder(self, context): clientDetails = getClientDetails(context) + # create sync folder for user + syncPath = createUserSyncPath(context, clientDetails['user']) try: squish.clickButton(squish.waitForObject(self.ERROR_OK_BUTTON)) @@ -101,13 +104,11 @@ class AccountConnectionWizard: pass squish.clickButton(squish.waitForObject(self.SELECT_LOCAL_FOLDER)) squish.mouseClick(squish.waitForObject(self.DIRECTORY_NAME_BOX)) - squish.type( - squish.waitForObject(self.DIRECTORY_NAME_BOX), clientDetails['localfolder'] - ) + squish.type(squish.waitForObject(self.DIRECTORY_NAME_BOX), syncPath) squish.clickButton(squish.waitForObject(self.CHOOSE_BUTTON)) test.compare( str(squish.waitForObjectExists(self.SELECT_LOCAL_FOLDER).text), - self.sanitizeFolderPath(clientDetails['localfolder']), + self.sanitizeFolderPath(syncPath), ) def connectAccount(self): diff --git a/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py b/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py index f89baa171..b6e7f0768 100644 --- a/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py +++ b/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py @@ -76,7 +76,7 @@ class PublicLinkDialog: test.compare( str(squish.waitForObjectExists(self.ITEM_TO_SHARE).text), - resource.replace(context.userData['clientSyncPathUser1'], ''), + resource.replace(context.userData['currentUserSyncPath'], ''), ) if radioObjectName: diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index 5791e8c71..d1421b236 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -166,7 +166,7 @@ def isFileSynced(fileName): def waitForFileToBeSynced(context, fileName): waitFor( lambda: isFileSynced( - sanitizePath(context.userData['clientSyncPathUser1'] + fileName) + sanitizePath(context.userData['currentUserSyncPath'] + fileName) ), context.userData['clientSyncTimeout'] * 1000, ) @@ -175,7 +175,7 @@ def waitForFileToBeSynced(context, fileName): def waitForFolderToBeSynced(context, folderName): waitFor( lambda: isFolderSynced( - sanitizePath(context.userData['clientSyncPathUser1'] + folderName) + sanitizePath(context.userData['currentUserSyncPath'] + folderName) ), context.userData['clientSyncTimeout'] * 1000, ) @@ -266,7 +266,7 @@ def step(context, receiver, resource, permissions): def collaboratorShouldBeListed(context, receiver, resource, permissions): - resource = substituteInLineCodes(context, resource) + resource = getResourcePath(context, resource) socketConnect = syncstate.SocketConnect() socketConnect.sendCommand("SHARE:" + resource + "\n") permissionsList = permissions.split(',') @@ -304,43 +304,55 @@ def step(context, fileName): @Given( - 'the user has created a file "|any|" with the following content on the file system' + 'user "|any|" has created a file "|any|" with the following content inside the sync folder' ) -def step(context, filename): - createFile(context, filename) +def step(context, username, filename): + createFile(context, filename, username) -@When('the user creates a file "|any|" with the following content on the file system') -def step(context, filename): - createFile(context, filename) +@When( + 'user "|any|" creates a file "|any|" with the following content inside the sync folder' +) +def step(context, username, filename): + createFile(context, filename, username) -def createFile(context, filename): +def createFile(context, filename, username=None): fileContent = "\n".join(context.multiLineText) - f = open(context.userData['clientSyncPathUser1'] + filename, "w") + syncPath = None + if username: + syncPath = getUserSyncPath(context, username) + else: + syncPath = context.userData['currentUserSyncPath'] + f = open(join(syncPath, filename), "w") f.write(fileContent) f.close() -@When('the user creates a folder "|any|"') -def step(context, foldername): - createFolder(context, foldername) +@When('user "|any|" creates a folder "|any|" inside the sync folder') +def step(context, username, foldername): + createFolder(context, foldername, username) -@Given('the user has created a folder "|any|"') -def step(context, foldername): - createFolder(context, foldername) +@Given('user "|any|" has created a folder "|any|" inside the sync folder') +def step(context, username, foldername): + createFolder(context, foldername, username) -def createFolder(context, foldername): - path = join(context.userData['clientSyncPathUser1'], foldername) +def createFolder(context, foldername, username=None): + syncPath = None + if username: + syncPath = getUserSyncPath(context, username) + else: + syncPath = context.userData['currentUserSyncPath'] + path = join(syncPath, foldername) os.makedirs(path) @When('the user copies the folder "|any|" to "|any|"') def step(context, sourceFolder, destinationFolder): - source_dir = join(context.userData['clientSyncPathUser1'], sourceFolder) - destination_dir = join(context.userData['clientSyncPathUser1'], destinationFolder) + source_dir = join(context.userData['currentUserSyncPath'], sourceFolder) + destination_dir = join(context.userData['currentUserSyncPath'], destinationFolder) shutil.copytree(source_dir, destination_dir) @@ -371,7 +383,7 @@ def step(context, stepPart1): @Then('the file "|any|" should exist on the file system with the following content') def step(context, filePath): expected = "\n".join(context.multiLineText) - filePath = context.userData['clientSyncPathUser1'] + filePath + filePath = context.userData['currentUserSyncPath'] + filePath f = open(filePath, 'r') contents = f.read() test.compare( @@ -385,7 +397,7 @@ def step(context, filePath): @Then(r'^the (file|folder) "([^"]*)" should exist on the file system$', regexp=True) def step(context, resourceType, resource): - resourcePath = join(context.userData['clientSyncPathUser1'], resource) + resourcePath = join(context.userData['currentUserSyncPath'], resource) resourceExists = False if resourceType == 'file': resourceExists = fileExists( @@ -407,7 +419,7 @@ def step(context, resourceType, resource): @Then(r'^the (file|folder) "([^"]*)" should not exist on the file system$', regexp=True) def step(context, resourceType, resource): - resourcePath = join(context.userData['clientSyncPathUser1'], resource) + resourcePath = join(context.userData['currentUserSyncPath'], resource) resourceExists = False if resourceType == 'file': resourceExists = fileExists(resourcePath, 1000) @@ -433,7 +445,7 @@ def step(context): @Given('the user has changed the content of local file "|any|" to:') def step(context, filename): fileContent = "\n".join(context.multiLineText) - f = open(context.userData['clientSyncPathUser1'] + filename, "w") + f = open(context.userData['currentUserSyncPath'] + filename, "w") f.write(fileContent) f.close() @@ -466,14 +478,14 @@ def step(context, filename): extpart = filename.split('.')[1] onlyfiles = [ f - for f in listdir(context.userData['clientSyncPathUser1']) - if isfile(join(context.userData['clientSyncPathUser1'], f)) + for f in listdir(context.userData['currentUserSyncPath']) + if isfile(join(context.userData['currentUserSyncPath'], f)) ] found = False pattern = re.compile(buildConflictedRegex(filename)) for file in onlyfiles: if pattern.match(file): - f = open(context.userData['clientSyncPathUser1'] + file, 'r') + f = open(context.userData['currentUserSyncPath'] + file, 'r') contents = f.read() if contents == expected: found = True @@ -528,7 +540,7 @@ def step(context, tabName): def openSharingDialog(context, resource, itemType='file'): - resource = sanitizePath(substituteInLineCodes(context, resource)) + resource = getResourcePath(context, resource) if itemType == 'folder': waitFor( @@ -549,7 +561,6 @@ def openSharingDialog(context, resource, itemType='file'): @When('the user opens the public links dialog of "|any|" using the client-UI') def step(context, resource): - resource = sanitizePath(substituteInLineCodes(context, resource)) openSharingDialog(context, resource) publicLinkDialog = PublicLinkDialog() publicLinkDialog.openPublicLinkDialog() @@ -573,8 +584,8 @@ def step(context): waitFor(lambda: (test.xvp("publicLinkPasswordProgressIndicatorInvisible"))) -@When('user "|any|" opens the sharing dialog of "|any|" using the client-UI') -def step(context, receiver, resource): +@When('the user opens the sharing dialog of "|any|" using the client-UI') +def step(context, resource): openSharingDialog(context, resource, 'folder') @@ -603,7 +614,7 @@ def step(context, fileShareContext): def createPublicLinkShare(context, resource, password='', permissions=''): - resource = sanitizePath(substituteInLineCodes(context, resource)) + resource = getResourcePath(context, resource) openSharingDialog(context, resource) publicLinkDialog = PublicLinkDialog() publicLinkDialog.openPublicLinkDialog() @@ -860,7 +871,7 @@ def step(context, resource, content): snooze(5) - f = open(context.userData['clientSyncPathUser1'] + resource, "w") + f = open(context.userData['currentUserSyncPath'] + resource, "w") f.write(content) f.close() @@ -949,7 +960,7 @@ def step(context, errorMsg): @When(r'the user deletes the (file|folder) "([^"]*)"', regexp=True) def step(context, itemType, resource): - resourcePath = sanitizePath(context.userData['clientSyncPathUser1'] + resource) + resourcePath = sanitizePath(context.userData['currentUserSyncPath'] + resource) if itemType == 'file': os.remove(resourcePath) elif itemType == 'folder': @@ -997,12 +1008,6 @@ def step(context): ) -@Given('the user has changed the sync directory') -def step(context): - newAccount = AccountConnectionWizard() - newAccount.selectSyncFolder(context) - - @Given('the user has opened chose_what_to_sync dialog') def step(context): newAccount = AccountConnectionWizard() diff --git a/test/gui/tst_addAccount/test.feature b/test/gui/tst_addAccount/test.feature index b8828263f..e82941c5b 100644 --- a/test/gui/tst_addAccount/test.feature +++ b/test/gui/tst_addAccount/test.feature @@ -11,10 +11,9 @@ Feature: adding accounts Scenario: Adding normal Account Given the user has started the client When the user adds the first account with - | server | %local_server% | - | user | Alice | - | password | 1234 | - | localfolder | %client_sync_path_user1% | + | server | %local_server% | + | user | Alice | + | password | 1234 | Then an account should be displayed with the displayname Alice Hansen and host %local_server_hostname% @@ -22,10 +21,9 @@ Feature: adding accounts Given user "Brian" has been created on the server with default attributes and without skeleton files And user "Alice" has set up a client with default settings When the user adds another account with - | server | %local_server% | - | user | Brian | - | password | AaBb2Cc3Dd4 | - | localfolder | %client_sync_path_user2% | + | server | %local_server% | + | user | Brian | + | password | AaBb2Cc3Dd4 | Then an account should be displayed with the displayname Alice Hansen and host %local_server_hostname% And an account should be displayed with the displayname Brian Murphy and host %local_server_hostname% diff --git a/test/gui/tst_removeAccountConnection/test.feature b/test/gui/tst_removeAccountConnection/test.feature index 77d4a0559..2b78d04d9 100644 --- a/test/gui/tst_removeAccountConnection/test.feature +++ b/test/gui/tst_removeAccountConnection/test.feature @@ -10,10 +10,9 @@ Feature: remove account connection And user "Brian" has been created on the server with default attributes and without skeleton files And user "Alice" has set up a client with default settings And the user has added another account with - | server | %local_server% | - | user | Brian | - | password | AaBb2Cc3Dd4 | - | localfolder | %client_sync_path_user2% | + | server | %local_server% | + | user | Brian | + | password | AaBb2Cc3Dd4 | When the user removes the connection for user "Brian" and host %local_server_hostname% Then an account should be displayed with the displayname Alice Hansen and host %local_server_hostname% diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature index 07e3f4f31..e9638de37 100644 --- a/test/gui/tst_sharing/test.feature +++ b/test/gui/tst_sharing/test.feature @@ -13,8 +13,8 @@ Feature: Sharing Given user "Brian" has been created on the server with default attributes and without skeleton files 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 "Brian Murphy" as collaborator of resource "%client_sync_path_user1%/textfile0.txt" with permissions "edit,share" using the client-UI - Then user "Brian Murphy" should be listed in the collaborators list for file "%client_sync_path_user1%/textfile0.txt" with permissions "edit,share" on the client-UI + When the user adds "Brian Murphy" as collaborator of resource "textfile0.txt" with permissions "edit,share" using the client-UI + Then user "Brian Murphy" should be listed in the collaborators list for file "textfile0.txt" with permissions "edit,share" on the client-UI Scenario: Share files/folders with special characters in their name @@ -22,16 +22,16 @@ Feature: Sharing And user "Alice" has created folder "SampleFolder,With,$pecial?Characters" on the server And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/$ample1?.txt" on the server And user "Alice" has set up a client with default settings - When the user adds "Brian Murphy" as collaborator of resource "%client_sync_path_user1%/SampleFolder,With,$pecial?Characters" with permissions "edit,share" using the client-UI - And the user adds "Brian Murphy" as collaborator of resource "%client_sync_path_user1%/$ample1?.txt" with permissions "edit,share" using the client-UI - Then user "Brian Murphy" should be listed in the collaborators list for file "%client_sync_path_user1%/SampleFolder,With,$pecial?Characters" with permissions "edit,share" on the client-UI - And user "Brian Murphy" should be listed in the collaborators list for file "%client_sync_path_user1%/$ample1?.txt" with permissions "edit,share" on the client-UI + When the user adds "Brian Murphy" as collaborator of resource "SampleFolder,With,$pecial?Characters" with permissions "edit,share" using the client-UI + And the user adds "Brian Murphy" as collaborator of resource "$ample1?.txt" with permissions "edit,share" using the client-UI + Then user "Brian Murphy" should be listed in the collaborators list for file "SampleFolder,With,$pecial?Characters" with permissions "edit,share" on the client-UI + And user "Brian Murphy" should be listed in the collaborators list for file "$ample1?.txt" with permissions "edit,share" on the client-UI @issue-7459 Scenario: Progress indicator should not be visible after unselecting the password protection checkbox while sharing through public link Given 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 opens the public links dialog of "%client_sync_path_user1%/textfile0.txt" using the client-UI + When the user opens the public links dialog of "textfile0.txt" using the client-UI And the user toggles the password protection using the client-UI And the user toggles the password protection using the client-UI Then the password progress indicator should not be visible in the client-UI - expected to fail @@ -42,7 +42,7 @@ Feature: Sharing 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_user1%/textfile0.txt" using the client-UI + When the user opens the sharing dialog of "textfile0.txt" using the client-UI Then the error text "The item is not shared with any users or groups" should be displayed in the sharing dialog @@ -50,8 +50,8 @@ Feature: Sharing Given group "grp1" has been created on the server 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_user1%/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_user1%/textfile0.txt" with permissions "edit,share" on the client-UI + When the user adds group "grp1" as collaborator of resource "textfile0.txt" with permissions "edit,share" using the client-UI + Then group "grp1" should be listed in the collaborators list for file "textfile0.txt" with permissions "edit,share" on the client-UI Scenario: User (non-author) can not share to a group to which the file is already shared @@ -62,7 +62,7 @@ Feature: Sharing 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 - When the user tires to share resource "%client_sync_path_user1%/textfile0.txt" with the group "grp1" using the client-UI + When the user tires to share resource "textfile0.txt" with the group "grp1" using the client-UI Then the error "Path already shared with this group" should be displayed @@ -92,7 +92,7 @@ Feature: Sharing 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 "all" permissions And user "Alice" has set up a client with default settings - When the user unshares the resource "%client_sync_path_user1%/textfile0.txt" for collaborator "Brian Murphy" using the client-UI + When the user unshares the resource "textfile0.txt" for collaborator "Brian Murphy" using the client-UI Then the text "The item is not shared with any users or groups" should be displayed in the sharing dialog And as "Brian" file "textfile0.txt" on the server should not exist @@ -103,7 +103,7 @@ Feature: Sharing And user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" on the server And user "Alice" has shared folder "simple-folder" on the server with user "Brian" with "all" permissions And user "Alice" has set up a client with default settings - When the user unshares the resource "%client_sync_path_user1%/simple-folder" for collaborator "Brian Murphy" using the client-UI + When the user unshares the resource "simple-folder" for collaborator "Brian Murphy" using the client-UI Then the text "The item is not shared with any users or groups" should be displayed in the sharing dialog And as "Brian" folder "simple-folder" on the server should not exist @@ -119,14 +119,14 @@ Feature: Sharing 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 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_user1%/Shares/simple-folder" using the client-UI + When the user opens the sharing dialog of "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 @smokeTest Scenario: simple sharing of a file by public link without password Given 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 creates a new public link for file "%client_sync_path_user1%/textfile0.txt" without password using the client-UI + When the user creates a new public link for file "textfile0.txt" without password using the client-UI Then as user "Alice" the file "textfile0.txt" should have a public link on the server And the public should be able to download the file "textfile0.txt" without password from the last created public link by "Alice" on the server @@ -134,7 +134,7 @@ Feature: Sharing Scenario: simple sharing of a file by public link with password Given user "Alice" has set up a client with default settings And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" on the server - When the user creates a new public link for file "%client_sync_path_user1%/textfile0.txt" with password "pass123" using the client-UI + When the user creates a new public link for file "textfile0.txt" with password "pass123" using the client-UI Then as user "Alice" the file "textfile0.txt" should have a public link on the server And the public should be able to download the file "textfile0.txt" with password "pass123" from the last created public link by "Alice" on the server @@ -146,7 +146,7 @@ Feature: Sharing | path | textfile0.txt | | name | Public link | | expireDate | 2031-10-14 | - When the user opens the public links dialog of "%client_sync_path_user1%/textfile0.txt" using the client-UI + When the user opens the public links dialog of "textfile0.txt" using the client-UI And the user edits the public link named "Public link" of file "textfile0.txt" changing following | expireDate | 2038-07-21 | Then the fields of the last public link share response of user "Alice" should include on the server @@ -156,7 +156,7 @@ Feature: Sharing Scenario: simple sharing of a folder by public link without password Given user "Alice" has created folder "simple-folder" on the server And user "Alice" has set up a client with default settings - When the user creates a new public link with permissions "Download / View" for folder "%client_sync_path_user1%/simple-folder" without password using the client-UI + When the user creates a new public link with permissions "Download / View" for folder "simple-folder" without password using the client-UI Then as user "Alice" the folder "simple-folder" should have a public link on the server And the public should be able to download the folder "lorem.txt" without password from the last created public link by "Alice" on the server @@ -164,7 +164,7 @@ Feature: Sharing Scenario: simple sharing of a folder by public link with password Given user "Alice" has created folder "simple-folder" on the server And user "Alice" has set up a client with default settings - When the user creates a new public link with permissions "Download / View" for folder "%client_sync_path_user1%/simple-folder" with password "pass123" using the client-UI + When the user creates a new public link with permissions "Download / View" for folder "simple-folder" with password "pass123" using the client-UI Then as user "Alice" the folder "simple-folder" should have a public link on the server And the public should be able to download the folder "lorem.txt" with password "pass123" from the last created public link by "Alice" on the server @@ -177,7 +177,7 @@ Feature: Sharing | name | Public link | | expireDate | 2031-10-14 | | permissions | read, update, create, delete | - When the user opens the public links dialog of "%client_sync_path_user1%/simple-folder" using the client-UI + When the user opens the public links dialog of "simple-folder" using the client-UI And the user edits the public link named "Public link" of file "simple-folder" changing following | expireDate | 2038-07-21 | Then the fields of the last public link share response of user "Alice" on the server should include @@ -187,7 +187,7 @@ Feature: Sharing Scenario Outline: simple sharing of folder by public link with different roles Given user "Alice" has created folder "simple-folder" on the server And user "Alice" has set up a client with default settings - When the user creates a new public link for folder "%client_sync_path_user1%/simple-folder" using the client-UI with these details: + When the user creates a new public link for folder "simple-folder" using the client-UI with these details: | role | <role> | Then user "Alice" on the server should have a share with these details: | field | value | @@ -207,7 +207,7 @@ Feature: Sharing Given user "Alice" has created folder "simple-folder" on the server And user "Alice" has created file "simple-folder/lorem.txt" on the server And user "Alice" has set up a client with default settings - When the user creates a new public link for folder "%client_sync_path_user1%/simple-folder" with "Contributor" using the client-UI + When the user creates a new public link for folder "simple-folder" with "Contributor" using the client-UI Then user "Alice" on the server should have a share with these details: | field | value | | share_type | public_link | @@ -225,11 +225,11 @@ Feature: Sharing And user "Alice" has shared folder "simple-folder" on the server with user "Brian" with "all" permissions And user "Alice" has shared file "lorem.txt" on the server with user "Brian" with "all" permissions And user "Alice" has set up a client with default settings - When the user removes permissions "<permissions>" for user "Brian Murphy" of resource "%client_sync_path_user1%/simple-folder" using the client-UI + When the user removes permissions "<permissions>" for user "Brian Murphy" of resource "simple-folder" using the client-UI And the user closes the sharing dialog - And the user removes permissions "<permissions>" for user "Brian Murphy" of resource "%client_sync_path_user1%/lorem.txt" using the client-UI - Then "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "%client_sync_path_user1%/simple-folder" on the client-UI - And "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "%client_sync_path_user1%/lorem.txt" on the client-UI + And the user removes permissions "<permissions>" for user "Brian Murphy" of resource "lorem.txt" using the client-UI + Then "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "simple-folder" on the client-UI + And "<permissions>" permissions should not be displayed for user "Brian Murphy" for resource "lorem.txt" on the client-UI And user "Alice" on the server should have a share with these details: | field | value | | uid_owner | Alice | diff --git a/test/gui/tst_syncing/test.feature b/test/gui/tst_syncing/test.feature index eca30085b..b3d71d523 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -10,7 +10,7 @@ Feature: Syncing files @smokeTest Scenario: Syncing a file to the server Given user "Alice" has set up a client with default settings - When the user creates a file "lorem-for-upload.txt" with the following content on the file system + When user "Alice" creates a file "lorem-for-upload.txt" with the following content inside the sync folder """ test content """ @@ -63,10 +63,9 @@ Feature: Syncing files And user "Alice" has created folder "large-folder" on the server And the user has started the client And the user has added the following account information: - | server | %local_server% | - | user | Alice | - | password | 1234 | - | localfolder | %client_sync_path_user1% | + | server | %local_server% | + | user | Alice | + | password | 1234 | When the user opens chose_what_to_sync dialog Then the dialog chose_what_to_sync should be visible And the sync all checkbox should be checked @@ -77,10 +76,9 @@ Feature: Syncing files And user "Alice" has created folder "large-folder" on the server And the user has started the client And the user has added the following account information: - | server | %local_server% | - | user | Alice | - | password | 1234 | - | localfolder | %client_sync_path_user1% | + | server | %local_server% | + | user | Alice | + | password | 1234 | When the user selects the following folders to sync: | folder | | simple-folder | @@ -96,10 +94,9 @@ Feature: Syncing files And user "Alice" has uploaded file on the server with content "test content" to "lorem.txt" And the user has started the client And the user has added the following account information: - | server | %local_server% | - | user | Alice | - | password | 1234 | - | localfolder | %client_sync_path_user1% | + | server | %local_server% | + | user | Alice | + | password | 1234 | When the user selects manual sync folder option And the user connects the account Then the folder "simple-folder" should not exist on the file system @@ -115,10 +112,9 @@ Feature: Syncing files And user "Alice" has created folder "bFolder" on the server And the user has started the client And the user has added the following account information: - | server | %local_server% | - | user | Alice | - | password | 1234 | - | localfolder | %client_sync_path_user1% | + | server | %local_server% | + | user | Alice | + | password | 1234 | When the user opens chose_what_to_sync dialog # folders are sorted by name in ascending order by default Then the folders should be in the following order: @@ -151,7 +147,7 @@ Feature: Syncing files Scenario Outline: Syncing a folder to the server Given user "Alice" has set up a client with default settings - When the user creates a folder "<foldername>" + When user "Alice" creates a folder "<foldername>" inside the sync folder And the user waits for folder "<foldername>" to be synced Then as "Alice" folder "<foldername>" should exist on the server Examples: @@ -161,35 +157,35 @@ Feature: Syncing files Scenario: Many subfolders can be synced - Given user "Alice" has set up a client with default settings - And the user has created a folder "parent" - When the user creates a folder "parent/subfolderEmpty1" - And the user creates a folder "parent/subfolderEmpty2" - And the user creates a folder "parent/subfolderEmpty3" - And the user creates a folder "parent/subfolderEmpty4" - And the user creates a folder "parent/subfolderEmpty5" - And the user creates a folder "parent/subfolder1" - And the user creates a folder "parent/subfolder2" - And the user creates a folder "parent/subfolder3" - And the user creates a folder "parent/subfolder4" - And the user creates a folder "parent/subfolder5" - And the user creates a file "parent/subfolder1/test.txt" with the following content on the file system + Given user "Alice" has created folder "parent" on the server + And user "Alice" has set up a client with default settings + When user "Alice" creates a folder "parent/subfolderEmpty1" inside the sync folder + And user "Alice" creates a folder "parent/subfolderEmpty2" inside the sync folder + And user "Alice" creates a folder "parent/subfolderEmpty3" inside the sync folder + And user "Alice" creates a folder "parent/subfolderEmpty4" inside the sync folder + And user "Alice" creates a folder "parent/subfolderEmpty5" inside the sync folder + And user "Alice" creates a folder "parent/subfolder1" inside the sync folder + And user "Alice" creates a folder "parent/subfolder2" inside the sync folder + And user "Alice" creates a folder "parent/subfolder3" inside the sync folder + And user "Alice" creates a folder "parent/subfolder4" inside the sync folder + And user "Alice" creates a folder "parent/subfolder5" inside the sync folder + And user "Alice" creates a file "parent/subfolder1/test.txt" with the following content inside the sync folder """ test content """ - And the user creates a file "parent/subfolder2/test.txt" with the following content on the file system + And user "Alice" creates a file "parent/subfolder2/test.txt" with the following content inside the sync folder """ test content """ - And the user creates a file "parent/subfolder3/test.txt" with the following content on the file system + And user "Alice" creates a file "parent/subfolder3/test.txt" with the following content inside the sync folder """ test content """ - And the user creates a file "parent/subfolder4/test.txt" with the following content on the file system + And user "Alice" creates a file "parent/subfolder4/test.txt" with the following content inside the sync folder """ test content """ - And the user creates a file "parent/subfolder5/test.txt" with the following content on the file system + And user "Alice" creates a file "parent/subfolder5/test.txt" with the following content inside the sync folder """ test content """ @@ -208,8 +204,8 @@ Feature: Syncing files Scenario: Both original and copied folders can be synced Given user "Alice" has set up a client with default settings - And the user has created a folder "original" - And the user has created a file "original/test.txt" with the following content on the file system + And user "Alice" has created a folder "original" inside the sync folder + And user "Alice" has created a file "original/test.txt" with the following content inside the sync folder """ test content """ @@ -221,9 +217,9 @@ Feature: Syncing files Scenario: Verify that you can create a subfolder with long name Given user "Alice" has set up a client with default settings - And the user has created a folder "Folder1" - When the user creates a folder "Folder1/really long folder name with some spaces and special char such as $%ñ&" - And the user creates a file "Folder1/really long folder name with some spaces and special char such as $%ñ&/test.txt" with the following content on the file system + And user "Alice" has created a folder "Folder1" inside the sync folder + When user "Alice" creates a folder "Folder1/really long folder name with some spaces and special char such as $%ñ&" inside the sync folder + And user "Alice" creates a file "Folder1/really long folder name with some spaces and special char such as $%ñ&/test.txt" with the following content inside the sync folder """ test content """ @@ -238,9 +234,9 @@ Feature: Syncing files Scenario: Verify pre existing folders in local (Desktop client) are copied over to the server - Given the user has created a folder "Folder1" - And the user has created a folder "Folder1/subFolder1" - And the user has created a folder "Folder1/subFolder1/subFolder2" + Given user "Alice" has created a folder "Folder1" inside the sync folder + And user "Alice" has created a folder "Folder1/subFolder1" inside the sync folder + And user "Alice" has created a folder "Folder1/subFolder1/subFolder2" inside the sync folder And user "Alice" has set up a client with default settings When the user waits for folder "Folder1" to be synced Then as "Alice" folder "Folder1" should exist on the server @@ -250,8 +246,8 @@ Feature: Syncing files Scenario: Filenames that are rejected by the server are reported Given user "Alice" has set up a client with default settings - And the user has created a folder "Folder1" - When the user creates a file "Folder1/a\\a.txt" with the following content on the file system + And user "Alice" has created a folder "Folder1" inside the sync folder + When user "Alice" creates a file "Folder1/a\\a.txt" with the following content inside the sync folder """ test content """ |