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_termination_case(self): '''允许审批人终止流程''' menu1 = '流程' menu2 = '基本信息' # 主页打开菜单时使用 menu3 = '允许审批人终止流程' name = "允许审批人终止流程" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) #李玲建单提交 comp.launch_a_flowform(name) #退出当前登录,切换账号并打开菜单记录for视图 comp.logoff_and_openrecord("zhangqiang", "123456",menu1, menu2, menu3,name) #time.sleep(0.5) comp.click_terminationbtn() #点击终止按钮 #time.sleep(0.5) # 判段是否已归档 bool = comp.is_filed() self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.test_termination_case()