def addServer(self, context): clientDetails = getClientDetails(context) squish.mouseClick(squish.waitForObject(self.SERVER_ADDRESS_BOX)) squish.type( squish.waitForObject(self.SERVER_ADDRESS_BOX), clientDetails['server'] ) squish.clickButton(squish.waitForObject(self.NEXT_BUTTON))
def enterPassword(self, password): try: squish.waitForObject(self.PASSWORD_BOX, 10000) squish.type(squish.waitForObject(self.PASSWORD_BOX), password) squish.clickButton(squish.waitForObject(self.OK_BUTTON)) except LookupError: pass
def createPublicLink(self, context, resource, password='', permissions=''): radioObjectName = '' if permissions: radioObjectName = self.getRadioObjectForPermssion(permissions) test.compare( str(squish.waitForObjectExists(self.ITEM_TO_SHARE).text), resource.replace(context.userData['clientSyncPathUser1'], ''), ) if radioObjectName: test.compare(str(squish.waitForObjectExists(radioObjectName).text), permissions) squish.clickButton(squish.waitForObject(radioObjectName)) if password: squish.clickButton(squish.waitForObject(self.PASSWORD_CHECKBOX)) squish.mouseClick( squish.waitForObject(self.PASSWORD_CHECKBOX), 0, 0, squish.Qt.NoModifier, squish.Qt.LeftButton, ) squish.type( squish.waitForObject(self.PASSWORD_CHECKBOX), password, ) squish.clickButton(squish.waitForObject(self.CREATE_SHARE_BUTTON)) squish.waitFor(lambda: (squish.waitForObject( names.linkShares_0_0_QModelIndex).displayText == "Public link"))
def selectSyncFolder(self, context): clientDetails = getClientDetails(context) try: squish.clickButton(squish.waitForObject(self.ERROR_OK_BUTTON)) except LookupError: pass squish.clickButton(squish.waitForObject(self.SELECT_LOCAL_FOLDER)) squish.mouseClick(squish.waitForObject(self.DIRECTORY_NAME_BOX)) squish.type( squish.waitForObject(self.DIRECTORY_NAME_BOX), clientDetails['localfolder'] ) squish.clickButton(squish.waitForObject(self.CHOOSE_BUTTON)) test.compare( str(squish.waitForObjectExists(self.SELECT_LOCAL_FOLDER).text), self.sanitizeFolderPath(clientDetails['localfolder']), )
def selectCollaborator(self, receiver, isGroup=False): postFixInSuggestion = "" if isGroup: postFixInSuggestion = " (group)" squish.mouseClick( squish.waitForObject(self.SHARE_WITH_COLLABORATOR_INPUT_FIELD), 0, 0, squish.Qt.NoModifier, squish.Qt.LeftButton, ) squish.type( squish.waitForObject(self.SHARE_WITH_COLLABORATOR_INPUT_FIELD), receiver, ) squish.mouseClick( squish.waitForObjectItem(self.SUGGESTED_COLLABORATOR, receiver + postFixInSuggestion), 0, 0, squish.Qt.NoModifier, squish.Qt.LeftButton, )
def write(obj, val): squish.type(waitForObject(obj), val)
def clear(obj): item = waitForObject(obj) squish.type(item, "<Ctrl+A>") squish.type(item, "<Delete>")
def addUserCreds(self, context): clientDetails = getClientDetails(context) 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']) squish.clickButton(squish.waitForObject(self.NEXT_BUTTON))