def checked(self,fild_name,*args): '''非下拉多项选择输入值''' for i in args: loc = readXml("multiple_choice","send").format(name=fild_name,index=i) self.clickElement(loc)
def test_default_value(self): '''测试数字组件默认值''' qiqiao.public(self.driver).clickButtonInTitle("添加") default = qiqiao.public(self.driver).getAttribute( readXml("number", "sendValue").format(name="默认100"), "title") self.assertEqual(default, "100")
def sendValue(self, fild_name, value): '''日期时间输入值''' loc = readXml("date_time", "sendValue").format(name=fild_name) self.sendKeys(loc, value) self.clickElement(readXml("date_time", "label").format(name=fild_name))
def sendValueInSubForm(self,sub_form,filed_name,value): '''子表单的多项选择输入数据''' loc = readXml("multiple_choice","subForm").format(form=sub_form,feild=filed_name) self.sendKeys(loc,value)
def sendValue(self, fild_name, value): '''单行文本输入值''' loc = readXml("single_line_text", "sendValue").format(name=fild_name) self.sendKeys(loc, value)
def sendValueTimeInSubForm(self, sub_form, filed_name, value): '''子表单的日期时间输入数据''' loc = readXml("date_time", "subForm").format(form=sub_form, feild=filed_name) self.sendKeys(loc, value)
def searchData(self, filed_name, value): '''使用单行文本字段筛选页面数据''' loc = readXml("single_line_text", "search").format(name=filed_name) self.sendKeys(loc, value) self.clickElement("xpath=>//button[@data-mark='筛选条件搜索按钮']")
def searchData(self,filed_name,value): '''使用多行文本字段筛选页面数据''' loc = readXml("multiline_text","search").format(name=filed_name) self.clear(loc) self.sendKeys(loc,value)
def clickSaveButton(self, subform, button_name): '''点击子表单中的按钮''' loc = readXml("subform", "save_btn").format(sub=subform, button=button_name) # loc = "xpath=>//div[@data-mark='子表弹层_{sub}']//span[text()='{button}']".format(sub=subform,button=button_name) self.clickElement(loc)
def clickAddOneData(self, form_name): '''点击子表单,添加一行按钮''' loc = readXml("subform", "add_one_line").format(name=form_name) # loc = "xpath=>//div[@data-mark='{name}']//span[text()='添加一行']".format(name=form_name) self.clickElement(loc)
def clickAddButton(self, form_name): '''点击子表单,添加按钮''' loc = readXml("subform", "add_btn").format(name=form_name) # loc = "xpath=>//div[@data-mark='{name}']//span[text()='添加']".format(name=form_name) self.clickElement(loc)
def sendValue(self,fild_name,value): '''多行文本输入值''' loc = readXml("multiline_text","sendValue").format(name=fild_name) self.clear(loc) self.sendKeys(loc,value)
def sendValueInSubForm(self,sub_form,filed_name,value): '''子表单的多行文本输入数据''' loc = readXml("multiline_text","subForm").format(form=sub_form,feild=filed_name) self.sendKeys(loc,value)
def searchData(self,filed_name,value): '''使用数字字段筛选页面数据''' loc = readXml("number","search").format(name=filed_name) self.sendKeys(loc,value)
def sendValueInSubForm(self, sub_form, filed_name, value): '''子表单的单行文本输入数据''' loc = readXml("single_line_text", "subForm") self.sendKeys(loc, value)
def sendValueInSubForm(self,sub_form,filed_name,value): '''子表单的数字输入数据''' loc = readXml("number","subForm").format(form=sub_form,feild=filed_name) self.sendKeys(loc,value)
def searchData(self, file_name, search, full_name): '''使用部门单选字段筛选页面数据''' loc = readXml("depart_selector", "search").format(name=file_name) self.sendKeys(loc, search) self.clickElement( readXml("depart_selector", "departname").format(full_name))