def test_arbitrarily_adopt_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.goback() comp.switch_account('zhangqiang', '123456') comp.close_message() comp.open_m(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_arbitrarily_adopt_case()
def test_cc_for_iscript_case(self): '''流程抄送通过iscript''' menu1 = '流程' menu2 = '抄送设置' # 主页打开菜单时使用 menu3 = '流程抄送通过iscript' name = "流程抄送通过iscript" name2 = "消息中心" comp = ProcessApproverPage(self.driver) comp.goback() comp.switch_account('zhangqiang', '123456') comp.go_messagecenter_toclear() #进入消息中心清空工作事项通知 self.assertEqual(0, comp.get_messagecenter_totalRowPanel(), msg='进入消息中心清空工作事项通知失败') #张强去消息中心清空数据 #退出登录#33 comp.goback() # 切换账号登陆 comp.switch_account('liling', '123456') #李玲发起请假申请单 comp.open_m(menu1, menu2, menu3) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) comp.click_newbtn() #comp.switch_to_formiframe() #李玲建单提交 # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() #选择抄送人 comp.select_user_by_rolename("自动化测试组长") # 返回到表单所在的iframe comp.switch_to_formiframe() #time.sleep(0.5) # 点击确认提交 comp.submit() #time.sleep(0.5) #退出登录 comp.goback() #张强进入消息中心获取抄送消息 comp.switch_account('zhangqiang', '123456') #获取消息中心的工作事项内容 text = comp.get_messagecentercontent() self.assertIn("流程抄送", text, msg=name + "检验不通过") def init(self): self.test_cc_for_iscript_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_Hang_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.goback() #切换张强账号登陆, comp.switch_account("zhangqiang", "123456") comp.close_message() # 打开菜单 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) comp.click_hangbtn() #time.sleep(0.5) bb2 = comp.is_elementPresent() self.assertEqual("false", bb2, msg=name + "检验不通过") #time.sleep(0.5) comp.click_retracementbtn() #time.sleep(0.5) bb3 = comp.is_elementPresent() self.assertEqual("true", bb3, msg=name + "检验不通过") #time.sleep(0.5) comp.direct_sumit() #time.sleep(0.5) #'''表单是否已归档''' bool = comp.is_filed_for_openagin(name) self.assertIsNone(bool, msg=name + "检验不通过") def init(self): self.test_Hang_case()
def test_ccForRole_case(self): '''流程抄送通过角色''' menu1 = '流程' menu2 = '抄送设置' # 主页打开菜单时使用 menu3 = '流程抄送' name = "流程抄送" name2 = "消息中心" #time.sleep(0.5) comp = ProcessApproverPage(self.driver) comp.goback() # 伟强去消息中心清空数据 comp.switch_account('weiqiang', '123456') comp.go_messagecenter_toclear() #退出登录#33 comp.goback() # 切换账号登陆 comp.switch_account('liling', '123456') #李玲发起请假申请单 comp.open_m(menu1, menu2, menu3) # 判断是否要删除记录 lp = ListViewPage(self.driver) lp.judge_delete(name) comp.click_newbtn() #李玲建单提交 # 录入请假原因 comp.input_reason(name) # 点击提交按钮 comp.click_flow_processbtn() #选择抄送人 comp.select_user_by_rolename("测试主管") # 返回到表单所在的iframe comp.switch_to_formiframe() # 点击确认提交 comp.submit() #退出登录 comp.goback() #张强进入消息中心获取抄送消息 comp.switch_account('weiqiang', '123456') # 获取消息中心的工作事项内容 text = comp.get_messagecentercontent() self.assertIn("流程抄送", text, msg=name + "检验不通过")