Skip to content

Commit

Permalink
add gui test to remove folder sync connection (#11725)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya authored and saw-jan committed Jul 8, 2024
1 parent 097d9b6 commit b9c05b8
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/gui/shared/scripts/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
create_Remote_Folder_QInputDialog = {"type": "QInputDialog", "unnamed": 1, "visible": 1, "windowTitle": "Create Remote Folder"}
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}
groupBox_folderTreeWidget_QTreeWidget = {"container": add_Folder_Sync_Connection_groupBox_QGroupBox, "name": "folderTreeWidget", "type": "QTreeWidget", "visible": 1}
confirm_Folder_Sync_Connection_Removal_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowTitle": "Confirm Folder Sync Connection Removal"}
30 changes: 30 additions & 0 deletions test/gui/shared/scripts/pageObjects/SyncConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ class SyncConnection:
"type": "QPushButton",
"visible": 1,
}
CANCEL_FOLDER_SYNC_CONNECTION_DIALOG = {
"text": "Cancel",
"type": "QPushButton",
"unnamed": 1,
"visible": 1,
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
}
REMOVE_FOLDER_SYNC_CONNECTION_BUTTON = {
"text": "Remove Folder Sync Connection",
"type": "QPushButton",
"unnamed": 1,
"visible": 1,
"window": names.confirm_Folder_Sync_Connection_Removal_QMessageBox,
}

@staticmethod
def openMenu():
Expand Down Expand Up @@ -122,3 +136,19 @@ def unselect_folder_in_selective_sync(folder_name):
@staticmethod
def get_folder_connection_count():
return squish.waitForObject(SyncConnection.FOLDER_SYNC_CONNECTION_LIST).count

@staticmethod
def remove_folder_sync_connection():
SyncConnection.performAction("Remove folder sync connection")

@staticmethod
def cancel_folder_sync_connection_removal():
squish.clickButton(
squish.waitForObject(SyncConnection.CANCEL_FOLDER_SYNC_CONNECTION_DIALOG)
)

@staticmethod
def confirm_folder_sync_connection_removal():
squish.clickButton(
squish.waitForObject(SyncConnection.REMOVE_FOLDER_SYNC_CONNECTION_BUTTON)
)
5 changes: 5 additions & 0 deletions test/gui/shared/steps/account_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ def step(context):
SyncConnectionWizard.cancelFolderSyncConnectionWizard()


@Then("the sync folder list should be empty")
def step(context):
test.vp("empty_sync_connection")


@When('user "|any|" logs out from the login required dialog')
def step(context, username):
EnterPassword.logout()
Expand Down
16 changes: 16 additions & 0 deletions test/gui/shared/steps/sync_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,19 @@ def step(context, folder_name, selected):
SyncConnectionWizard.is_remote_folder_selected(folder_selector),
"Folder should be selected",
)


@When('the user selects remove folder sync connection option')
def step(context):
SyncConnection.remove_folder_sync_connection()


@When('the user cancels the folder sync connection removal dialog')
def step(context):
SyncConnection.cancel_folder_sync_connection_removal()


@When('the user removes the folder sync connection')
def step(context):
SyncConnection.remove_folder_sync_connection()
SyncConnection.confirm_folder_sync_connection_removal()
13 changes: 12 additions & 1 deletion test/gui/tst_syncing/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Feature: Syncing files
When the user selects manual sync folder option in advanced section
And the user cancels the sync connection wizard
Then the account with displayname "Alice Hansen" and host "%local_server_hostname%" should be displayed
And the sync folder should not be added
And the sync folder list should be empty


Scenario: extract a zip file in the sync folder
Expand Down Expand Up @@ -486,3 +486,14 @@ Feature: Syncing files
Then the folder "simple-folder" should not exist on the file system
And the folder "test-folder/sub-folder2" should exist on the file system
And the folder "test-folder/sub-folder1" should not exist on the file system


Scenario: remove folder sync connection
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has set up a client with default settings
When the user selects remove folder sync connection option
And the user cancels the folder sync connection removal dialog
And the user removes the folder sync connection
Then the sync folder list should be empty
And the folder "simple-folder" should exist on the file system
And as "Alice" folder "simple-folder" should exist in the server

0 comments on commit b9c05b8

Please sign in to comment.