Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaw-jan Gurung <saw.jan.grg3e@gmail.com>2021-12-21 09:11:12 +0300
committerGitHub <noreply@github.com>2021-12-21 09:11:12 +0300
commit785cef7544cbff8d169b73705b9ecf9c409b6f10 (patch)
tree880e338bb8b19125da417ec99fe6b9f05ee0c318 /test/gui/shared/steps
parent913af8cc3a476fddbdc0d57d8d94ed4035de8bfb (diff)
add sharing test scenarios (#9190)
add new steps add new steps auto accept shares in Shares folder add another workaround to set public share expiration date fix file overwriting test step address reviews add comments accept shares in root
Diffstat (limited to 'test/gui/shared/steps')
-rw-r--r--test/gui/shared/steps/steps.py116
1 files changed, 110 insertions, 6 deletions
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py
index 3f0df5da4..097d92101 100644
--- a/test/gui/shared/steps/steps.py
+++ b/test/gui/shared/steps/steps.py
@@ -257,6 +257,15 @@ def step(context, resource):
@When(
+ 'the user selects "|any|" as collaborator of resource "|any|" using the client-UI'
+)
+def step(context, receiver, resource):
+ openSharingDialog(context, resource)
+ shareItem = SharingDialog()
+ shareItem.selectCollaborator(receiver)
+
+
+@When(
'the user adds group "|any|" as collaborator of resource "|any|" with permissions "|any|" using the client-UI'
)
def step(context, receiver, resource, permissions):
@@ -612,7 +621,7 @@ def step(context, resource):
@When("the user toggles the password protection using the client-UI")
def step(context):
publicLinkDialog = PublicLinkDialog()
- publicLinkDialog.togglesPassword()
+ publicLinkDialog.togglePassword()
@Then('the password progress indicator should not be visible in the client-UI')
@@ -656,12 +665,16 @@ def step(context, fileShareContext):
)
-def createPublicLinkShare(context, resource, password='', permissions=''):
+def createPublicLinkShare(
+ context, resource, password='', permissions='', expireDate='', name=''
+):
resource = getResourcePath(context, resource)
openSharingDialog(context, resource)
publicLinkDialog = PublicLinkDialog()
publicLinkDialog.openPublicLinkDialog()
- publicLinkDialog.createPublicLink(context, resource, password, permissions)
+ publicLinkDialog.createPublicLink(
+ context, resource, password, permissions, expireDate, name
+ )
@When(
@@ -678,10 +691,21 @@ def step(context, resource, password):
createPublicLinkShare(context, resource, password)
+def setExpirationDateWithVerification(resource, publicLinkName, expireDate):
+ publicLinkDialog = PublicLinkDialog()
+ publicLinkDialog.verifyResource(resource)
+ publicLinkDialog.verifyPublicLinkName(publicLinkName)
+ publicLinkDialog.setExpirationDate(expireDate)
+
+
@When('the user edits the public link named "|any|" of file "|any|" changing following')
def step(context, publicLinkName, resource):
- publicLinkDialog = PublicLinkDialog()
- publicLinkDialog.setExpirationDate(context, publicLinkName, resource)
+ expireDate = ''
+ for row in context.table:
+ if row[0] == 'expireDate':
+ expireDate = row[1]
+ break
+ setExpirationDateWithVerification(resource, publicLinkName, expireDate)
@When(
@@ -698,6 +722,19 @@ def step(context, permissions, resource, password):
createPublicLinkShare(context, resource, password, permissions)
+@When('the user creates a new public link with following settings using the client-UI:')
+def step(context):
+ linkSettings = {}
+ for row in context.table:
+ linkSettings[row[0]] = row[1]
+ createPublicLinkShare(
+ context,
+ resource=linkSettings['path'],
+ password=linkSettings['password'],
+ expireDate=linkSettings['expireDate'],
+ )
+
+
def createPublicShareWithRole(context, resource, role):
resource = sanitizePath(substituteInLineCodes(context, resource))
openSharingDialog(context, resource)
@@ -916,6 +953,21 @@ def step(context, resource, content):
waitForFileToBeSynced(context, resource)
+@When('the user tries to overwrite the file "|any|" with content "|any|"')
+def step(context, resource, content):
+ waitForFileToBeSynced(context, resource)
+ waitForFolderToBeSynced(context, '/')
+
+ try:
+ f = open(context.userData['currentUserSyncPath'] + resource, "w")
+ f.write(content)
+ f.close()
+ except:
+ pass
+
+ waitForFileToBeSynced(context, resource)
+
+
def enableVFSSupport(vfsBtnText):
# The enabling/disabling VFS button do not have it's own object
# But it is inside the "stack_folderList_QTreeView" object.
@@ -1146,7 +1198,8 @@ def step(context, resource):
)
def step(context, publicLinkName, password):
publicLinkDialog = PublicLinkDialog()
- publicLinkDialog.changePassword(publicLinkName, password)
+ publicLinkDialog.verifyPublicLinkName(publicLinkName)
+ publicLinkDialog.changePassword(password)
@Then(
@@ -1164,3 +1217,54 @@ def step(context, resource):
context, receiver, resource, permissions, receiverCount
)
receiverCount += 1
+
+
+def searchCollaborator(collaborator):
+ shareItem = SharingDialog()
+ shareItem.searchCollaborator(collaborator)
+
+
+@When('the user searches for collaborator "|any|" using the client-UI')
+def step(context, collaborator):
+ searchCollaborator(collaborator)
+
+
+@When(
+ 'the user searches for collaborator with autocomplete characters "|any|" using the client-UI'
+)
+def step(context, collaborator):
+ searchCollaborator(collaborator)
+
+
+@Then('the following users should be listed as suggested collaborators:')
+def step(context):
+ shareItem = SharingDialog()
+ for collaborator in context.table[1:]:
+ exists = False
+ try:
+ waitForObjectItem(shareItem.SUGGESTED_COLLABORATOR, collaborator[0])
+ exists = True
+ except LookupError as e:
+ pass
+
+ test.compare(exists, True, "Assert user '" + collaborator[0] + "' is listed")
+
+
+@Then('the collaborators should be listed in the following order:')
+def step(context):
+ shareItem = SharingDialog()
+ for index, collaborator in enumerate(context.table[1:], start=1):
+ test.compare(
+ str(
+ waitForObjectExists(
+ {
+ "container": names.sharingDialogUG_scrollArea_QScrollArea,
+ "name": "sharedWith",
+ "occurrence": index,
+ "type": "QLabel",
+ "visible": 1,
+ }
+ ).text
+ ),
+ collaborator[0],
+ )