-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for verifying options of settings tab
- Loading branch information
1 parent
12f366e
commit 8ad8124
Showing
6 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import names | ||
import squish | ||
|
||
|
||
class Settings: | ||
GENERAL_OPTIONS_ITEM = { | ||
"container": names.scrollArea_generalGroupBox_QGroupBox, | ||
"type": "QCheckBox", | ||
"visible": 1, | ||
} | ||
ADVANCED_OPTIONS_ITEM = { | ||
"container": names.stack_scrollArea_QScrollArea, | ||
"type": "QCheckBox", | ||
"visible": 1, | ||
} | ||
NETWORK_OPTIONS_ITEM = { | ||
"container": names.scrollArea_groupBox_QGroupBox, | ||
"type": "QGroupBox", | ||
"visible": 1, | ||
} | ||
ABOUT_BUTTON = { | ||
"container": names.settings_stack_QStackedWidget, | ||
"name": "about_pushButton", | ||
"type": "QPushButton", | ||
"visible": 1, | ||
} | ||
ABOUT_OWNCLOUD_DIALOG = { | ||
"name": "tabWidget", | ||
"type": "QTabWidget", | ||
"visible": 1, | ||
"window": names.oCC_AboutDialog_OCC_AboutDialog, | ||
} | ||
|
||
GENERAL_OPTIONS_MAP = { | ||
"Start on Login": "autostartCheckBox", | ||
"Use Monochrome Icons in the system tray": "monoIconsCheckBox", | ||
"Language": "languageLabel", | ||
"Show desktop Notifications": "desktopNotificationsCheckBox", | ||
} | ||
ADVANCED_OPTION_MAP = { | ||
"Sync hidden files": "syncHiddenFilesCheckBox", | ||
"Show crash reporter": "", | ||
"Edit ignored files": "ignoredFilesButton", | ||
"Log settings": "logSettingsButton", | ||
"Ask for confirmation before synchronizing folders larger than 500 MB": "newFolderLimitCheckBox", | ||
"Ask for confirmation before synchronizing external storages": "newExternalStorage", | ||
} | ||
NETWORK_OPTION_MAP = { | ||
"Proxy Settings": "proxyGroupBox", | ||
"Download Bandwidth": "downloadBox", | ||
"Upload Bandwidth": "uploadBox", | ||
} | ||
|
||
@staticmethod | ||
def getGeneralOptionSelector(name): | ||
selector = Settings.GENERAL_OPTIONS_ITEM.copy() | ||
selector.update({"name": name}) | ||
if name == "languageLabel": | ||
selector.update({"type": "QLabel"}) | ||
return selector | ||
|
||
@staticmethod | ||
def getAdvancedOptionSelector(name): | ||
selector = Settings.ADVANCED_OPTIONS_ITEM.copy() | ||
selector.update({"name": name}) | ||
if name == "ignoredFilesButton" or name == "logSettingsButton": | ||
selector.update({"type": "QPushButton"}) | ||
return selector | ||
|
||
@staticmethod | ||
def getNetworkOptionSelector(name): | ||
selector = Settings.NETWORK_OPTIONS_ITEM.copy() | ||
selector.update({"name": name}) | ||
return selector | ||
|
||
@staticmethod | ||
def checkGeneralOption(option): | ||
selector = Settings.GENERAL_OPTIONS_MAP[option] | ||
squish.waitForObjectExists(Settings.getGeneralOptionSelector(selector)) | ||
|
||
@staticmethod | ||
def checkAdvancedOption(option): | ||
selector = Settings.ADVANCED_OPTION_MAP[option] | ||
squish.waitForObjectExists(Settings.getAdvancedOptionSelector(selector)) | ||
|
||
@staticmethod | ||
def checkNetworkOption(option): | ||
selector = Settings.NETWORK_OPTION_MAP[option] | ||
squish.waitForObjectExists(Settings.getNetworkOptionSelector(selector)) | ||
|
||
@staticmethod | ||
def clickAboutButton(): | ||
squish.clickButton(squish.waitForObject(Settings.ABOUT_BUTTON)) | ||
|
||
@staticmethod | ||
def isAboutButtonVisible(): | ||
if squish.waitForObject(Settings.ABOUT_BUTTON): | ||
return True | ||
return False | ||
|
||
@staticmethod | ||
def waitForAboutDialogToBeVisible(): | ||
squish.waitForObjectExists(Settings.ABOUT_OWNCLOUD_DIALOG) | ||
|
||
@staticmethod | ||
def closeAboutOwncloudDialog(): | ||
squish.sendEvent( | ||
"QCloseEvent", squish.waitForObject(Settings.ABOUT_OWNCLOUD_DIALOG) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters