Skip to content

Commit b9c05b8

Browse files
PrajwolAmatyasaw-jan
authored andcommitted
add gui test to remove folder sync connection (#11725)
1 parent 097d9b6 commit b9c05b8

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

test/gui/shared/scripts/names.py

+1
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@
5454
create_Remote_Folder_QInputDialog = {"type": "QInputDialog", "unnamed": 1, "visible": 1, "windowTitle": "Create Remote Folder"}
5555
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}
5656
groupBox_folderTreeWidget_QTreeWidget = {"container": add_Folder_Sync_Connection_groupBox_QGroupBox, "name": "folderTreeWidget", "type": "QTreeWidget", "visible": 1}
57+
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
@@ -39,6 +39,20 @@ class SyncConnection:
3939
"type": "QPushButton",
4040
"visible": 1,
4141
}
42+
CANCEL_FOLDER_SYNC_CONNECTION_DIALOG = {
43+
"text": "Cancel",
44+
"type": "QPushButton",
45+
"unnamed": 1,
46+
"visible": 1,
47+
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
48+
}
49+
REMOVE_FOLDER_SYNC_CONNECTION_BUTTON = {
50+
"text": "Remove Folder Sync Connection",
51+
"type": "QPushButton",
52+
"unnamed": 1,
53+
"visible": 1,
54+
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
55+
}
4256

4357
@staticmethod
4458
def openMenu():
@@ -122,3 +136,19 @@ def unselect_folder_in_selective_sync(folder_name):
122136
@staticmethod
123137
def get_folder_connection_count():
124138
return squish.waitForObject(SyncConnection.FOLDER_SYNC_CONNECTION_LIST).count
139+
140+
@staticmethod
141+
def remove_folder_sync_connection():
142+
SyncConnection.performAction("Remove folder sync connection")
143+
144+
@staticmethod
145+
def cancel_folder_sync_connection_removal():
146+
squish.clickButton(
147+
squish.waitForObject(SyncConnection.CANCEL_FOLDER_SYNC_CONNECTION_DIALOG)
148+
)
149+
150+
@staticmethod
151+
def confirm_folder_sync_connection_removal():
152+
squish.clickButton(
153+
squish.waitForObject(SyncConnection.REMOVE_FOLDER_SYNC_CONNECTION_BUTTON)
154+
)

test/gui/shared/steps/account_context.py

+5
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ def step(context):
277277
SyncConnectionWizard.cancelFolderSyncConnectionWizard()
278278

279279

280+
@Then("the sync folder list should be empty")
281+
def step(context):
282+
test.vp("empty_sync_connection")
283+
284+
280285
@When('user "|any|" logs out from the login required dialog')
281286
def step(context, username):
282287
EnterPassword.logout()

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)