def test_approver_iscript_case(self): '''流程审批人for_iscript形式''' menu1 = '流程' menu2 = '审批人设置' # 主页打开菜单时使用 menu3 = '' name = "流程审批人设置_通过iscript形式" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) #李玲新建单据 self.lilingnew(name) #退出当前登录,切换账号并打开菜单记录for视图 comp.logoff_and_openrecord('weiqiang', '123456', menu1, menu2, menu3, name) comp.direct_sumit() # 直接提交 #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn('zhangqiang', '123456', menu1, menu2, menu3, name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #表单是否已归档 bool = comp.is_filed_for_aftersumbit(name) self.assertIsNone(bool, msg=name + "检验不通过")
def test_non_polymerization_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) #time.sleep(0.5) #退出当前登录,切换账号并打开菜单记录 comp.logoff_and_openrecord('weiqiang', '123456', menu1, menu2, menu3, name) #time.sleep(0.5) comp.direct_sumit() #退出当前登录,切换账号并打开菜单记录for表单 comp.logoff_and_openmenu('zjl01', '123456', menu1, menu2, menu3) text = comp.openagain_to_getapprover(name) # 断言 self.assertIn('张强', text, msg=name + "检验不通过") # 判断总经理此时有无提交按钮 bb = comp.is_elementPresent() self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #提交后判断流程是否已归档 bool = comp.is_filed_for_aftersumbit(name) self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.test_non_polymerization_case()
def test_editApprover_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) #退出当前登录,切换账号并打开菜单记录 comp.logoff_and_openrecord("zhangqiang", "123456", menu1, menu2, menu3, name) #time.sleep(0.5) comp.select_approver("测试主管") #time.sleep(0.5) bool = comp.is_elementPresent() self.assertEqual("true", bool, msg=name + "检验不通过") #time.sleep(0.5) #退出当前登录,切换账号并打开菜单记录 comp.logoff_and_openrecord("weiqiang", "123456", menu1, menu2, menu3, name) #提交后判断流程是否已归档 bool = comp.is_filed_for_aftersumbit(name) self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.test_editApprover_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()
def test_polymerization_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) #time.sleep(0.5) #退出当前登录,切换账号并打开菜单记录for视图 comp.logoff_and_openrecord('weiqiang', '123456', menu1, menu2, menu3, name) #time.sleep(0.5) comp.direct_sumit() #再次打开记录获取流程状态处理人 text = comp.openagain_to_getapprover(name) self.assertIn('张强', text, msg=name + "检验不通过") #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn('zjl01', '123456', menu1, menu2, menu3, name) self.assertEqual("false", bb, msg=name + "检验不通过") # 退出当前登录,切换账号并打开菜单记录for视图 comp.logoff_and_openrecord('zhangqiang', '123456', menu1, menu2, menu3, name) #time.sleep(0.5) comp.direct_sumit() #time.sleep(0.5) # 退出当前登录,切换账号并打开菜单记录for视图 comp.logoff_and_openrecord('zjl01', '123456', menu1, menu2, menu3, name) #time.sleep(0.5) #表单是否已归档 bool2 = comp.is_filed_for_aftersumbit(name) self.assertIsNone(bool2, msg=name + "检验不通过")