Skip to content

Commit b7253cd

Browse files
add gui test to remove folder sync connection (#11725)
1 parent cfb4876 commit b7253cd

File tree

5 files changed

+60
-2
lines changed

5 files changed

+60
-2
lines changed

test/gui/shared/scripts/names.py

+1
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@
5252
create_Remote_Folder_QInputDialog = {"type": "QInputDialog", "unnamed": 1, "visible": 1, "windowTitle": "Create Remote Folder"}
5353
create_Remote_Folder_Enter_the_name_of_the_new_folder_to_be_created_below_QLabel = {"text": "Enter the name of the new folder to be created below '/':", "type": "QLabel", "unnamed": 1, "visible": 1, "window": create_Remote_Folder_QInputDialog}
5454
groupBox_folderTreeWidget_QTreeWidget = {"container": add_Folder_Sync_Connection_groupBox_QGroupBox, "name": "folderTreeWidget", "type": "QTreeWidget", "visible": 1}
55+
confirm_Folder_Sync_Connection_Removal_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowTitle": "Confirm Folder Sync Connection Removal"}

test/gui/shared/scripts/pageObjects/SyncConnection.py

+30
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ class SyncConnection:
2929
"type": "QPushButton",
3030
"visible": 1,
3131
}
32+
CANCEL_FOLDER_SYNC_CONNECTION_DIALOG = {
33+
"text": "Cancel",
34+
"type": "QPushButton",
35+
"unnamed": 1,
36+
"visible": 1,
37+
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
38+
}
39+
REMOVE_FOLDER_SYNC_CONNECTION_BUTTON = {
40+
"text": "Remove Folder Sync Connection",
41+
"type": "QPushButton",
42+
"unnamed": 1,
43+
"visible": 1,
44+
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
45+
}
3246

3347
@staticmethod
3448
def openMenu():
@@ -111,3 +125,19 @@ def unselect_folder_in_selective_sync(folder_name):
111125
squish.clickButton(
112126
squish.waitForObject(SyncConnection.SELECTIVE_SYNC_APPLY_BUTTON)
113127
)
128+
129+
@staticmethod
130+
def remove_folder_sync_connection():
131+
SyncConnection.performAction("Remove folder sync connection")
132+
133+
@staticmethod
134+
def cancel_folder_sync_connection_removal():
135+
squish.clickButton(
136+
squish.waitForObject(SyncConnection.CANCEL_FOLDER_SYNC_CONNECTION_DIALOG)
137+
)
138+
139+
@staticmethod
140+
def confirm_folder_sync_connection_removal():
141+
squish.clickButton(
142+
squish.waitForObject(SyncConnection.REMOVE_FOLDER_SYNC_CONNECTION_BUTTON)
143+
)

test/gui/shared/steps/account_context.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def step(context):
272272
SyncConnectionWizard.cancelFolderSyncConnectionWizard()
273273

274274

275-
@Then("the sync folder should not be added")
275+
@Then("the sync folder list should be empty")
276276
def step(context):
277277
test.vp("empty_sync_connection")
278278

test/gui/shared/steps/sync_context.py

+16
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,19 @@ def step(context, folder_name, selected):
271271
SyncConnectionWizard.is_remote_folder_selected(folder_selector),
272272
"Folder should be selected",
273273
)
274+
275+
276+
@When('the user selects remove folder sync connection option')
277+
def step(context):
278+
SyncConnection.remove_folder_sync_connection()
279+
280+
281+
@When('the user cancels the folder sync connection removal dialog')
282+
def step(context):
283+
SyncConnection.cancel_folder_sync_connection_removal()
284+
285+
286+
@When('the user removes the folder sync connection')
287+
def step(context):
288+
SyncConnection.remove_folder_sync_connection()
289+
SyncConnection.confirm_folder_sync_connection_removal()

test/gui/tst_syncing/test.feature

+12-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Feature: Syncing files
435435
When the user selects manual sync folder option in advanced section
436436
And the user cancels the sync connection wizard
437437
Then the account with displayname "Alice Hansen" and host "%local_server_hostname%" should be displayed
438-
And the sync folder should not be added
438+
And the sync folder list should be empty
439439

440440

441441
Scenario: extract a zip file in the sync folder
@@ -486,3 +486,14 @@ Feature: Syncing files
486486
Then the folder "simple-folder" should not exist on the file system
487487
And the folder "test-folder/sub-folder2" should exist on the file system
488488
And the folder "test-folder/sub-folder1" should not exist on the file system
489+
490+
491+
Scenario: remove folder sync connection
492+
Given user "Alice" has created folder "simple-folder" in the server
493+
And user "Alice" has set up a client with default settings
494+
When the user selects remove folder sync connection option
495+
And the user cancels the folder sync connection removal dialog
496+
And the user removes the folder sync connection
497+
Then the sync folder list should be empty
498+
And the folder "simple-folder" should exist on the file system
499+
And as "Alice" folder "simple-folder" should exist in the server

0 commit comments

Comments
 (0)