def riqiwan(self, wan, id): element = UiUtil.find_elment( 'save', 'wan', ) # js = "$('input[id=laststoretime]').attr('readonly','')" UiUtil.alter_seletor_input(element, wan, id)
def __init__(self): driver = UiUtil.get_driver() Login(driver).do_login({ "username": "******", "password": "******", "verifycode": "0000" })
def __init__(self): self.driver = UiUtil.get_driver()
def input_name(self, name): ele = self.driver.find_element_by_id("customername") UiUtil.input(ele, name)
def click_login(self): login_button = self.driver.find_element_by_css_selector( "button.form-control") UiUtil.click(login_button)
def input_password(self, password): ps = self.driver.find_element_by_id("password") UiUtil.input(ps, password)
def click_login_button(self): login_button_element = UiUtil.find_elment('login', 'login_button') UiUtil.click(login_button_element)
def input_password(self, password): upass_element = UiUtil.find_elment('login', 'upass') UiUtil.input(upass_element, password)
def input_barcode(self, name): element = UiUtil.find_elment('save', 'bar') UiUtil.input(element, name) pass
def input_name(self, name): element = UiUtil.find_elment('save', 'name') UiUtil.input(element, name) pass
def input_hao(self, hao): element = UiUtil.find_elment('save', 'hao') UiUtil.input(element, hao)
def click_vip(self): ele = self.driver.find_element_by_link_text("会员管理") UiUtil.click(ele)
def vip_query(self): ele = self.driver.find_element_by_xpath( "/html/body/div[4]/div[1]/form[2]/div[2]/button[1]") UiUtil.click(ele)
def riqi(self, ripi): ele = self.driver.find_element_by_id("childdate") UiUtil.alter_seletor_input(ele, ripi)
def input_sex(self): ele = self.driver.find_element_by_id("childsex") UiUtil.select_or(ele)
def input_account(self, username): uname_element = UiUtil.find_elment('login', 'uname') UiUtil.input(uname_element, username) def input_password(self, password): upass_element = UiUtil.find_elment('login', 'upass') UiUtil.input(upass_element, password) def input_verifycode(self, verifycode): vfcode_element = UiUtil.find_elment('login', 'vfcode') UiUtil.input(vfcode_element, verifycode) def click_login_button(self): login_button_element = UiUtil.find_elment('login', 'login_button') UiUtil.click(login_button_element) def do_login(self, login_data): self.input_account(login_data['username']) self.input_password(login_data['password']) self.input_verifycode(login_data['verifycode']) self.click_login_button() if __name__ == '__main__': driver = UiUtil.get_driver() data=FileUtil.get_excel("../conf/woniu.json", 0) print(data[0]) Login(driver).do_login(data[0])
def input_account(self, username): uname_element = UiUtil.find_elment('login', 'uname') UiUtil.input(uname_element, username)
def click_save(self): element = UiUtil.find_elment('save', 'text') UiUtil.click(element) pass
def input_verifycode(self, verifycode): vfcode_element = UiUtil.find_elment('login', 'vfcode') UiUtil.input(vfcode_element, verifycode)
def riqiz(self, zao, id): element = UiUtil.find_elment('save', 'zao') # js = "$('input[id=earlystoretime]').attr('readonly','')" UiUtil.alter_seletor_input(element, zao, id)
def input_username(self, username): name = self.driver.find_element_by_id("username") UiUtil.input(name, username)
def type(self, t): element = UiUtil.find_elment('save', 'type') UiUtil.select_text(element, t)
def input_verifycode(self, verifycode): vf = self.driver.find_element_by_id("verifycode") UiUtil.input(vf, verifycode)
def click_type(self): element = UiUtil.find_elment('save', 'type_click') UiUtil.click(element)
def logout(self): ele = self.driver.find_element_by_xpath('//*[text()="注销"]') UiUtil.click(ele)
def input_phone(self, phone): ele = self.driver.find_element_by_id("customerphone") UiUtil.input(ele, phone)