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) ) diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index d1c6e660f4..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", 'off') + 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)) 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')