def test_allApprover_adopt_chaos_case(self): """所有审批人任意顺序""" menu1 = '流程' menu2 = '流程节点通过条件' # 主页打开菜单时使用 menu3 = '所有审批人任意顺序' 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) #time.sleep(0.5) #李玲建单提交 comp.launch_a_flowform(name) #再次打开记录获取流程状态处理人 text = comp.openagain_to_getapprover(name) #断言 self.assertIn('王聪', text, msg=name + "检验不通过") #time.sleep(0.5) #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn("zhangqiang", "123456", menu1, menu2, menu3, name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #提交后再次打开表单获取流程处理人 text2 = comp.aftersumbit_getapprover(name) # 断言 self.assertIn('王聪', text2, msg=name + "检验不通过") #time.sleep(0.5) # 退出切换账号,查看是否有提交按钮 bb2 = comp.logoff_and_check_submitbtn("weiqiang", "123456", menu1, menu2, menu3, name) self.assertEqual("true", bb2, msg=name + "检验不通过") #time.sleep(0.5) #提交后再次打开表单获取流程处理人 text3 = comp.aftersumbit_getapprover(name) self.assertIn('王聪', text3, msg=name + "检验不通过") #time.sleep(0.5) # 退出切换账号,查看是否有提交按钮 bb3 = comp.logoff_and_check_submitbtn("wangcong", "123456", menu1, menu2, menu3, name) self.assertEqual("true", bb3, msg=name + "检验不通过") #time.sleep(0.5) #提交后判断流程是否已归档 bool = comp.is_filed_for_aftersumbit(name) self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.allApprover_adopt_chaos_Test()
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_retreat_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) #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn("zhangqiang", "123456", menu1, menu2, menu3, name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #退出切换账号,查看是否有提交按钮 bb2 = comp.logoff_and_check_submitbtn("liling", "123456", menu1, menu2, menu3, name) self.assertEqual("false", bb2, msg=name + "检验不通过") #time.sleep(0.5) bool = comp.is_btn_existed("act_flow_retracement") self.assertTrue(bool, msg=name + "检验不通过") #time.sleep(0.5) #点击回撤按钮 comp.click_retreatbtn() #time.sleep(0.5) text = comp.get_approver() self.assertIn("李玲", text, msg=name + "检验不通过") #time.sleep(0.5) comp.direct_sumit() text2 = comp.openagain_to_getapprover(name) self.assertIn("张强", text2, msg=name + "检验不通过") def init(self): self.test_retreat_case()
def test_Fallback_case(self): '''流程回退''' menu1 = '流程' menu2 = '流程通知' # 主页打开菜单时使用 menu3 = '流程回退' 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.launch_a_flowform(name) #进入消息中心清空工作事项通知 comp.go_messagecenter_toclear() #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn("zhangqiang", "123456", menu1, menu2, menu3, name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) comp.click_fallbackbtn() #退出登录 comp.goback() #切换张强账号登陆, comp.switch_account("liling", "123456") #获取消息中心的工作事项内容 text = comp.get_messagecentercontent() self.assertIn("流程回退", text, msg=name + "检验不通过") bname = '消息中心' comp.close_tab(bname) # 回到主文档,没有iframe self.driver.switch_to.default_content() # 打开菜单c comp.open_m(menu1, menu2, menu3) #time.sleep(0.5) #检查有没有提交按钮 bb = comp.is_submit_existed(name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #提交后再次打开表单获取流程处理人 text = comp.aftersumbit_getapprover(name) #time.sleep(0.5) self.assertIn('张强', text, msg=name + "检验不通过")
def test_approver_role_case(self): '''流程审批人for角色形式''' menu1 = '流程' menu2 = '审批人设置' # 主页打开菜单时使用 menu3 = '' name = "流程审批人设置_通过角色" comp = ProcessApproverPage(self.driver) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) #李玲新建单据 self.lilingnew(name) #退出切换账号,查看是否有提交按钮 bb = comp.logoff_and_check_submitbtn('weiqiang', '123456', menu1, menu2, menu3, name) self.assertEqual("true", bb, msg=name + "检验不通过") #time.sleep(0.5) #提交后再次打开表单获取流程处理人 text = comp.aftersumbit_getapprover(name) self.assertIn('张强', text, msg=name + "检验不通过")
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 + "检验不通过")