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:
authorSwoichha Adhikari <swoichhaa@gmail.com>2021-10-26 11:52:46 +0300
committerGitHub <noreply@github.com>2021-10-26 11:52:46 +0300
commit4479ec828b6d7ee497147c7f4120c02dcf897360 (patch)
tree637bdfdc8cf16412f010f48460f00c464dd5daa8
parent226f276ed7bc8dc1ba36cc11ee70329aa36e3fd4 (diff)
[tests-only] add tests for files/folder share (#9162)
-rw-r--r--test/gui/shared/scripts/names.py2
-rw-r--r--test/gui/shared/steps/steps.py30
-rw-r--r--test/gui/tst_sharing/test.feature33
3 files changed, 60 insertions, 5 deletions
diff --git a/test/gui/shared/scripts/names.py b/test/gui/shared/scripts/names.py
index 65c66f215..d0e955dbe 100644
--- a/test/gui/shared/scripts/names.py
+++ b/test/gui/shared/scripts/names.py
@@ -106,4 +106,4 @@ error_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowT
oCC_SslErrorDialog_OCC_SslErrorDialog = {"name": "OCC__SslErrorDialog", "type": "OCC::SslErrorDialog", "visible": 1}
oCC_SslErrorDialog_cbTrustConnect_QCheckBox = {"name": "_cbTrustConnect", "type": "QCheckBox", "visible": 1, "window": oCC_SslErrorDialog_OCC_SslErrorDialog}
oCC_SslErrorDialog_OK_QPushButton = {"text": "OK", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": oCC_SslErrorDialog_OCC_SslErrorDialog}
-owncloudWizard_urlLabel_QLabel = {"name": "urlLabel", "type": "QLabel", "visible": 1, "window": owncloudWizard_OCC_OwncloudWizard}
+owncloudWizard_urlLabel_QLabel = {"name": "urlLabel", "type": "QLabel", "visible": 1, "window": owncloudWizard_OCC_OwncloudWizard} \ No newline at end of file
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py
index 47eafa570..ee7db0304 100644
--- a/test/gui/shared/steps/steps.py
+++ b/test/gui/shared/steps/steps.py
@@ -266,7 +266,6 @@ def collaboratorShouldBeListed(context, receiver, resource, permissions):
socketConnect = syncstate.SocketConnect()
socketConnect.sendCommand("SHARE:" + resource + "\n")
permissionsList = permissions.split(',')
-
test.compare(
str(waitForObjectExists(names.scrollArea_sharedWith_QLabel).text), receiver
)
@@ -496,10 +495,24 @@ def step(context, receiver, resource):
openSharingDialog(context, resource, 'folder')
-@Then('the error text "|any|" should be displayed in the sharing dialog')
-def step(context, fileShareContext):
+def getSharingDialogText():
shareItem = SharingDialog()
errorText = shareItem.getSharingDialogMessage()
+ return errorText
+
+
+@Then('the text "|any|" should be displayed in the sharing dialog')
+def step(context, fileShareContext):
+ errorText = getSharingDialogText()
+ test.compare(
+ errorText,
+ fileShareContext,
+ )
+
+
+@Then('the error text "|any|" should be displayed in the sharing dialog')
+def step(context, fileShareContext):
+ errorText = getSharingDialogText()
test.compare(
errorText,
fileShareContext,
@@ -860,3 +873,14 @@ def step(context, itemType, resource):
shutil.rmtree(resourcePath)
else:
raise Exception("No such item type for resource")
+
+
+@When(
+ 'the user unshares the resource "|any|" for collaborator "|any|" using the client-UI'
+)
+def step(context, resource, receiver):
+ openSharingDialog(context, resource)
+ test.compare(
+ str(waitForObjectExists(names.scrollArea_sharedWith_QLabel).text), receiver
+ )
+ clickButton(waitForObject(names.scrollArea_deleteShareButton_QToolButton))
diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature
index f60aca156..07e3f4f31 100644
--- a/test/gui/tst_sharing/test.feature
+++ b/test/gui/tst_sharing/test.feature
@@ -16,6 +16,17 @@ Feature: Sharing
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
+
+ Scenario: Share files/folders with special characters in their name
+ Given user "Brian" has been created on the server with default attributes and without skeleton files
+ 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
+
@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
@@ -61,7 +72,7 @@ Feature: Sharing
And user "Brian" has been created on the server with default attributes and without skeleton files
And user "Alice" has shared folder "simple-folder" on the server with user "Brian" with "all" permissions
And user "Brian" has set up a client with default settings
- When the user overwrites the file "simple-folder/textfile.txt" with content "overwrite ownCloud test text file"
+ When the user overwrites the file "simple-folder/textfile.txt" with content "overwrite ownCloud test text file"
Then as "Brian" the file "simple-folder/textfile.txt" on the server should have the content "overwrite ownCloud test text file"
And as "Alice" the file "simple-folder/textfile.txt" on the server should have the content "overwrite ownCloud test text file"
@@ -76,6 +87,26 @@ Feature: Sharing
And as "Alice" the file "textfile.txt" on the server should have the content "overwrite ownCloud test text file"
+ Scenario: unshare a shared file
+ 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 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
+ 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
+
+
+ Scenario: unshare a shared folder
+ Given user "Brian" has been created on the server with default attributes and without skeleton files
+ And user "Alice" has created folder "simple-folder" 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 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
+ 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
+
@issue-7423
Scenario: unshare a reshared file
Given the setting "shareapi_auto_accept_share" on the server of app "core" has been set to "no"