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
path: root/test
diff options
context:
space:
mode:
authorSwoichha Adhikari <swoichhaa@gmail.com>2021-11-22 12:13:44 +0300
committerGitHub <noreply@github.com>2021-11-22 12:13:44 +0300
commit842e48d1b31cca782c78b66702bd27d38ba62110 (patch)
tree57e69187704485be64adc705ed7250d91874c4d4 /test
parentc251b71dbbe1ca1da4775022ed2456a69d9624b1 (diff)
[tests-only] add tests for public share (#9201)
* tests-only] add tests for publick link with password * add new type of password for test
Diffstat (limited to 'test')
-rw-r--r--test/gui/shared/scripts/names.py3
-rw-r--r--test/gui/shared/scripts/pageObjects/PublicLinkDialog.py22
-rw-r--r--test/gui/shared/steps/steps.py22
-rw-r--r--test/gui/tst_sharing/test.feature34
4 files changed, 78 insertions, 3 deletions
diff --git a/test/gui/shared/scripts/names.py b/test/gui/shared/scripts/names.py
index f17255648..490b11b1a 100644
--- a/test/gui/shared/scripts/names.py
+++ b/test/gui/shared/scripts/names.py
@@ -112,3 +112,6 @@ choose_What_to_Sync_OCC_SelectiveSyncDialog = {"type": "OCC::SelectiveSyncDialog
choose_What_to_Sync_Deselect_remote_folders_you_do_not_wish_to_synchronize_QLabel = {"text": "Deselect remote folders you do not wish to synchronize.", "type": "QLabel", "unnamed": 1, "visible": 1, "window": choose_What_to_Sync_OCC_SelectiveSyncDialog}
choose_What_To_Synchronize_QTreeWidget = {"aboveWidget": choose_What_to_Sync_Deselect_remote_folders_you_do_not_wish_to_synchronize_QLabel, "type": "QTreeWidget", "unnamed": 1, "visible": 1, "window": choose_What_to_Sync_OCC_SelectiveSyncDialog}
deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView = {"container": choose_What_To_Synchronize_QTreeWidget, "orientation": 1, "type": "QHeaderView", "unnamed": 1, "visible": 1}
+linkShares_QToolButton_2 = {"container": oCC_ShareLinkWidget_linkShares_QTableWidget, "occurrence": 2, "type": "QToolButton", "unnamed": 1, "visible": 1}
+oCC_ShareLinkWidget_Delete_QPushButton = {"container": qt_tabwidget_stackedwidget_OCC_ShareLinkWidget_OCC_ShareLinkWidget, "text": "Delete", "type": "QPushButton", "unnamed": 1, "visible": 1}
+oCC_ShareLinkWidget_pushButton_setPassword_QPushButton = {"container": qt_tabwidget_stackedwidget_OCC_ShareLinkWidget_OCC_ShareLinkWidget, "name": "pushButton_setPassword", "type": "QPushButton", "visible": 1}
diff --git a/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py b/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py
index b6e7f0768..ea7af0ea3 100644
--- a/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py
+++ b/test/gui/shared/scripts/pageObjects/PublicLinkDialog.py
@@ -172,3 +172,25 @@ class PublicLinkDialog:
== "Public link"
)
)
+
+ def changePassword(self, publicLinkName, password):
+ test.compare(
+ str(squish.waitForObjectExists(self.PUBLIC_LINK_NAME).text),
+ publicLinkName,
+ )
+ squish.mouseClick(
+ squish.waitForObject(names.oCC_ShareLinkWidget_lineEdit_password_QLineEdit),
+ 0,
+ 0,
+ squish.Qt.NoModifier,
+ squish.Qt.LeftButton,
+ )
+ squish.type(
+ squish.waitForObject(names.oCC_ShareLinkWidget_lineEdit_password_QLineEdit),
+ password,
+ )
+ squish.clickButton(
+ squish.waitForObject(
+ names.oCC_ShareLinkWidget_pushButton_setPassword_QPushButton
+ )
+ )
diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py
index 9ba1d7173..73f4471e8 100644
--- a/test/gui/shared/steps/steps.py
+++ b/test/gui/shared/steps/steps.py
@@ -1082,3 +1082,25 @@ def step(context):
test.compare(actualFolder, expectedFolder)
rowIndex += 1
+
+
+@When('the user deletes the public link for file "|any|"')
+def step(context, resource):
+ openSharingDialog(context, resource)
+ publicLinkDialog = PublicLinkDialog()
+ publicLinkDialog.openPublicLinkDialog()
+
+ test.compare(
+ str(waitForObjectExists(publicLinkDialog.ITEM_TO_SHARE).text),
+ resource.replace(context.userData['currentUserSyncPath'], ''),
+ )
+ clickButton(waitForObject(names.linkShares_QToolButton_2))
+ clickButton(waitForObject(names.oCC_ShareLinkWidget_Delete_QPushButton))
+
+
+@When(
+ 'the user changes the password of public link "|any|" to "|any|" using the client-UI'
+)
+def step(context, publicLinkName, password):
+ publicLinkDialog = PublicLinkDialog()
+ publicLinkDialog.changePassword(publicLinkName, password)
diff --git a/test/gui/tst_sharing/test.feature b/test/gui/tst_sharing/test.feature
index f24447792..a05d8232b 100644
--- a/test/gui/tst_sharing/test.feature
+++ b/test/gui/tst_sharing/test.feature
@@ -131,12 +131,40 @@ Feature: Sharing
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
- Scenario: simple sharing of a file by public link with password
+ Scenario: sharing of a file by public link and deleting the 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
+ And user "Alice" has created a public link on the server with following settings
+ | path | textfile0.txt |
+ | name | Public-link |
+ When the user deletes the public link for file "textfile0.txt"
+ Then as user "Alice" the file "/textfile0.txt" should not have any public link on the server
+
+
+ Scenario Outline: 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 "textfile0.txt" with password "<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" with password "<password>" from the last created public link by "Alice" on the server
+ Examples:
+ | password |
+ |password1234|
+ | p@$s!23 |
+
+
+ Scenario: sharing of a file by public link with password and changing the 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 "textfile0.txt" with password "pass123" using the client-UI
+ And user "Alice" has created a public link on the server with following settings
+ | path | textfile0.txt |
+ | name | Public-link |
+ | password | 1234 |
+ When the user opens the public links dialog of "textfile0.txt" using the client-UI
+ And the user changes the password of public link "Public-link" to "password1234" 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
+ And the public should be able to download the file "textfile0.txt" with password "password1234" from the last created public link by "Alice" on the server
+
@issue-8733
Scenario: user changes the expiration date of an already existing public link using webUI