From 9a83f6dc75b8ddf5874ed02def398a7f0e456e70 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Mon, 14 Jul 2025 16:15:08 +0545 Subject: [PATCH 1/4] wait for file to exist before checking size --- test/gui/shared/scripts/helpers/FilesHelper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/gui/shared/scripts/helpers/FilesHelper.py b/test/gui/shared/scripts/helpers/FilesHelper.py index a417dc0276..f2994fde6e 100644 --- a/test/gui/shared/scripts/helpers/FilesHelper.py +++ b/test/gui/shared/scripts/helpers/FilesHelper.py @@ -3,6 +3,7 @@ import ctypes import shutil +import squish from helpers.ConfigHelper import is_windows, get_config @@ -93,8 +94,10 @@ def get_size_in_bytes(size): def get_file_size_on_disk(resource_path): - file_size_high = ctypes.c_ulonglong(0) if is_windows(): + timeout = get_config('maxSyncTimeout') * 1000 + squish.waitFor(lambda: os.path.exists(resource_path), timeout) + file_size_high = ctypes.c_ulonglong(0) return ctypes.windll.kernel32.GetCompressedFileSizeW( ctypes.c_wchar_p(resource_path), ctypes.pointer(file_size_high) ) From 90a454eeabd25bf982d578f9387c721bda98eba1 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Mon, 14 Jul 2025 16:24:29 +0545 Subject: [PATCH 2/4] enable vfs in client config --- test/gui/shared/scripts/helpers/SetupClientHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index d1c6e660f4..67d1ecb166 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -177,7 +177,7 @@ def generate_account_config(users, space='Personal'): settings.setValue("localPath", sync_path) settings.setValue("paused", 'false') settings.setValue("priority", '50') - settings.setValue("virtualFilesMode", 'off') + settings.setValue("virtualFilesMode", 'cfapi') settings.setValue("journalPath",".sync_journal.db") settings.endArray() settings.setValue("size", len(users)) From da92a65d041c7e5428fca309eec86881d00de2d8 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 16 Jul 2025 11:02:23 +0545 Subject: [PATCH 3/4] enable some VFS tests --- test/gui/tst_vfs/test.feature | 46 +++++++++++++++++++++++++++++++++++ test/gui/tst_vfs/test.py | 8 ++++++ 2 files changed, 54 insertions(+) create mode 100644 test/gui/tst_vfs/test.feature create mode 100644 test/gui/tst_vfs/test.py diff --git a/test/gui/tst_vfs/test.feature b/test/gui/tst_vfs/test.feature new file mode 100644 index 0000000000..6961f86634 --- /dev/null +++ b/test/gui/tst_vfs/test.feature @@ -0,0 +1,46 @@ +@skipOnLinux +Feature: Enable/disable virtual file support + As a user + I want to enable virtual file support + So that I can synchronize virtual files with local folder + + + Scenario: Copy and paste virtual file + Given user "Alice" has been created in the server with default attributes + And user "Alice" has uploaded file with content "sample file" to "sampleFile.txt" in the server + And user "Alice" has uploaded file with content "lorem file" to "lorem.txt" in the server + And user "Alice" has uploaded file with content "test file" to "testFile.txt" in the server + And user "Alice" has created folder "Folder" in the server + And user "Alice" has set up a client with default settings + Then the placeholder of file "lorem.txt" should exist on the file system + And the placeholder of file "sampleFile.txt" should exist on the file system + And the placeholder of file "testFile.txt" should exist on the file system + When user "Alice" copies file "sampleFile.txt" to temp folder + And the user copies the file "lorem.txt" to "Folder" + And the user copies the file "testFile.txt" to "testFile.txt" + And the user waits for file "Folder/lorem.txt" to be synced + Then the file "sampleFile.txt" should be downloaded + And the file "Folder/lorem.txt" should be downloaded + And the file "lorem.txt" should be downloaded + And the file "testFile.txt" should be downloaded + And the file "testFile - Copy.txt" should be downloaded + And as "Alice" file "Folder/lorem.txt" should exist in the server + And as "Alice" file "lorem.txt" should exist in the server + And as "Alice" file "sampleFile.txt" should exist in the server + And as "Alice" file "testFile.txt" should exist in the server + And as "Alice" file "testFile - Copy.txt" should exist in the server + + + Scenario: Move virtual file + Given user "Alice" has been created in the server with default attributes + And user "Alice" has uploaded file with content "lorem file" to "lorem.txt" in the server + And user "Alice" has uploaded file with content "some contents" to "sampleFile.txt" in the server + And user "Alice" has created folder "Folder" in the server + And user "Alice" has set up a client with default settings + When user "Alice" moves file "lorem.txt" to "Folder" in the sync folder + And user "Alice" moves file "sampleFile.txt" to the temp folder + And the user waits for file "Folder/lorem.txt" to be synced + Then the placeholder of file "Folder/lorem.txt" should exist on the file system + And as "Alice" file "Folder/lorem.txt" should exist in the server + And as "Alice" file "lorem.txt" should not exist in the server + And as "Alice" file "sampleFile.txt" should not exist in the server diff --git a/test/gui/tst_vfs/test.py b/test/gui/tst_vfs/test.py new file mode 100644 index 0000000000..83b0a5275a --- /dev/null +++ b/test/gui/tst_vfs/test.py @@ -0,0 +1,8 @@ +source(findFile('scripts', 'python/bdd.py')) + +setupHooks('../shared/scripts/bdd_hooks.py') +collectStepDefinitions('./steps', '../shared/steps') + + +def main(): + runFeatureFile('test.feature') From fc4090bba5d04981f1904bb7663387b8ffc0fdd6 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 16 Jul 2025 12:01:35 +0545 Subject: [PATCH 4/4] only enable vfs on windows --- test/gui/shared/scripts/helpers/SetupClientHelper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index 67d1ecb166..4c66aec862 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -177,7 +177,10 @@ def generate_account_config(users, space='Personal'): settings.setValue("localPath", sync_path) settings.setValue("paused", 'false') settings.setValue("priority", '50') - settings.setValue("virtualFilesMode", 'cfapi') + if is_windows(): + settings.setValue("virtualFilesMode", 'cfapi') + else: + settings.setValue("virtualFilesMode", 'off') settings.setValue("journalPath",".sync_journal.db") settings.endArray() settings.setValue("size", len(users))