Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/gui/shared/scripts/helpers/FilesHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ctypes
import shutil

import squish
from helpers.ConfigHelper import is_windows, get_config


Expand Down Expand Up @@ -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)
)
Expand Down
5 changes: 4 additions & 1 deletion test/gui/shared/scripts/helpers/SetupClientHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
46 changes: 46 additions & 0 deletions test/gui/tst_vfs/test.feature
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions test/gui/tst_vfs/test.py
Original file line number Diff line number Diff line change
@@ -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')