def test_form_only_check(self): '''测试表单唯一校验''' qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("单行文本","测试数据") qiqiao.public(self.driver).clickSubmit() msg = qiqiao.public(self.driver).getText("xpath=>//p[@class='el-message__content']") self.assertEqual(msg,"单行文本必须唯一!!!")
def test_search_by_line_text(self): '''通过单行文本筛选页面数据''' qiqiao.singleLineText(self.driver).searchData("单行文本","测试数据") time.sleep(1) title = qiqiao.public(self.driver).getText("xpath=>//span[@class='el-pagination__total']") self.assertIn("1",title)
def test_add_data(self): '''测试添加数据''' qiqiao.public(self.driver).clickLeftMenu("基础表") qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("单行文本","自动化") qiqiao.public(self.driver).clickSubmit() html = self.driver.page_source self.assertIn("自动化",html)
def test_data_linkage(self): '''测试单行文本数据联动''' qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("必填_唯一", "测试") time.sleep(1) link_value = qiqiao.public(self.driver).getAttribute( readXml("single_line_text", "sendValue").format(name="数据联动"), "title") self.assertEqual(link_value, "20")
def test_onlyone(self): '''测试单行文本唯一校验''' qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("必填_唯一", "测试") time.sleep(1) qiqiao.public(self.driver).clickSubmit() msg = qiqiao.public( self.driver).getText("xpath=>//p[@class='el-message__content']") self.assertEqual(msg, "[必填_唯一]值必须唯一")
def test_input_number_or_english(self): '''测试单行文本输入英文或数字''' qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("必填_唯一", "测试") qiqiao.singleLineText(self.driver).sendValue("数字或英文2到10", "道一") time.sleep(1) qiqiao.public(self.driver).clickSubmit() msg = qiqiao.public( self.driver).getText("xpath=>//div[@class='el-form-item__error']") self.assertEqual(msg, "请输入数字或英文")
def test_english_length_limit(self): '''测试单行文本输入英文并限制长度''' qiqiao.public(self.driver).clickButtonInTitle("添加") qiqiao.singleLineText(self.driver).sendValue("必填_唯一", "测试") qiqiao.singleLineText(self.driver).sendValue("英文5到10", "Donn") time.sleep(1) qiqiao.public(self.driver).clickSubmit() msg = qiqiao.public( self.driver).getText("xpath=>//div[@class='el-form-item__error']") self.assertEqual(msg, "字符长度必须在5和10之间")