diff options
author | Saw-jan Gurung <saw.jan.grg3e@gmail.com> | 2021-10-26 13:08:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 13:08:26 +0300 |
commit | d4f52b107fe5a066662a060bdbc2e7357f8be084 (patch) | |
tree | 90f304c83dd973fb504e79392e072ef7088bfa4f /test/gui/shared/scripts | |
parent | 4479ec828b6d7ee497147c7f4120c02dcf897360 (diff) |
add gui tests for selective sync scenarios (#9009)
add more tests for selective sync scenarios
address reviews
refactor test steps
address reviews
Diffstat (limited to 'test/gui/shared/scripts')
-rw-r--r-- | test/gui/shared/scripts/names.py | 7 | ||||
-rw-r--r-- | test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py | 97 |
2 files changed, 98 insertions, 6 deletions
diff --git a/test/gui/shared/scripts/names.py b/test/gui/shared/scripts/names.py index d0e955dbe..f17255648 100644 --- a/test/gui/shared/scripts/names.py +++ b/test/gui/shared/scripts/names.py @@ -106,4 +106,9 @@ error_QMessageBox = {"type": "QMessageBox", "unnamed": 1, "visible": 1, "windowT oCC_SslErrorDialog_OCC_SslErrorDialog = {"name": "OCC__SslErrorDialog", "type": "OCC::SslErrorDialog", "visible": 1} oCC_SslErrorDialog_cbTrustConnect_QCheckBox = {"name": "_cbTrustConnect", "type": "QCheckBox", "visible": 1, "window": oCC_SslErrorDialog_OCC_SslErrorDialog} oCC_SslErrorDialog_OK_QPushButton = {"text": "OK", "type": "QPushButton", "unnamed": 1, "visible": 1, "window": oCC_SslErrorDialog_OCC_SslErrorDialog} -owncloudWizard_urlLabel_QLabel = {"name": "urlLabel", "type": "QLabel", "visible": 1, "window": owncloudWizard_OCC_OwncloudWizard}
\ No newline at end of file +owncloudWizard_urlLabel_QLabel = {"name": "urlLabel", "type": "QLabel", "visible": 1, "window": owncloudWizard_OCC_OwncloudWizard} +owncloudWizard_urlLabel_QLabel = {"name": "urlLabel", "type": "QLabel", "visible": 1, "window": owncloudWizard_OCC_OwncloudWizard} +choose_What_to_Sync_OCC_SelectiveSyncDialog = {"type": "OCC::SelectiveSyncDialog", "unnamed": 1, "visible": 1, "windowTitle": "Choose What to Sync"} +choose_What_to_Sync_Deselect_remote_folders_you_do_not_wish_to_synchronize_QLabel = {"text": "Deselect remote folders you do not wish to synchronize.", "type": "QLabel", "unnamed": 1, "visible": 1, "window": choose_What_to_Sync_OCC_SelectiveSyncDialog} +choose_What_To_Synchronize_QTreeWidget = {"aboveWidget": choose_What_to_Sync_Deselect_remote_folders_you_do_not_wish_to_synchronize_QLabel, "type": "QTreeWidget", "unnamed": 1, "visible": 1, "window": choose_What_to_Sync_OCC_SelectiveSyncDialog} +deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView = {"container": choose_What_To_Synchronize_QTreeWidget, "orientation": 1, "type": "QHeaderView", "unnamed": 1, "visible": 1} diff --git a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py index 264dadba2..4fa2f233c 100644 --- a/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py +++ b/test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py @@ -31,6 +31,45 @@ class AccountConnectionWizard: "visible": 1, "window": names.owncloudWizard_OCC_OwncloudWizard, } + CREDENTIAL_PAGE = { + "name": "OwncloudHttpCredsPage", + "type": "OCC::OwncloudHttpCredsPage", + "visible": 1, + "window": names.owncloudWizard_OCC_OwncloudWizard, + } + ADVANCE_SETUP_PAGE = { + "name": "OwncloudAdvancedSetupPage", + "type": "OCC::OwncloudAdvancedSetupPage", + "visible": 1, + "window": names.owncloudWizard_OCC_OwncloudWizard, + } + MANUAL_SYNC_FOLDER_OPTION = { + "name": "rManualFolder", + "type": "QRadioButton", + "visible": 1, + "window": names.owncloudWizard_OCC_OwncloudWizard, + } + CHOOSE_WHAT_TO_SYNC_BUTTON = { + "name": "bSelectiveSync", + "type": "QPushButton", + "visible": 1, + "window": names.owncloudWizard_OCC_OwncloudWizard, + } + SELECTIVE_SYNC_DIALOG = names.choose_What_to_Sync_OCC_SelectiveSyncDialog + SYNC_DIALOG_FOLDER_TREE = names.choose_What_To_Synchronize_QTreeWidget + SYNC_DIALOG_ROOT_FOLDER = { + "column": 0, + "container": SYNC_DIALOG_FOLDER_TREE, + "text": "/", + "type": "QModelIndex", + } + SYNC_DIALOG_OK_BUTTON = { + "text": "OK", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": SELECTIVE_SYNC_DIALOG, + } def __init__(self): pass @@ -38,15 +77,16 @@ class AccountConnectionWizard: def sanitizeFolderPath(self, folderPath): return folderPath.rstrip("/") - def addServer(self, serverAddress): + def addServer(self, context): + clientDetails = getClientDetails(context) squish.mouseClick(squish.waitForObject(self.SERVER_ADDRESS_BOX)) - squish.type(squish.waitForObject(self.SERVER_ADDRESS_BOX), serverAddress) + squish.type( + squish.waitForObject(self.SERVER_ADDRESS_BOX), clientDetails['server'] + ) squish.clickButton(squish.waitForObject(self.NEXT_BUTTON)) - def addAccount(self, context): + def addUserCreds(self, context): clientDetails = getClientDetails(context) - self.addServer(clientDetails['server']) - squish.mouseClick(squish.waitForObject(self.SERVER_ADDRESS_BOX)) squish.type(squish.waitForObject(self.USERNAME_BOX), clientDetails['user']) squish.type(squish.waitForObject(self.USERNAME_BOX), "<Tab>") squish.type(squish.waitForObject(self.PASSWORD_BOX), clientDetails['password']) @@ -69,4 +109,51 @@ class AccountConnectionWizard: str(squish.waitForObjectExists(self.SELECT_LOCAL_FOLDER).text), self.sanitizeFolderPath(clientDetails['localfolder']), ) + + def connectAccount(self): squish.clickButton(squish.waitForObject(self.FINISH_BUTTON)) + + def addAccount(self, context): + self.addServer(context) + self.addUserCreds(context) + self.selectSyncFolder(context) + self.connectAccount() + + def openSyncDialog(self): + squish.clickButton(squish.waitForObject(self.CHOOSE_WHAT_TO_SYNC_BUTTON)) + + def selectManualSyncFolder(self): + squish.clickButton(squish.waitForObject(self.MANUAL_SYNC_FOLDER_OPTION)) + + def selectFoldersToSync(self, context): + self.openSyncDialog() + + # 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:]: + squish.mouseClick( + squish.waitForObjectItem(self.SYNC_DIALOG_FOLDER_TREE, "/." + row[0]), + 11, + 11, + squish.Qt.NoModifier, + squish.Qt.LeftButton, + ) + squish.clickButton(squish.waitForObject(self.SYNC_DIALOG_OK_BUTTON)) + + def sortBy(self, headerText): + squish.mouseClick( + squish.waitForObject( + { + "container": names.deselect_remote_folders_you_do_not_wish_to_synchronize_QHeaderView, + "text": headerText, + "type": "HeaderViewItem", + "visible": True, + } + ) + ) |