Skip to content
Draft
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
12 changes: 6 additions & 6 deletions test/gui/features/sync-resources/syncResources.feature
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Feature: Syncing files
And the user waits for file "newfile.txt" to be synced
Then as "Alice" file "newfile.txt" should exist in the server

@skip

Scenario: File with spaces in the name can sync
Given user "Alice" has set up a client with default settings
When user "Alice" creates a file "file with space.txt" with the following content inside the sync folder
Expand All @@ -403,7 +403,7 @@ Feature: Syncing files
And the user waits for file "file with space.txt" to be synced
Then as "Alice" file "file with space.txt" should exist in the server

@skip

Scenario: Syncing folders each having large number of files
Given the user has created a folder "folder1" in temp folder
And the user has created "500" files each of size "1048576" bytes inside folder "folder1" in temp folder
Expand Down Expand Up @@ -438,7 +438,7 @@ Feature: Syncing files
And for user "Alice" sync folder "Personal" should not be displayed
And for user "Alice" sync folder "Shares" should not be displayed

@skip

Scenario: extract a zip file in the sync folder
Given the user has created a zip file "archive.zip" with the following resources in the temp folder
| resource | type | content |
Expand All @@ -456,7 +456,7 @@ Feature: Syncing files
And as "Alice" the file "file2.txt" should have the content "Test file2" in the server


@skipOnWindows @skip
@skipOnWindows
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
Expand Down Expand Up @@ -503,7 +503,7 @@ Feature: Syncing files
And the folder "simple-folder" should exist on the file system
And as "Alice" folder "simple-folder" should exist in the server

@skip

Scenario: Sync a received shared folder with Viewer permission role
Given user "Brian" has been created in the server with default attributes
And user "Alice" has created folder "simple-folder" in the server
Expand Down Expand Up @@ -547,7 +547,7 @@ Feature: Syncing files
| filename |
| 𒁰𒁱𒁲𒁳𒁴𒁵𒁶𒁷𒁸𒁹𒁺𒁻𒁼𒁾𒁿𒁰𒁱𒁲𒁳𒁴𒁵𒁶𒁷𒁸𒁹𒁺𒁻𒁼𒁾𒁿𒁰𒁱𒁲𒁳𒁴𒁵𒁶𒁷𒁸𒁹𒁺abôǣฎพฒฆ๘ตกกผพฒณญไใๅำ๊๒๔๗๘รศฬอฮ.txt |

@skip

Scenario: Sync a received shared folder with Editor permission role
Given user "Brian" has been created in the server with default attributes
And user "Alice" has created folder "simple-folder" in the server
Expand Down
5 changes: 2 additions & 3 deletions test/gui/pageObjects/SyncConnectionWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,8 @@ def select_or_unselect_folders_to_sync(folders, select=True):
p_elements = app().find_elements(By.NAME, parent)
# select nested folders based on the position of the parent folder
for p_element in p_elements:
if (
p_element.get_attribute("checked") == 'true'
and p_element.rect["x"] > parent_position
if p_element.rect["x"] >= parent_position and (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When selecting folders, deselect_all_remote_folders() unchecks everything first, so the checked == 'true' condition never matched and parent_element stayed None. When unselecting, the check is still needed to pick the correct parent when multiple elements with the same name exist in the tree. Now the checked state is only enforced when unselecting.

select or p_element.get_attribute("checked") == 'true'
):
parent_element = p_element
parent_position = p_element.rect["x"]
Expand Down
15 changes: 6 additions & 9 deletions test/gui/steps/file_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ def step(context, username):
wait_and_write_file(file, '')


@Given('the user has created a folder "|any|" in temp folder')
@Given('the user has created a folder "{folder_name}" in temp folder')
def step(context, folder_name):
create_folder(folder_name, is_temp_folder=True)


@Given(
'the user has created "|any|" files each of size "|any|" bytes inside folder "|any|" in temp folder'
'the user has created "{file_number}" files each of size "{file_size}" bytes inside folder "{folder_name}" in temp folder'
)
def step(context, file_number, file_size, folder_name):
current_sync_path = get_temp_resource_path(folder_name)
Expand All @@ -328,10 +328,7 @@ def step(context, username, file):
f.read()


@When(
r'user "([^"]*)" moves (folder|file) "([^"]*)" from the temp folder into the sync folder',
regexp=True,
)
@When(r'user "{username}" moves {resource_type} "{resource_name}" from the temp folder into the sync folder')
def step(context, username, resource_type, resource_name):
source_dir = join(get_config('tempFolderPath'), resource_name)
move_resource(username, resource_type, source_dir, '/', True)
Expand Down Expand Up @@ -387,12 +384,12 @@ def step(context, user, file_name):


@Given(
'the user has created a zip file "|any|" with the following resources in the temp folder'
'the user has created a zip file "{zip_file_name}" with the following resources in the temp folder'
)
def step(context, zip_file_name):
resource_list = []

for row in context.table[1:]:
for row in context.table:
resource_list.append(row[0])
resource = join(get_config('tempFolderPath'), row[0])
if row[1] == 'folder':
Expand All @@ -405,7 +402,7 @@ def step(context, zip_file_name):
create_zip(resource_list, zip_file_name, get_config('tempFolderPath'))


@When('user "|any|" unzips the zip file "|any|" inside the sync root')
@When('user "{username}" unzips the zip file "{zip_file_name}" inside the sync root')
def step(context, username, zip_file_name):
destination_dir = get_resource_path('/', username)
zip_file_path = join(destination_dir, zip_file_name)
Expand Down
11 changes: 3 additions & 8 deletions test/gui/steps/server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def step(context, user_name, resource_type, resource_name):
)
def step(context, user_name, resource_type, resource_name):
resource_exists = webdav.resource_exists(user_name, resource_name)

with ensure(
'{0} "{1}" should exist, but it does not',
resource_type.capitalize(),
Expand All @@ -55,15 +54,11 @@ def step(context, user_name, file_name, content):
text_content.should.equal(content)


@Then(
r'as user "([^"].*)" folder "([^"].*)" should contain "([^"].*)" items in the server',
regexp=True,
)
@Then(r'as user "{user_name}" folder "{folder_name}" should contain "{items_number}" items in the server')
def step(context, user_name, folder_name, items_number):
total_items = webdav.get_folder_items_count(user_name, folder_name)
test.compare(
total_items, items_number, f'Folder should contain {items_number} items'
)
with ensure(f'Folder should contain {items_number} items'):
total_items.should.equal(items_number)


@Given('user "{user}" has created folder "{folder_name}" in the server')
Expand Down
2 changes: 1 addition & 1 deletion test/gui/steps/sync_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def step(context):


@When(
'the user sets the temp folder "|any|" as local sync path in sync connection wizard'
'the user sets the temp folder "{folder_name}" as local sync path in sync connection wizard'
)
def step(context, folder_name):
sync_path = get_temp_resource_path(folder_name)
Expand Down