def input_earlytime(self, earlystoretime): eartime = UiUtil.find_element('store_query', 'earlytime') UiUtil.alter_seletor_input_earlystoretime(eartime, earlystoretime)
def input_barcode(self, barcode): code = UiUtil.find_element('store_query', 'barcode') UiUtil.input(code, barcode)
def input_goodstype(self, goodstype): type = UiUtil.find_element('store_query', 'goodstype') UiUtil.select_by_text(type, goodstype)
def click_login_button(self): login_button = UiUtil.find_element('login', 'login_button') UiUtil.click(login_button)
def input_cusname(self, cusname): cname = self.driver.find_element_by_id('customername') UiUtil.input(cname, cusname)
def input_verifycode(self, verifycode): vfcode = UiUtil.find_element('login', 'vfcode') UiUtil.input(vfcode, verifycode) def click_login_button(self): login_button = UiUtil.find_element('login', 'login_button') UiUtil.click(login_button) def click_loginout_button(self): logout = UiUtil.find_element('login', 'logout_uname') UiUtil.click(logout) logout_button = UiUtil.find_element('login', 'logout_button') UiUtil.click(logout_button) def do_login(self, login_data): self.input_username(login_data['username']) self.input_password(login_data['password']) self.input_verifycode(login_data['verifycode']) self.click_login_button() def do_loginout(self, login_data): self.do_login(login_data) time.sleep(5) self.click_loginout_button() if __name__ == '__main__': driver = UiUtil.get_driver() login_data = {'username': '******', 'password': '******', 'verifycode': '0000'} Login(driver).do_loginout(login_data)
def input_password(self, password): pws = UiUtil.find_element('login', 'upass') UiUtil.input(pws, password)
def click_query_button(self): query_button = self.driver.find_element_by_css_selector( 'button.form-control:nth-child(3)') UiUtil.click(query_button)
def click_alter_button(self): alter_button = self.driver.find_element_by_id('editBtn') UiUtil.click(alter_button)
def input_creditcloth(self, creditcloth): credcloth = self.driver.find_element_by_id('creditcloth') UiUtil.input(credcloth, creditcloth)
def click_add_button(self): add_button = self.driver.find_element_by_css_selector( 'button.form-control:nth-child(1)') UiUtil.click(add_button)
def input_creditkids(self, creditkids): credit = self.driver.find_element_by_id('creditkids') UiUtil.input(credit, creditkids)
def input_data(self, childdate): data = self.driver.find_element_by_id('childdate') UiUtil.alter_seletor_input(data, 'id=childdate', childdate)
def input_sex(self, childsex): sex = self.driver.find_element_by_id('childsex') UiUtil.select_by_text(sex, childsex)
def input_endtime(self, laststoretime): lasttime = UiUtil.find_element('store_query', 'lasttime') UiUtil.alter_seletor_input_laststoretime(lasttime, laststoretime)
def click_condition_button(self): button = UiUtil.find_element('store_query', 'condition_query') UiUtil.click(button)
def click_query_button(self): button = UiUtil.find_element('store_query', 'query_button') UiUtil.click(button)
def click_zeroStored_button(self): button = UiUtil.find_element('store_query', 'zeroStored_query') UiUtil.click(button)
def input_username(self, username): uname = UiUtil.find_element('login', 'uname') UiUtil.input(uname, username)
def input_goodsSize(self, goodsserial): gsize = UiUtil.find_element('store_query', 'gserial') UiUtil.input(gsize, goodsserial)
def input_verifycode(self, verifycode): vfcode = UiUtil.find_element('login', 'vfcode') UiUtil.input(vfcode, verifycode)
def input_goodsname(self, goodsname): gname = UiUtil.find_element('store_query', 'gname') UiUtil.input(gname, goodsname)
def click_loginout_button(self): logout = UiUtil.find_element('login', 'logout_uname') UiUtil.click(logout) logout_button = UiUtil.find_element('login', 'logout_button') UiUtil.click(logout_button)
def input_cusphone(self, customerphone): cphone = self.driver.find_element_by_id('customerphone') UiUtil.input(cphone, customerphone)