def test01_create(self, data): """用户组管理新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) new_clocking_in = UserGroupManagementList(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') district = data['地区选择'].split('-') start_date = data['考勤年度开始日期'].split('-') take_effect_date = data['考勤体系生效日期'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 new_clocking_in.operation_btn('') driver.find_element_by_xpath( "/html/body/ul/li[contains(text(),'{0}')]".format( '超级管理员')).click() # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 将滚动条拉到最底层 js1 = "window.scrollTo(0,100)" driver.execute_script(js1) # # # 考勤年度开始日期 # XZ.input_(start_date[0], start_date[1]) # # 考勤体系生效日期 # XZ.input_(take_effect_date[0], take_effect_date[1]) # 保存 add.save_btn(handle) sleep(0.5) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) new_clocking_in.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: new_clocking_in.error_screen(name + '失败') print(name + '失败') raise e print("-------------------用户组管理test_create运行完毕-------------------")
def test01_create(self, data): """公告管理新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) announce_ments = AnnouncementsList(driver) add = Add(driver) name = data['用例描述'] code = data['标题'].split('-') operant = data['生效日'].split('=') content = data['内容'] trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 筛选出所有编码元素 if code[1] not in XZ.data_list(): # 新增按钮 announce_ments.operation_btn(trigger_btn) # 标题 XZ.input_(code[0], code[1]) # 内容 add.mtext(content) # # 发送所有人 XZ.checkbox1('发送所有人') # 封面 add.upload( '封面', r"F:\wfm_flow\unit\up_picture.exe F:\wfm_flow\unit\tu.png") # 生效日 XZ.input_(operant[0], operant[1]) # 保存并发布 add.save_btn(handle) # 获取标题列表 account_list2 = XZ.data_list() # 断言 try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertIn(expect, account_list2) announce_ments.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: announce_ments.error_screen(name + '失败') print(name + '失败') raise e else: print("该账户已经存在") print("-------------------公告管理test01_create运行完毕-------------------")
def test01_create_correct(self, data): """休假类型新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) leave_type = LeaveTypeList(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') trigger_btn = data['触发按钮'] unit = data['单位'].split('-') handle = data['操作'] use_vacation_types_first = data['优先使用休假类型'].split('-') expect = data['预期结果'] # 新增按钮 leave_type.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 单位选取(天) XZ.input_select(unit[0], unit[1]) # # 将滚动条拉到最底层 # js1 = "window.scrollTo(0,1000)" # driver.execute_script(js1) self.scroll_page_to_buttom() # 优先使用休假类型(年假) XZ.input_select(use_vacation_types_first[0], use_vacation_types_first[1]) sleep(1) # 保存 add.save_btn(handle) sleep(1) texts = XZ.data_list() print(texts) try: # 使用断言 self.assertIn(expect, texts) leave_type.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: leave_type.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------休假类型test_xinzeng_correct运行完毕-------------------" )
def test03_copy(self, data): """公告管理复制""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver FZ = OperationMethod(driver) announce_ments = AnnouncementsList(driver) cp = Copy(driver) name = data['用例描述'] code = data['标题'].split('-') operant = data['生效日'].split('=') trigger_btn = data['触发按钮'] handle = data['操作'] # 筛选出所有编码元素 elements1 = FZ.data_list() print(elements1) # 标题路径 for element in FZ.data_list(): if element == code[1]: # 选中要操作的行 announce_ments.select_data(code[1]) sleep(0.2) break # 点击修改按钮 announce_ments.operation_btn(trigger_btn) # 标题 FZ.input_(code[0], code[1] + '1') # 生效日期 FZ.input_(operant[0], operant[1]) # 选择提示框里的确定按钮 cp.save_btn(handle) sleep(0.3) # 编码列表 elements2 = FZ.data_list() print(elements2) try: # 断言 self.assertNotEqual(elements2, elements1) announce_ments.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: announce_ments.error_screen(name + '失败') print(name + '失败') raise e
def test01_create(self, data): """系统账号新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) new_clocking_in = SystemAccountList(driver) add = Add(driver) name = data['用例描述'] code = data['用户名'].split('-') cn_name = data['中文名'].split('-') password = data['密码'].split('-') email = data['email'].split('-') user_group = data['用户组'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 new_clocking_in.operation_btn(trigger_btn) # 用户名输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(cn_name[0], cn_name[1]) # 密码 XZ.input_(password[0], password[1]) # 邮箱 XZ.input_(email[0], email[1]) # 用户组 XZ.input_select(user_group[0], user_group[1]) # 将滚动条拉到最底层 js1 = "window.scrollTo(0,100)" driver.execute_script(js1) # # # 考勤年度开始日期 # XZ.input_(start_date[0], start_date[1]) # # 考勤体系生效日期 # XZ.input_(take_effect_date[0], take_effect_date[1]) # 保存 add.save_btn(handle) sleep(0.5) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) new_clocking_in.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: new_clocking_in.error_screen(name + '失败') print(name + '失败') raise e print("-------------------系统账号test_create运行完毕-------------------")
def test02_alter_correct(self, data): """系统账号修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) new_clocking_in = SystemAccountList(driver) alter = Alter(driver) name = data['用例描述'] code = data['用户名'].split('-') cn_name = data['中文名'].split('-') password = data['密码'].split('-') email = data['email'].split('-') user_group = data['用户组'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: new_clocking_in.select_data(element) sleep(0.2) break # 点击修改按钮 new_clocking_in.operation_btn(trigger_btn) sleep(1) # 中文名 XG.input_(cn_name[0], cn_name[1]) # 保存 alter.save_btn(handle) sleep(0.5) text = new_clocking_in.unit_data(code[1]) print(text) try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertEqual(text, expect) new_clocking_in.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: new_clocking_in.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------系统账号test02_alter_correct运行完毕-------------------" )
def test02_alter_correct(self, data): """轮班类型的修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) shift_type = ShiftTypeList(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] Chinese = data['中文描述'].split('-') zh_hk = data['繁体描述'].split('-') handle = data['操作'] expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: shift_type.select_data(element) sleep(1) break # 点击修改按钮 # driver.find_element_by_xpath('//footer/div/button[2]').click() shift_type.operation_btn(trigger_btn) # 中文描述 XG.input_(Chinese[0], Chinese[1]) # 繁体描述 XG.input_(zh_hk[0], zh_hk[1]) # 保存 alter.save_btn(handle) # 获取描述信息 text = shift_type.unit_data(code[1]) try: # 使用断言 self.assertEqual(text, expect) shift_type.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: shift_type.error_screen(name + '失败') print(name + '失败') raise e print( '---------------------轮班类型test_xiugai_correct运行完毕---------------------' )
def test02_alter_correct(self, data): """考勤体系修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) new_clocking_in = UserGroupManagementList(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] Chinese = data['中文描述'].split('-') Chinese_traditional = data['繁体描述'].split('-') expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: new_clocking_in.select_data(element) sleep(0.2) break # 点击修改按钮 new_clocking_in.operation_btn(trigger_btn) sleep(1) # 中文描述 XG.input_(Chinese[0], Chinese[1]) # 繁体描述 XG.input_(Chinese_traditional[0], Chinese_traditional[1]) # 保存 alter.save_btn(handle) sleep(1) text = new_clocking_in.unit_data(code[1]) try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertEqual(text, expect) new_clocking_in.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: new_clocking_in.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------用户组管理test02_alter_correct运行完毕-------------------" )
def test02_xiugai_correct(self, data): """加班政策修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) leave_policy = LeavePolicyList(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] Chinese = data['中文描述'].split('-') Chinese_traditional = data['繁体描述'].split('-') expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: leave_policy.select_data(element) sleep(0.2) break # 点击修改按钮 leave_policy.operation_btn(trigger_btn) # 中文描述 XG.input_(Chinese[0], Chinese[1]) # 繁体描述 XG.input_(Chinese_traditional[0], Chinese_traditional[1]) # 确认 alter.save_btn(handle) text = leave_policy.unit_data(code[1]) try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertEqual(text, expect) leave_policy.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: leave_policy.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------加班政策test_xiugai_correct运行完毕-------------------" )
def test01_create_correct(self, data): """审查自定义新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver examine_custom = ExamineCustomList(driver) XZ = OperationMethod(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') field = data['字段类型'].split('-') monad = data['单位'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 examine_custom.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 字段类型 XZ.input_select(field[0], field[1]) # 单位(次) XZ.input_select(monad[0], monad[1]) # 保存 add.save_btn(handle) sleep(0.5) texts = XZ.data_list() print(texts) # 断言 try: # 使用断言 self.assertIn(expect, texts) examine_custom.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: examine_custom.error_screen(name + '失败') print(name + '失败') raise e print("-------------------审查自定义项test_xinzeng_correct运行完毕-------------------")
def test01_create(self, data): """考勤体系新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) new_clocking_in = NewClockingInSystemList(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') district = data['地区选择'].split('-') start_date = data['考勤年度开始日期'].split('-') take_effect_date = data['考勤体系生效日期'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 new_clocking_in.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 地区选择(大陆)) XZ.input_select(district[0], district[1]) # 将滚动条拉到最底层 js1 = "window.scrollTo(0,100)" driver.execute_script(js1) # 考勤年度开始日期 XZ.input_(start_date[0], start_date[1]) # 考勤体系生效日期 XZ.input_(take_effect_date[0], take_effect_date[1]) # 保存 add.save_btn(handle) sleep(0.5) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) new_clocking_in.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: new_clocking_in.error_screen(name + '失败') print(name + '失败') raise e print("-------------------新建考勤体系test_create运行完毕-------------------")
def test01_create(self, data): """工时设置新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver timeset = TimeSetList(driver) XZ = OperationMethod(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') shift_type = data['轮班类型'].split('-') trigger_btn = data['触发按钮'] st = data['工作开始时间'].split('-') en = data['工作结束时间'].split('-') handle = data['操作'] expect = data['预期结果'] # 新增按钮 timeset.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 轮班类型-中班 XZ.input_select(shift_type[0], shift_type[1]) # 切换到详细信息 driver.find_element_by_xpath(".//*[@id='tab-second']").click() # 工作开始时间 XZ.input_(st[0], st[1]) # 工作结束时间 # 手动录入 XZ.input_(en[0], en[1]) # 确定 add.save_btn(handle) sleep(0.2) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) timeset.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: timeset.error_screen(name + '失败') print(name + '失败') raise e print("-------------------工时设置test_create运行完毕-------------------")
def test02_alter(self, data): """工时设置修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver timeset = TimeSetList(driver) XG = OperationMethod(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] Chinese = data['中文描述'].split('-') handle = data['操作'] expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: timeset.select_data(element) sleep(0.3) break # 点击修改按钮 # driver.find_element_by_xpath('//section/footer/div/div/div/button[2]').click() timeset.operation_btn(trigger_btn) # 中文描述 XG.input_(Chinese[0], Chinese[1]) # 确定 alter.save_btn(handle) # 断言依据获取 text = timeset.unit_data(code[1]) try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertEqual(text, expect) timeset.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: timeset.error_screen(name + '失败') print(name + '失败') raise e print("-------------------工时设置test_alter运行完毕-------------------")
def test01_create_correct(self, data): """加班类型新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver overtime_type = OvertimeTypeList(driver) XZ = OperationMethod(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 overtime_type.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 将滚动条拉到最底层 js1 = "window.scrollTo(0,100)" driver.execute_script(js1) # 备注允许为空 add.checked('附件允许为空') # 保存 add.save_btn(handle) sleep(3) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) overtime_type.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: overtime_type.error_screen(name + '失败') print(name + '失败') raise e print('-------------------加班类型test_xinzeng_correct运行完毕-------------------')
def test01_xinzeng_correct(self, data): """加班政策新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) leave_policy = LeavePolicyList(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 leave_policy.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 确认 add.save_btn(handle) sleep(0.2) # 断言 texts = XZ.data_list() try: # 使用断言 self.assertIn(expect, texts) leave_policy.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: leave_policy.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------休假政策test_xinzeng_correct运行完毕-------------------" )
def test02_alter_correct(self, data): """加班类型修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) overtime_type = OvertimeTypeList(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] Chinese = data['中文描述'].split('-') expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == 'QA_test': overtime_type.select_data(element) sleep(1) break # 点击修改按钮 overtime_type.operation_btn(trigger_btn) # 修改中文描述 XG.input_(Chinese[0], Chinese[1]) # 保存 alter.save_btn(handle) text = overtime_type.unit_data(code[1]) try: # 使用断言 判断上面添加的编码是否在编码元素列表中 self.assertEqual(text, expect) overtime_type.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: overtime_type.error_screen(name + '失败') print(name + '失败') raise e print("-------------------加班类型test_xiugai_correct运行完毕-------------------")
def test01_alter(self, data): """考勤期段管理修改""" name = data['用例描述'] st_date = data['开始时间'] en_date = data['结束时间'] trigger_btn = data['触发按钮'] handle = data['操作'] remark = data['备注'].split('-') expect = data['预期结果'] if data["skip"] == 'True': self.skipTest("跳过示例{0}".format(name)) driver = self.driver attendance_period = AttendancePeriodManagementList(driver) alter = Alter(driver) XG = OperationMethod(driver) # 选中要操作的开始时间 attendance_period.select_data(st_date, en_date) # 点击修改按钮 attendance_period.operation_btn(trigger_btn) # 备注 XG.input_(remark[0], remark[1]) # 保存 alter.save_btn(handle) sleep(0.2) text = attendance_period.unit_data(st_date) print(text) try: # 使用断言 self.assertEqual(text, expect) attendance_period.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: attendance_period.error_screen(name + '失败') print(name + '失败') raise e print( "-------------------考勤期段管理test_xiugai_correct运行完毕-------------------" )
def test02_alter_correct(self, data): """审查自定义项修改""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XG = OperationMethod(driver) examine_custom = ExamineCustomList(driver) alter = Alter(driver) name = data['用例描述'] code = data['编码'].split('-') trigger_btn = data['触发按钮'] Chinese = data['中文描述'].split('-') handle = data['操作'] expect = data['预期结果'] # 筛选出所有编码元素 elements = XG.data_list() for element in elements: if element == code[1]: examine_custom.select_data(element) break # 点击修改按钮 examine_custom.operation_btn(trigger_btn) # 中文描述 XG.input_(Chinese[0], Chinese[1]) # 保存 alter.save_btn(handle) # 获取描述信息 text = examine_custom.unit_data(code[1]) try: # 使用断言 self.assertEqual(text, expect) examine_custom.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: examine_custom.error_screen(name + '失败') print(name + '失败') raise e print("-------------------审查自定义项test_xiugai_correct运行完毕-------------------")
def test01_create_correct(self, data): """轮班类型的新增""" if data["skip"] == 'True': self.skipTest("跳过示例") driver = self.driver XZ = OperationMethod(driver) shift_type = ShiftTypeList(driver) add = Add(driver) name = data['用例描述'] code = data['编码'].split('-') Chinese = data['中文描述'].split('-') trigger_btn = data['触发按钮'] handle = data['操作'] expect = data['预期结果'] # 新增按钮 shift_type.operation_btn(trigger_btn) # 编码输入 XZ.input_(code[0], code[1]) # 中文描述 XZ.input_(Chinese[0], Chinese[1]) # 保存 add.save_btn(handle) texts = XZ.data_list() print(texts) # 断言 try: # 使用断言 self.assertIn(expect, texts) shift_type.capture_screen(name + '成功') print(name + '成功') except AssertionError as e: shift_type.error_screen(name + '失败') print(name + '失败') raise e print( '---------------------轮班类型test_xinzeng_correct运行完毕---------------------' )
def test01_new(self): """新建宏(考勤审查前)macro""" driver = self.driver macros = MacroList(driver) method = OperationMethod(driver) add = AddMacro(driver) # 获取所有宏名 names1 = macros.macro_list() print(macros.macro_list()) # print(names1) # 点击考勤审查前 + macros.add_btn('考勤审查后') # 填写新建宏弹窗 # 名称 method.input_('名称', 'peter宏') # 执行存储过程 method.input_('执行存储过程', '213432') # 保存 add.save_btn('保存') sleep(0.5) # 再次获取所有宏名 names2 = macros.macro_list() print(names2) # 断言 try: self.assertNotEqual(names2, names1) except AssertionError: print('新建宏失败') else: print("新建宏成功") finally: print( "-------------------宏设置test01_xinjian运行完毕-------------------")
def test01_new(self): """新建预处理规则""" driver = self.driver rule = RuleList(driver) method = OperationMethod(driver) add = AddMacro(driver) # 获取所有宏名 names1 = rule.macro_list() print(rule.macro_list()) # print(names1) # 点击排班规则 + rule.add_btn('排班规则') # 填写新建规则弹窗 # 名称 method.input_('名称', 'peter排班规则') # 执行存储过程 method.input_('执行存储过程', '213432') # 保存 add.save_btn('保存') sleep(0.5) # 再次获取所有宏名 names2 = rule.macro_list() print(names2) # 断言 try: self.assertNotEqual(names2, names1) except AssertionError: print('新建规则失败') else: print("新建规则成功") finally: print("-------------------预处理规则test01_new运行完毕-------------------")