Skip to content

Commit b6bdb1f

Browse files
authored
gui-test: sync hidden files (#1124)
* Add GUI test for syncing hidden files * link issue. skip test
1 parent 9e5d7b0 commit b6bdb1f

9 files changed

Lines changed: 74 additions & 8 deletions

File tree

‎test/gui/features/activity/activity.feature‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Feature: filter activity for user
4141
| resource | status | account |
4242
| Folder1/a\\a.txt | Blacklisted | Alice Hansen@%local_server_hostname% |
4343

44-
4544
@skipOnLinux @skip
4645
Scenario: filter not synced activities (Windows only)
4746
Given user "Alice" has been created in the server with default attributes

‎test/gui/features/add-account/account.feature‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature: adding accounts
2626
| user | Alice |
2727
| password | 1234 |
2828
Then "Alice" account should be added
29-
Then the add space button should be disabled
29+
And the add space button should be disabled
3030

3131
@smoke
3232
Scenario: Adding multiple accounts

‎test/gui/features/delete-files-folders/delete.feature‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Feature: deleting files and folders
5555
| textfile2.txt | openCloud test text file 2 |
5656
And user "Alice" has set up a client with default settings
5757
When the user deletes the following files
58-
| file |
58+
| file |
5959
| textfile0.txt |
6060
| textfile1.txt |
6161
And the user waits for the files to sync

‎test/gui/features/edit-files/edit.feature‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: edit files
2121
"""
2222
test content
2323
"""
24-
And the user waits for file "testfile.txt" to be synced
24+
And the user waits for file "testfile.txt" to be synced
2525
And the user overwrites the file "testfile.txt" with content "overwrite openCloud test text file"
2626
And the user waits for file "testfile.txt" to be synced
2727
Then as "Alice" the file "testfile.txt" should have the content "overwrite openCloud test text file" in the server

‎test/gui/features/move-files-folders/moveFilesFolders.feature‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Feature: move file and folder
5454
And as "Alice" folder "folder1" should not exist in the server
5555

5656
@smoke
57-
Scenario: Move files from one folder to another
57+
Scenario: Move files from one folder to another
5858
Given user "Alice" has uploaded file with content "test file 1" to "folder1/file1.txt" in the server
5959
And user "Alice" has uploaded file with content "test file 2" to "folder1/file2.txt" in the server
6060
And user "Alice" has set up a client with default settings
@@ -80,7 +80,7 @@ Feature: move file and folder
8080
And as "Alice" folder "folder1/folder2/folder3/folder4/test-folder" should not exist in the server
8181

8282

83-
Scenario: Syncing a 50MB file moved into the local sync folder
83+
Scenario: Syncing a 50MB file moved into the local sync folder
8484
Given user "Alice" has set up a client with default settings
8585
And user "Alice" has created a folder "NewFolder" inside the sync folder
8686
And the user has created a file "newfile.txt" with size "50MB" in the sync folder

‎test/gui/features/sync-edge-cases/syncResources.feature‎

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Feature: Syncing files
200200
| simple-folder/simple.pdf | Blacklisted | Brian Murphy@%local_server_hostname% |
201201

202202

203-
Scenario: Sync a received shared folder with Editor permission role
203+
Scenario: Sync a received shared folder with Editor permission role
204204
Given user "Brian" has been created in the server with default attributes
205205
And user "Alice" has created folder "simple-folder" in the server
206206
And user "Alice" has uploaded file with content "test content" to "simple-folder/uploaded-lorem.txt" in the server
@@ -227,7 +227,7 @@ Feature: Syncing files
227227
And user "Alice" has created folder "Öü" in the server
228228
And user "Alice" has uploaded file with content "openCloud test" to "Öü/testFile.txt" in the server
229229
When user "Alice" creates a folder "Öü" inside the sync folder
230-
When user "Alice" creates a file "Öü/newfile.txt" with the following content inside the sync folder
230+
And user "Alice" creates a file "Öü/newfile.txt" with the following content inside the sync folder
231231
"""
232232
test content
233233
"""
@@ -238,3 +238,50 @@ Feature: Syncing files
238238
And as user "Alice" folder "/" should contain "1" items in the server
239239
And as "Alice" file "Öü/testFile.txt" should exist in the server
240240
And as "Alice" file "Öü/newfile.txt" should exist in the server
241+
242+
@issue-1127 @skip
243+
Scenario: Existing hidden files are downloaded when sync of hidden files is enabled
244+
Given user "Alice" has uploaded file with content "hidden content" to "/.hidden-file.txt" in the server
245+
And user "Alice" has created folder "folder/subfolder" in the server
246+
And user "Alice" has uploaded file with content "hidden in folder" to "/folder/.hidden-in-folder.txt" in the server
247+
And user "Alice" has uploaded file with content "hidden in subfolder" to "/folder/subfolder/.hidden-in-subfolder.txt" in the server
248+
And user "Alice" has set up a client with default settings
249+
# hidden files are ignored by default, so they must not be downloaded yet
250+
Then the file ".hidden-file.txt" should not exist on the file system
251+
And the file "folder/.hidden-in-folder.txt" should not exist on the file system
252+
And the file "folder/subfolder/.hidden-in-subfolder.txt" should not exist on the file system
253+
When the user enables sync of hidden files in the settings
254+
And the user opens the account "Alice"
255+
And the user force syncs the files
256+
And the user waits for the files to sync
257+
Then the file ".hidden-file.txt" should exist on the file system with the following content
258+
"""
259+
hidden content
260+
"""
261+
And the file "folder/.hidden-in-folder.txt" should exist on the file system with the following content
262+
"""
263+
hidden in folder
264+
"""
265+
And the file "folder/subfolder/.hidden-in-subfolder.txt" should exist on the file system with the following content
266+
"""
267+
hidden in subfolder
268+
"""
269+
270+
271+
Scenario: Hidden files are downloaded when sync of hidden files is enabled
272+
Given user "Alice" has created folder "folder" in the server
273+
And user "Alice" has set up a client with default settings
274+
When the user enables sync of hidden files in the settings
275+
And the user opens the account "Alice"
276+
And user "Alice" uploads file with content "hidden content" to "/.hidden-file.txt" in the server
277+
And user "Alice" uploads file with content "hidden in folder" to "/folder/.hidden-in-folder.txt" in the server
278+
And the user force syncs the files
279+
And the user waits for the files to sync
280+
Then the file ".hidden-file.txt" should exist on the file system with the following content
281+
"""
282+
hidden content
283+
"""
284+
And the file "folder/.hidden-in-folder.txt" should exist on the file system with the following content
285+
"""
286+
hidden in folder
287+
"""

‎test/gui/pageObjects/Settings.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ def has_network_setting(setting):
6262
raise ValueError(f"Unknown network setting: {setting}")
6363
return app().find_element(locator.by, locator.selector).is_displayed()
6464

65+
@staticmethod
66+
def set_sync_hidden_files(enabled=True):
67+
checkbox = app().find_element(
68+
Settings.ADVANCED_SETTING_SYNC_HIDDEN_FILES.by,
69+
Settings.ADVANCED_SETTING_SYNC_HIDDEN_FILES.selector,
70+
)
71+
if checkbox.is_selected() != enabled:
72+
checkbox.click()
73+
6574
@staticmethod
6675
def open_about_dialog():
6776
app().find_element(Settings.ABOUT_BUTTON.by, Settings.ABOUT_BUTTON.selector).click()

‎test/gui/steps/account_context.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def step(context):
119119
AccountConnectionWizard.add_account_information(account_details)
120120

121121

122+
@When('the user opens the account "{username}"')
123+
def step(context, username):
124+
Toolbar.open_account(username)
125+
126+
122127
@When('the user "{username}" logs out using the client-UI')
123128
def step(context, username):
124129
Toolbar.open_account(username)

‎test/gui/steps/sync_context.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def step(context):
9191
Toolbar.open_settings_tab()
9292

9393

94+
@When('the user enables sync of hidden files in the settings')
95+
def step(context):
96+
Toolbar.open_settings_tab()
97+
Settings.set_sync_hidden_files(True)
98+
99+
94100
@Then('the table of conflict warnings should include file "{filename}"')
95101
def step(context, filename):
96102
Activity.has_conflict_file(filename)

0 commit comments

Comments
 (0)