diff --git a/test/gui/shared/scripts/helpers/api/webdav_helper.py b/test/gui/shared/scripts/helpers/api/webdav_helper.py index 090320ddba2..4d771353c63 100644 --- a/test/gui/shared/scripts/helpers/api/webdav_helper.py +++ b/test/gui/shared/scripts/helpers/api/webdav_helper.py @@ -64,3 +64,11 @@ def create_file(user, file_name, contents): assert ( response.status_code == 201 ), f"Could not create file '{file_name}' for user {user}" + + +def delete_folder(user, folder_name): + url = get_resource_path(user, folder_name) + response = request.delete(url, user=user) + assert ( + response.status_code == 204 + ), f"Could not delete folder '{folder_name}' for user {user}" diff --git a/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py b/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py index 9b8611421bb..852b225276b 100644 --- a/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py +++ b/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py @@ -107,8 +107,7 @@ def selectRemoteDestinationFolder(folder): SyncConnectionWizard.nextStep() @staticmethod - def selectFoldersToSync(folders): - # first deselect all + def deselectAllRemoteFolders(): squish.mouseClick( squish.waitForObject(SyncConnectionWizard.SELECTIVE_SYNC_ROOT_FOLDER), 11, @@ -116,6 +115,11 @@ def selectFoldersToSync(folders): squish.Qt.NoModifier, squish.Qt.LeftButton, ) + + @staticmethod + def selectFoldersToSync(folders): + # first deselect all + SyncConnectionWizard.deselectAllRemoteFolders() for folder in folders: # added a new key 'text' to dictionary SYNC_DIALOG_FOLDER_TREE SyncConnectionWizard.SYNC_DIALOG_FOLDER_TREE['text'] = folder diff --git a/test/gui/shared/steps/account_context.py b/test/gui/shared/steps/account_context.py index 2b09d61c250..cb0f4af4b75 100644 --- a/test/gui/shared/steps/account_context.py +++ b/test/gui/shared/steps/account_context.py @@ -253,3 +253,9 @@ def step(context): @When('user "|any|" logs out from the login required dialog') def step(context, username): AccountSetting.logoutFromLoginRequiredDialog() + + +@When("user \"Alice\" unselects all the remote folders") +def step(context): + SyncConnectionWizard.deselectAllRemoteFolders() + SyncConnectionWizard.addSyncConnection() diff --git a/test/gui/shared/steps/server_context.py b/test/gui/shared/steps/server_context.py index a33c262b71e..c208700145b 100644 --- a/test/gui/shared/steps/server_context.py +++ b/test/gui/shared/steps/server_context.py @@ -171,3 +171,13 @@ def step(context, user, file_content, file_name): @When("the user clicks on the settings tab") def step(context): Toolbar.open_settings_tab() + + +@When('user "|any|" uploads file with content "|any|" to "|any|" in the server') +def step(context, user, file_content, file_name): + webdav.create_file(user, file_name, file_content) + + +@When('user "|any|" deletes the folder "|any|" in the server') +def step(context, user, folder_name): + webdav.delete_folder(user, folder_name) diff --git a/test/gui/tst_syncing/test.feature b/test/gui/tst_syncing/test.feature index e43a40f37c0..d48c17ccc59 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -55,9 +55,11 @@ Feature: Syncing files """ @skipOnOCIS - Scenario: Sync all is selected by default + Scenario: Sync all is selected by default and unselect all the remote folders Given user "Alice" has created folder "simple-folder" in the server And user "Alice" has created folder "large-folder" in the server + And user "Alice" has uploaded file with content "ownCloud test text file 0" to "testFile.txt" in the server + And user "Alice" has uploaded file with content "ownCloud test text file 1" to "lorem.txt" in the server And the user has started the client And the user has entered the following account information: | server | %local_server% | @@ -67,6 +69,10 @@ Feature: Syncing files And the user sets the sync path in sync connection wizard And the user selects "ownCloud" as a remote destination folder Then the sync all checkbox should be checked + When user "Alice" unselects all the remote folders + And the user waits for the files to sync + Then the file "testFile.txt" should exist on the file system + And the file "lorem.txt" should exist on the file system @skipOnOCIS Scenario: Sync only one folder from the server @@ -85,6 +91,20 @@ Feature: Syncing files | simple-folder | Then the folder "simple-folder" should exist on the file system But the folder "large-folder" should not exist on the file system + When user "Alice" uploads file with content "some content" to "simple-folder/lorem.txt" in the server + And user "Alice" uploads file with content "ownCloud" to "large-folder/lorem.txt" in the server + And user "Alice" creates a file "simple-folder/localFile.txt" with the following content inside the sync folder + """ + test content + """ + And the user waits for the files to sync + Then the file "simple-folder/lorem.txt" should exist on the file system + And the file "large-folder/lorem.txt" should not exist on the file system + And as "Alice" file "simple-folder/localFile.txt" should exist in the server + When the user deletes the folder "simple-folder" + And the user waits for the files to sync + Then as "Alice" folder "simple-folder" should not exist in the server + @issue-9733 @skipOnOCIS Scenario: sort folders list by name and size @@ -390,6 +410,7 @@ Feature: Syncing files @skipOnOCIS Scenario: sync remote folder to a local sync folder having special characters Given user "Alice" has created folder "~`!@#$^&()-_=+{[}];',)" in the server + And user "Alice" has created folder "simple-folder" in the server And user "Alice" has created folder "~test%" in the server And the user has created a folder "~`!@#$^&()-_=+{[}];',)PRN%" in temp folder And the user has started the client @@ -403,5 +424,10 @@ Feature: Syncing files And the user selects the following folders to sync: | folder | | ~`!@#$^&()-_=+{[}];',) | + | simple-folder | Then the folder "~`!@#$^&()-_=+{[}];',)" should exist on the file system + And the folder "simple-folder" should exist on the file system But the folder "~test%" should not exist on the file system + When user "Alice" deletes the folder "simple-folder" in the server + And the user waits for the files to sync + Then the folder "simple-folder" should not exist on the file system