def icon_wait(self, dict): try: x = self.sn.wait(dict['key'], int(dict['sec'])) if x == False: raise error.notfind() except: raise error.notfind()
def icon_click(self, name): try: x = self.sn.exists(name['key']) if x != "None": self.sn.click(name['key']) else: raise error.notfind() except: raise error.notfind()
def icon_hover(self, name): try: x = self.screen.exists(name['key']) if x != "None": self.sn.hover(name['key']) else: raise error.notfind() except: raise error.notfind()
def zero_pwd_set(self, browser, value_dict): try: local_dict = dict(value_dict) elem = browser.find_element_by_id('password') elem.send_keys(local_dict["key"]) except: raise error.notfind()
def textbox_password_set(self, browser, value_dict): try: local_dict = dict(value_dict) elem = browser.find_element_by_id( config.get("login", "id_signin_passwd")) elem.send_keys(local_dict["key"]) except: raise error.notfind()
def zero_username_set(self, browser, value_dict): try: local_dict = dict(value_dict) elem = browser.find_element_by_id(config.get( "loginn", "id_sign_u")) #elem = browser.find_element_by_id('username') elem.send_keys(local_dict["key"]) except: raise error.notfind()
def button_login_click(self, browser): try: text = config.get("login", "class_signin_button") xpath = "//button[@class='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) elem.click() except: raise error.notfind()
def save_click(self, browser): try: text = config.get("sharefolder_common", "class_save_button") xpath = "//button[@ng-click='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) Hover = ActionChains(browser).move_to_element(elem) Hover.click().perform() except: raise error.notfind()
def nor_text_foldername_set(self, browser, value_dict): try: local_dict = dict(value_dict) text = config.get("sharefolder_normail", "placeholder_folder_text") xpath = "//input[@placeholder='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) #Hover = ActionChains(browser).move_to_element(elem) elem.send_keys(local_dict["key"]) except: raise error.notfind()
def nor_checkbox_smbandcifs_click(self, browser): try: text = config.get("sharefolder_normail", "ng-model_smbandcifs_text") xpath = "//input[@ng-model='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) Hover = ActionChains(browser).move_to_element(elem) Hover.click().perform() except: raise error.notfind()
def aclsetfolder_click(self, browser): try: text = config.get("sharefolder_common", "class_aclsetfolder_button") xpath = "//ul//li[contains(.,'replace')]" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) Hover = ActionChains(browser).move_to_element(elem) Hover.click().perform() except: raise error.notfind()
def newfolder_click(self, browser): try: text = config.get("setting", "class_new_button") xpath = "//button[@class='replace ']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) Hover = ActionChains(browser).move_to_element(elem) Hover.click().perform() #print elem.text except: raise error.notfind()
def nor_text_sharefoldername_clear(self, browser): try: text = config.get("sharefolder_normail", "placeholder_sharefolder_text") xpath = "//input[@placeholder='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) #Hover = ActionChains(browser).move_to_element(elem) elem.clear() except: raise error.notfind()
def sharefolder_click(self, browser): try: text = config.get("overview", "class_sharefolder") xpath = "//div[@class='replace']" elem = browser.find_element_by_xpath(xpath.replace( "replace", text)) Hover = ActionChains(browser).move_to_element(elem) Hover.click().perform() #print elem.text except: raise error.notfind()
def testerror_get(self): raise error.notfind()
def text_type(self, text): try: self.sn.type(text['value']) except: raise error.notfind()
def file_verify(self): my_file = Path("test.txt") if my_file.is_file() == True: return else: raise error.notfind()
def enter_type(self): try: self.sn.type("\n") except: raise error.notfind()