def default_notcheck_case(self): """并行默认不选中""" name = "并行默认不选中" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) # 点击新建进入表单 comp.click_newbtn() # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() #time.sleep(0.5) bool1 = self.find_elem( 'fieldset#fieldset_commit_to > div:nth-child(2)>label>input' ).is_selected() self.assertFalse(bool1, msg=name + '检验不通过') bool2 = self.find_elem( 'fieldset#fieldset_commit_to > div:nth-child(3)>label>input' ).is_selected() self.assertFalse(bool2, msg=name + '检验不通过') self.find_elem( 'fieldset#fieldset_commit_to > div:nth-child(2)>label>input' ).click() # 点击确认提交 comp.submit() #time.sleep(0.5) # 再次相应记录 comp.openagain_record(name) # 获取流程状态的处理人 text = comp.get_approver() # 断言 self.assertIn('王聪', text, msg=name + "检验不通过")
def test_skipprocess_case(self): """流程节点跳过""" name = "流程节点跳过" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) #把消息关掉 self.driver.switch_to_default_content() comp.close_message() comp.switch_to_formiframe() # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) # 点击新建进入表单 comp.click_newbtn() # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() # 点击确认提交 comp.submit() time.sleep(10) # 再次相应记录 comp.openagain_record(name) #表单是否已归档 bool = comp.is_filed() self.assertIsNone(bool, msg=name + "检验不通过")
def test_timeout_submit_case(self): """超时自动提交""" name = "审批超时自动提交" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) #把消息关掉 self.driver.switch_to_default_content() comp.close_message() #关闭消息中心提示 comp.switch_to_formiframe() # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) # 点击新建进入表单 comp.click_newbtn() # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() comp.wait_elem_visible('div[data-type="nodeItem"]') #等待提交节点显示 # 点击确认提交 comp.submit() # 再次相应记录 comp.openagain_record(name) # 获取流程状态的处理人 text = comp.get_approver() # 断言 self.assertIn('王聪', text, msg=name + "检验不通过") #点击返回按钮 comp.click_rebackbtn() time.sleep(60) #等待系统超时自动提交,再验证是否已提交 # 再次相应记录 comp.openagain_record(name) #time.sleep(0.5) bool = comp.is_filed() self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.test_timeout_submit_case()
def test_default_lockandcheck_case(self): """并行默认选中并锁定""" name = "并行默认选中并锁定" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) #把消息关掉 self.driver.switch_to_default_content() comp.close_message() comp.switch_to_formiframe() # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) # 点击新建进入表单 comp.click_newbtn() # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() #time.sleep(0.5) bool1 = comp.find_elem('fieldset#fieldset_commit_to > div:nth-child(2)>label>input').get_attribute('locked') self.assertTrue(bool1, msg=name + '检验不通过') bool2 = comp.find_elem('fieldset#fieldset_commit_to > div:nth-child(3)>label>input').get_attribute('locked') self.assertTrue(bool2, msg=name + '检验不通过') comp.find_elem('fieldset#fieldset_commit_to > div:nth-child(2)>label>input').click() # 点击确认提交 comp.submit() #time.sleep(0.5) # 再次相应记录 comp.openagain_record(name) # 获取流程状态的处理人 text = comp.get_approver() # 断言 self.assertIn('王聪', text, msg=name + "检验不通过") def init(self): self.test_default_lockandcheck_case()