diff options
author | Saw-jan <saw.jan.grg3e@gmail.com> | 2022-10-31 09:29:42 +0300 |
---|---|---|
committer | Saw-jan <saw.jan.grg3e@gmail.com> | 2022-11-09 08:42:08 +0300 |
commit | 95a3217f00224813697d2e31cbdd1c3130b9a2df (patch) | |
tree | 90af991f412e13f3939305f782748f977c251bf5 | |
parent | 9df63ad4b5bb245bacac01e460e47c92953152a0 (diff) |
separate PO for sync connection wizard
-rw-r--r-- | test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py | 76 | ||||
-rw-r--r-- | test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py | 95 | ||||
-rw-r--r-- | test/gui/shared/steps/steps.py | 38 | ||||
-rw-r--r-- | test/gui/tst_syncing/test.feature | 6 |
4 files changed, 110 insertions, 105 deletions
diff --git a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py index 5ff8d07ce..7a2bb8663 100644 --- a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py +++ b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py @@ -52,42 +52,10 @@ class AccountConnectionWizard: "visible": 1, "window": names.owncloudWizard_OCC_OwncloudWizard, } - CHOOSE_LOCAL_SYNC_FOLDER = { - "name": "localFolderLineEdit", - "type": "QLineEdit", - "visible": 1, - "window": names.add_Folder_Sync_Connection_OCC_FolderWizard, - } SELECTIVE_SYNC_DIALOG = names.choose_What_to_Sync_OCC_SelectiveSyncDialog - SELECT_REMOTE_DESTINATION_FOLDER_WIZARD = ( - names.add_Folder_Sync_Connection_groupBox_QGroupBox - ) - ADD_FOLDER_SYNC_CONNECTION_NEXT_BUTTON = ( - names.add_Folder_Sync_Connection_qt_passive_wizardbutton1_QPushButton - ) CONF_SYNC_MANUALLY_RADIO_BUTTON = ( names.syncModeGroupBox_configureSyncManuallyRadioButton_QRadioButton ) - ADD_FOLDER_SYNC_CONNECTION_WIZARD = ( - names.add_Folder_Sync_Connection_FolderWizardSourcePage_OCC_FolderWizardLocalPath - ) - ADD_SYNC_CONNECTION_BUTTON = { - "name": "qt_wizard_finish", - "type": "QPushButton", - "visible": 1, - "window": names.add_Folder_Sync_Connection_OCC_FolderWizard, - } - SYNC_DIALOG_FOLDER_TREE = { - "column": 0, - "container": names.deselect_remote_folders_you_do_not_wish_to_synchronize_ownCloud_QModelIndex, - "type": "QModelIndex", - } - SYNC_DIALOG_ROOT_FOLDER = { - "column": 0, - "container": names.add_Folder_Sync_Connection_Deselect_remote_folders_you_do_not_wish_to_synchronize_QTreeWidget, - "text": "ownCloud", - "type": "QModelIndex", - } ADVANCED_CONFIGURATION_CHECKBOX = { "container": names.setupWizardWindow_contentWidget_QStackedWidget, "name": "advancedConfigGroupBox", @@ -176,47 +144,3 @@ class AccountConnectionWizard: def selectManualSyncFolder(self): squish.clickButton(squish.waitForObject(self.CONF_SYNC_MANUALLY_RADIO_BUTTON)) - - def selectFoldersToSync(self, context): - # first deselect all - squish.mouseClick( - squish.waitForObject(self.SYNC_DIALOG_ROOT_FOLDER), - 11, - 11, - squish.Qt.NoModifier, - squish.Qt.LeftButton, - ) - for row in context.table[1:]: - self.SYNC_DIALOG_FOLDER_TREE['text'] = row[ - 0 - ] # added a new key 'text' to dictionary SYNC_DIALOG_FOLDER_TREE - squish.mouseClick( - squish.waitForObject(self.SYNC_DIALOG_FOLDER_TREE), - 11, - 11, - squish.Qt.NoModifier, - squish.Qt.LeftButton, - ) - - def sortBy(self, headerText): - squish.mouseClick( - squish.waitForObject( - { - "container": names.deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView_2, - "text": headerText, - "type": "HeaderViewItem", - "visible": True, - } - ) - ) - - def selectARootSyncDirectory(self, folderName): - squish.mouseClick( - squish.waitForObjectItem( - names.groupBox_folderTreeWidget_QTreeWidget, folderName - ), - 0, - 0, - squish.Qt.NoModifier, - squish.Qt.LeftButton, - ) diff --git a/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py b/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py new file mode 100644 index 000000000..449a34227 --- /dev/null +++ b/test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py @@ -0,0 +1,95 @@ +import names +import squish +from helpers.SetupClientHelper import getClientDetails, createUserSyncPath + + +class SyncConnectionWizard: + ADD_FOLDER_SYNC_CONNECTION_WIZARD = ( + names.add_Folder_Sync_Connection_FolderWizardSourcePage_OCC_FolderWizardLocalPath + ) + CHOOSE_LOCAL_SYNC_FOLDER = { + "name": "localFolderLineEdit", + "type": "QLineEdit", + "visible": 1, + "window": names.add_Folder_Sync_Connection_OCC_FolderWizard, + } + ADD_FOLDER_SYNC_CONNECTION_NEXT_BUTTON = ( + names.add_Folder_Sync_Connection_qt_passive_wizardbutton1_QPushButton + ) + SYNC_DIALOG_ROOT_FOLDER = { + "column": 0, + "container": names.add_Folder_Sync_Connection_Deselect_remote_folders_you_do_not_wish_to_synchronize_QTreeWidget, + "text": "ownCloud", + "type": "QModelIndex", + } + SYNC_DIALOG_FOLDER_TREE = { + "column": 0, + "container": names.deselect_remote_folders_you_do_not_wish_to_synchronize_ownCloud_QModelIndex, + "type": "QModelIndex", + } + ADD_SYNC_CONNECTION_BUTTON = { + "name": "qt_wizard_finish", + "type": "QPushButton", + "visible": 1, + "window": names.add_Folder_Sync_Connection_OCC_FolderWizard, + } + SELECT_REMOTE_DESTINATION_FOLDER_WIZARD = ( + names.add_Folder_Sync_Connection_groupBox_QGroupBox + ) + + def setSyncPathInSyncConnectionWizard(self, context): + squish.waitForObject(self.ADD_FOLDER_SYNC_CONNECTION_WIZARD) + squish.type(self.CHOOSE_LOCAL_SYNC_FOLDER, context.userData['currentUserSyncPath']) + self.nexStep() + + def nexStep(self): + squish.clickButton(squish.waitForObject(self.ADD_FOLDER_SYNC_CONNECTION_NEXT_BUTTON)) + + def selectRemoteDestinationFolder(self, folder): + squish.waitForObject(self.SELECT_REMOTE_DESTINATION_FOLDER_WIZARD) + squish.mouseClick( + squish.waitForObjectItem( + names.groupBox_folderTreeWidget_QTreeWidget, folder + ), + 0, + 0, + squish.Qt.NoModifier, + squish.Qt.LeftButton, + ) + self.nexStep() + + def selectFoldersToSync(self, context): + # first deselect all + squish.mouseClick( + squish.waitForObject(self.SYNC_DIALOG_ROOT_FOLDER), + 11, + 11, + squish.Qt.NoModifier, + squish.Qt.LeftButton, + ) + for row in context.table[1:]: + self.SYNC_DIALOG_FOLDER_TREE['text'] = row[ + 0 + ] # added a new key 'text' to dictionary SYNC_DIALOG_FOLDER_TREE + squish.mouseClick( + squish.waitForObject(self.SYNC_DIALOG_FOLDER_TREE), + 11, + 11, + squish.Qt.NoModifier, + squish.Qt.LeftButton, + ) + + def sortBy(self, headerText): + squish.mouseClick( + squish.waitForObject( + { + "container": names.deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView_2, + "text": headerText, + "type": "HeaderViewItem", + "visible": True, + } + ) + ) + + def addSyncConnection(self): + squish.clickButton(squish.waitForObject(self.ADD_SYNC_CONNECTION_BUTTON))
\ No newline at end of file diff --git a/test/gui/shared/steps/steps.py b/test/gui/shared/steps/steps.py index a82b42c79..2c93bc684 100644 --- a/test/gui/shared/steps/steps.py +++ b/test/gui/shared/steps/steps.py @@ -12,6 +12,7 @@ import builtins import shutil from pageObjects.AccountConnectionWizard import AccountConnectionWizard +from pageObjects.SyncConnectionWizard import SyncConnectionWizard from helpers.SetupClientHelper import * from helpers.FilesHelper import buildConflictedRegex from pageObjects.EnterPassword import EnterPassword @@ -1284,31 +1285,21 @@ def step(context): @When('the user selects the following folders to sync:') def step(context): - newAccount = AccountConnectionWizard() - newAccount.selectFoldersToSync(context) - clickButton(waitForObject(newAccount.ADD_SYNC_CONNECTION_BUTTON)) + syncConnection = SyncConnectionWizard() + syncConnection.selectFoldersToSync(context) + syncConnection.addSyncConnection() @When('the user sorts the folder list by "|any|"') def step(context, headerText): headerText = headerText.capitalize() if headerText in ["Size", "Name"]: - newAccount = AccountConnectionWizard() - newAccount.sortBy(headerText) + syncConnection = SyncConnectionWizard() + syncConnection.sortBy(headerText) else: raise Exception("Sorting by '" + headerText + "' is not supported.") -@Then('the dialog chose_what_to_sync should be visible') -def step(context): - newAccount = AccountConnectionWizard() - test.compare( - waitForObjectExists(newAccount.SELECTIVE_SYNC_DIALOG).visible, - True, - "Assert selective sync dialog is visible", - ) - - @Then('the sync all checkbox should be checked') def step(context): newAccount = AccountConnectionWizard() @@ -1471,21 +1462,16 @@ def step(context): waitForObject(AccountConnectionWizard.CREDENTIAL_PAGE) -@When('the user "|any|" clicks on the next button in sync connection wizard') -def step(context, userName): - newAccount = AccountConnectionWizard() - waitForObject(newAccount.ADD_FOLDER_SYNC_CONNECTION_WIZARD) - syncPath = createUserSyncPath(context, userName) - type(newAccount.CHOOSE_LOCAL_SYNC_FOLDER, syncPath) - clickButton(waitForObject(newAccount.ADD_FOLDER_SYNC_CONNECTION_NEXT_BUTTON)) +@When('the user sets the sync path in sync connection wizard') +def step(context): + syncConnection = SyncConnectionWizard() + syncConnection.setSyncPathInSyncConnectionWizard() @When('the user selects "|any|" as a remote destination folder') def step(context, folderName): - newAccount = AccountConnectionWizard() - waitForObject(newAccount.SELECT_REMOTE_DESTINATION_FOLDER_WIZARD) - newAccount.selectARootSyncDirectory(folderName) - clickButton(waitForObject(newAccount.ADD_FOLDER_SYNC_CONNECTION_NEXT_BUTTON)) + syncConnection = SyncConnectionWizard() + syncConnection.selectRemoteDestinationFolder(folderName) @When('the user selects vfs option in advanced section') diff --git a/test/gui/tst_syncing/test.feature b/test/gui/tst_syncing/test.feature index 487517c5d..e0a03d241 100644 --- a/test/gui/tst_syncing/test.feature +++ b/test/gui/tst_syncing/test.feature @@ -64,7 +64,7 @@ Feature: Syncing files | user | Alice | | password | 1234 | When the user selects manual sync folder option in advanced section - And the user "Alice" clicks on the next button in sync connection wizard + And the user sets the sync path in sync connection wizard And the user selects "ownCloud" as a remote destination folder Then the sync all checkbox should be checked @@ -78,7 +78,7 @@ Feature: Syncing files | user | Alice | | password | 1234 | When the user selects manual sync folder option in advanced section - And the user "Alice" clicks on the next button in sync connection wizard + And the user sets the sync path in sync connection wizard And the user selects "ownCloud" as a remote destination folder And the user selects the following folders to sync: | folder | @@ -99,7 +99,7 @@ Feature: Syncing files | user | Alice | | password | 1234 | When the user selects manual sync folder option in advanced section - And the user "Alice" clicks on the next button in sync connection wizard + And the user sets the sync path in sync connection wizard And the user selects "ownCloud" as a remote destination folder # folders are sorted by name in ascending order by default Then the folders should be in the following order: |