diff options
author | Talank Baral <talank@gces.edu.np> | 2022-03-09 13:00:46 +0300 |
---|---|---|
committer | Talank Baral <talank@gces.edu.np> | 2022-03-09 13:04:22 +0300 |
commit | 29cf46ab8c71e23ce98eb8245496ff13023bdf7b (patch) | |
tree | 52a0988e04be3b3e9f64160dc447e05fd3a45935 | |
parent | 04cb07ed9e18cd1aefaad4a1add9622d894e0f86 (diff) |
force sync on delete single fileforce-sync-on-1-file-delete
-rw-r--r-- | test/gui/shared/scripts/names.py | 2 | ||||
-rw-r--r-- | test/gui/shared/steps/steps.py | 10 | ||||
-rw-r--r-- | test/gui/tst_deletFilesFolders/test.feature | 16 |
3 files changed, 23 insertions, 5 deletions
diff --git a/test/gui/shared/scripts/names.py b/test/gui/shared/scripts/names.py index 490b11b1a..4f66b67c1 100644 --- a/test/gui/shared/scripts/names.py +++ b/test/gui/shared/scripts/names.py @@ -115,3 +115,5 @@ deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView = {"container 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} +remove_All_Files_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowTitle": "Remove All Files?"} +remove_All_Files_Remove_all_files_QPushButton = {"text": "Remove all files", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": remove_All_Files_QMessageBox} diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index a784f42e9..1edd49ea8 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -621,6 +621,16 @@ def step(context): Qt.LeftButton, ) activateItem(waitForObjectItem(names.settings_QMenu, "Force sync now")) + + # It is not guranteed that the object showing warning message will appear during the force sync. + # If the message appears, we need to click on the "Remove all files" button. Else, we should carry on with rest of the steps in test without any action. + # It takes upto 2000 ms for the object to appear. So, I put the timeout to be 2000 ms. + try: + clickButton( + waitForObject(names.remove_All_Files_Remove_all_files_QPushButton, 2000) + ) + except LookupError: + pass @Then( diff --git a/test/gui/tst_deletFilesFolders/test.feature b/test/gui/tst_deletFilesFolders/test.feature index 71ca6c809..86ada209e 100644 --- a/test/gui/tst_deletFilesFolders/test.feature +++ b/test/gui/tst_deletFilesFolders/test.feature @@ -8,25 +8,31 @@ Feature: deleting files and folders Background: Given user "Alice" has been created on the server with default attributes and without skeleton files - @skip @issue-9439 + Scenario Outline: Delete a file Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "<fileName>" on the server And user "Alice" has set up a client with default settings When the user waits for file "<fileName>" to be synced - And the user deletes the file "<fileName>" + Then as "Alice" file "<fileName>" should exist on the server + When the user deletes the file "<fileName>" + And the user triggers force sync on the client + And the user waits for file "<fileName>" to be synced Then as "Alice" file "<fileName>" should not exist on the server Examples: | fileName | | textfile0.txt | | textfile0-with-name-more-than-20-characters | - @skip @issue-9439 + Scenario Outline: Delete a folder Given user "Alice" has created folder "<folderName>" on the server And user "Alice" has set up a client with default settings When the user waits for folder "<folderName>" to be synced - And the user deletes the folder "<folderName>" - Then as "Alice" file "<folderName>" should not exist on the server + Then as "Alice" folder "<folderName>" should exist on the server + When the user deletes the folder "<folderName>" + And the user triggers force sync on the client + And the user waits for folder "<folderName>" to be synced + Then as "Alice" folder "<folderName>" should not exist on the server Examples: | folderName | | simple-empty-folder | |