Ejemplo n.º 1
0
 def setUp(self):
     self.env_file = None
     self.data_file = None
     Base.__init__(self, self.env_file, self.data_file)
     SET.__init__(self)
     self.se = SET()
     self.se.start_run()
Ejemplo n.º 2
0
	def setUp(self):
		self.env_file = "env.json"
		self.data_file = "data_xhd.json"
		base.Base.__init__(self, self.env_file, self.data_file)
		SET.__init__(self)
		self.se = SET()
		self.se.start_run()
Ejemplo n.º 3
0
	def setUp(self):
		
		self.env_file = "env.json"
		self.data_file = "data_eyt.json"
		base.Base.__init__(self, self.env_file, self.data_file)
		SET.__init__(self)
		self.se = SET()
		self.se.start_run()
		
		pd = random.choice(product['YES'])
		print(pd)
		self.product_info.update(dict(name=pd['name']), period=str(pd['period']))
		# 设置产品
		self.data['applyVo']['productName'] = pd['name']
		self.data['applyVo']['applyPeriod'] = str(pd['period'])
Ejemplo n.º 4
0
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

        rdir = config.__path__[0]
        pth = os.path.join(rdir, 'hostinfo')
        with open(pth, 'r', encoding='utf-8') as f:
            temp = yaml.load(f)
            self.host_ip = temp['SIT']['IP']
            self.port = temp['SIT']['port']
            self.host_name = temp['SIT']['username']
            self.host_password = temp['SIT']['password']
Ejemplo n.º 5
0
class CWD(unittest.TestCase, base.Base, SET):
    """车位贷募资流程"""

    # Todo: 这个方法构造函数的第二个参数取值有问题
    # def __init__(self, a=None, env_file="env.json", data_file="data_cwd.json"):
    # 	base.Base.__init__(self,env_file, data_file)

    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_cwd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def skipTest(self, reason):
        pass

    def test_cwd_01_base_info(self):
        """客户基本信息录入"""
        try:
            self.case_name = custom.get_current_function_name()
            custom.print_product_info(self.product_info)
            if self.company['branchName'] not in product.product_city:
                # 非渠道城市进件
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'])
            else:
                # 渠道城市新产品
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'], True)
            self.log.info("客户基本信息录入结束")
        except Exception as e:
            self.run_result = False
            raise e

    def test_cwd_02_borrowr_info(self):
        """借款人/共贷人/担保人信息"""

        self.test_cwd_01_base_info()
        self.case_name = custom.get_current_function_name()
        try:
            res = self.HAE.input_customer_borrow_info(
                self.page, self.data['custInfoVo'][0])
            if res:
                self.log.info("录入借款人信息结束")
        except Exception as e:
            self.log.error("Error:", e)
            self.run_result = False
            raise e

    def test_cwd_03_Property_info(self):
        """物业信息录入"""

        self.test_cwd_02_borrowr_info()
        self.case_name = custom.get_current_function_name()
        try:
            res = self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name, True)
            if res:
                self.log.info("录入物业信息结束")
            else:
                self.log.error('进件失败:录入物业信息出错!')
        except Exception as e:
            self.run_result = False
            raise e

    def test_cwd_04_applydata(self):
        """申请件录入,提交"""
        try:
            self.test_cwd_03_Property_info()
            self.case_name = custom.get_current_function_name()
            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")
        except Exception as e:
            self.run_result = False
            raise e

    def test_cwd_05_get_applyCode(self):
        """申请件查询"""

        self.test_cwd_04_applydata()
        self.case_name = custom.get_current_function_name()
        applycode = self.AQ.get_applycode(self.page, self.cust_name)
        if applycode:
            self.log.info("申请件查询完成")
            self.apply_code = applycode
        else:
            self.run_result = False
            raise ValueError("申请件查询失败")

    def test_cwd_06_show_task(self):
        """查看待处理任务列表"""

        self.test_cwd_05_get_applyCode()
        self.case_name = custom.get_current_function_name()
        next_id = self.PM.process_monitor(self.page, self.apply_code)
        if next_id:
            self.log.info("下一个处理人:" + next_id)
            self.next_user_id = next_id
        else:
            self.run_result = False
            raise ValueError("没有找到下一个处理人!")
        self.page.driver.quit()

        page = Login(self.next_user_id)

        res = self.PT.query_task(page, self.apply_code)
        if res:
            self.log.info("查询待处理任务成功")
        else:
            self.log.error("查询待处理任务失败!")
            raise ValueError("查询待处理任务失败")

    def test_cwd_07_process_monitor(self):
        """流程监控"""

        self.test_cwd_05_get_applyCode()  # 申请件查询
        self.case_name = custom.get_current_function_name()
        res = self.PM.process_monitor(self.page, self.apply_code)  # l流程监控

        if not res:
            self.run_result = False
            raise ValueError("流程监控查询出错!")
        else:
            self.page.user_info['auth']["username"] = res  # 更新下一个登录人
            self.next_user_id = res
            self.log.info("下一个处理人:" + self.next_user_id)
            self.log.info("完成流程监控查询")
        self.page.driver.quit()

    def test_cwd_08_branch_supervisor_approval(self):
        """分公司主管审批"""

        # 获取分公司登录ID
        self.test_cwd_07_process_monitor()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 审批审核
        res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管同意审批')
        if not res:
            self.run_result = False
            self.log.error("can't find applycode")
            raise ValueError("can't find applycode")
        else:
            self.log.info("风控审批-分公司主管审批结束")

        # 查看下一步处理人
        next_id = self.PM.process_monitor(page, self.apply_code)
        if not res:
            self.run_result = False
            raise ValueError("查询下一步处理人出错!")
        else:
            self.next_user_id = next_id
            self.log.info("下一个处理人:" + self.next_user_id)
            # 当前用户退出系统
            page.driver.quit()

    def test_cwd_09_branch_manager_approval(self):
        """分公司经理审批"""

        # 获取分公司经理登录ID
        self.test_cwd_08_branch_supervisor_approval()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 审批审核
        res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理同意审批')
        if not res:
            self.run_result = False
            raise ValueError("can't find applycode")
        else:
            self.log.info("风控审批-分公司经理审批结束")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code)
        if not res:
            self.run_result = False
            raise ValueError("查询下一步处理人出错!")
        else:
            self.next_user_id = res
            self.log.info("下一个处理人:" + self.next_user_id)
            # 当前用户退出系统
            page.driver.quit()

    def test_cwd_10_regional_prereview(self):
        """区域预复核审批"""

        # 获取区域预复核员ID
        self.test_cwd_09_branch_manager_approval()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 审批审核
        res = self.PT.approval_to_review(page, self.apply_code, u'区域预复核通过')
        if not res:
            self.run_result = False
            self.log.error("can't find applycode")
            raise ValueError("can't find applycode")
        else:
            self.log.info("区域预复核审批结束")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code)
        if not res:
            self.run_result = False
            self.log.error("Can't found next user!")
            raise ValueError("没有找到下一个处理人")
        else:
            self.next_user_id = res
            self.log.info("下一步处理人:" + self.next_user_id)
            # 当前用户退出系统
            page.driver.quit()

    def test_cwd_11_manager_approval(self):
        """高级审批经理审批"""

        # 获取审批经理ID
        self.test_cwd_10_regional_prereview()
        self.case_name = custom.get_current_function_name()
        if self.next_user_id != self.senior_manager:
            return
        else:
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            res = self.PT.approval_to_review(page, self.apply_code, u'审批经理审批')
            if not res:
                self.run_result = False
                self.log.ERROR("can't find applycode")
                raise ValueError("can't find applycode")
            else:
                self.log.info("风控审批-审批经理审批结束")

            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code)
            if not res:
                self.run_result = False
                self.log.error("Can't found next user!")
            else:
                self.next_user_id = res
                self.log.info("下一个处理人:" + self.next_user_id)
                # 当前用户退出系统
                self.page.driver.quit()

    def test_cwd_12_contract_signing(self):
        """签约"""

        rec_bank_info = dict(
            recBankNum=self.data['houseCommonLoanInfoList'][0]['recBankNum'],
            recPhone=self.data['houseCommonLoanInfoList'][0]['recPhone'],
            recBankProvince=self.data['houseCommonLoanInfoList'][0]
            ['recBankProvince'],
            recBankDistrict=self.data['houseCommonLoanInfoList'][0]
            ['recBankDistrict'],
            recBank=self.data['houseCommonLoanInfoList'][0]['recBank'],
            recBankBranch=self.data['houseCommonLoanInfoList'][0]
            ['recBankBranch'],
        )

        # 获取合同打印专员ID
        self.test_cwd_11_manager_approval()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 签约
        rc = Cts.ContractSign(page, self.apply_code, rec_bank_info)
        res = rc.execute_enter_borroers_bank_info()
        if res:
            rc.contract_submit()

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code)
        if not res:
            self.run_result = False
            self.log.error("Can't found next User!")
        else:
            self.next_user_id = res
            self.log.info("合同打印完成")
            self.log.info("Next deal User:"******"""合规审查"""

        # 获取下一步合同登录ID
        self.test_cwd_12_contract_signing()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 合规审查
        res = self.PT.compliance_audit(page, self.apply_code)
        if res:
            self.log.info("合规审批结束")
            page.driver.quit()
        else:
            self.run_result = False
            raise ValueError("合规审查失败")

    def test_cwd_14_authority_card_member_transact(self):
        """权证办理"""

        # 合规审查
        self.test_cwd_13_compliance_audit()
        self.case_name = custom.get_current_function_name()
        # 权证员登录
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        self.WM.authority_card_transact(page, self.apply_code, self.env)
        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code)
        if not res:
            self.run_result = False
            self.log.error("上传权证资料失败")
            raise ValueError("上传权证资料失败")
        else:
            self.log.info("权证办理完成")
            self.next_user_id = res
            self.log.info("Next deal user:"******"""权证请款-原件请款"""

        # 获取合同打印专员ID
        self.test_cwd_14_authority_card_member_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        # 权证请款
        res = self.WM.warrant_apply(page, self.apply_code)
        if not res:
            self.run_result = False
            raise ValueError("权证请款失败!")
        else:
            self.log.info("完成权证请款")
            page.driver.quit()

    def test_cwd_16_finace_transact(self):
        """财务办理"""

        # 权证请款
        self.test_cwd_15_warrant_apply()
        self.case_name = custom.get_current_function_name()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        self.FA.finace_transact(page, self.apply_code)
        self.log.info("完成财务办理")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.run_result = False
            raise ValueError("Can't found Next User!")
        else:
            self.next_user_id = res
            self.log.info("Next deal User:"******"""财务分公司经理审批"""

        remark = u"财务分公司经理审批"

        # 下一个处理人
        self.test_cwd_16_finace_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)

        if not result:
            self.run_result = False
            raise result
        else:
            self.log.info("财务流程-分公司经理审批结束")
            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code, 1)
            if not res:
                self.run_result = False
                raise ValueError("Can't found Next User!")
            else:
                self.next_user_id = res
                self.log.info("Next deal User:"******"""财务风控经理审批"""

        remark = u'风控经理审批'

        self.test_cwd_17_finace_approval_branch_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rs = self.FA.finace_approval(page, self.apply_code, remark)
        if rs:
            self.log.info("财务流程-风控经理审批结束")
        else:
            self.run_result = False
            raise ValueError("风控经理审批出错!")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.run_result = False
            raise ValueError("can't found Next User!")
        else:
            self.next_user_id = res
            self.log.info("nextId:" + self.next_user_id)
            # 当前用户退出系统
            page.driver.quit()

    def test_cwd_19_finace_approval_financial_accounting(self):
        """财务会计审批"""

        remark = u'财务会计审批'

        self.test_cwd_18_finace_approval_risk_control_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        self.FA.finace_approval(page, self.apply_code, remark)

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.run_result = False
            raise ValueError("Can't found next User!")
        else:
            self.log.info("财务流程-财务会计审批结束")
            self.next_user_id = res
            self.log.info("nextId:" + self.next_user_id)
            # 当前用户退出系统
            page.driver.quit()

    def test_cwd_20_finace_approval_financial_manager(self):
        """财务经理审批"""

        remark = u'财务经理审批'

        self.test_cwd_19_finace_approval_financial_accounting()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        res = self.FA.finace_approval(page, self.apply_code, remark)
        if res:
            self.log.info("财务流程-财务经理审批结束")
            page.driver.quit()
        else:
            self.run_result = False
            raise ValueError("财务经理审批出错")

    def test_cwd_21_funds_raise(self):
        """资金主管募资审批"""

        remark = u'资金主管审批'

        self.test_cwd_20_finace_approval_financial_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, remark)
        if res:
            self.log.info("募资流程-资金主管审批结束")
            page.driver.quit()
        else:
            self.run_result = False
            raise ValueError("募资流程出错")
Ejemplo n.º 6
0
class ElectronicContract(unittest.TestCase, base.Base, SET):
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

        rdir = config.__path__[0]
        pth = os.path.join(rdir, 'hostinfo')
        with open(pth, 'r', encoding='utf-8') as f:
            temp = yaml.load(f)
            self.host_ip = temp['SIT']['IP']
            self.port = temp['SIT']['port']
            self.host_name = temp['SIT']['username']
            self.host_password = temp['SIT']['password']

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_contract_sgin(self):
        """电子签约"""

        self.case_name = custom.get_current_function_name()
        try:
            # 1. 签约前步骤
            self.before_contract_sign()

            # 2. 获取短信验证码
            execmd = \
             ' cd /web/apache-tomcat-7.0.69/logs; tail -10 catalina.out  > 1.txt ; ' \
             'cat 1.txt | grep "短信" | awk -F"验证码:" \'{print $2}\' ' \
             '| awk -F\',\' \'{print $1}\' | tail -1'

            # ssh.sshclient_execmd(self.host_ip, self.port, self.host_name, self.host_password, cmd)

            # 3. 短信签约
            rs = Cts.ContractSign(self.page, self.apply_code,
                                  self.rec_bank_info)
            rs.send_message(self.host_ip, self.port, self.host_name,
                            self.host_password, execmd)
        except Exception as e:
            self.run_result = False
            raise e

    def test_02_delete_contract_sign(self):
        """删除电子签约"""
        self.case_name = custom.get_current_function_name()
        try:
            # 1. 签约
            self.test_01_contract_sgin()

            # 2. 删除
            page = login.Login(self.next_user_id)
            # 删除电子签章
            rs = Cts.ContractSign(page, self.apply_code, self.rec_bank_info)
            rs.delete_contract_sign(page, self.apply_code)
            page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 7
0
class XHD(unittest.TestCase, base.Base, SET):
    """循环贷流程用例"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    """
		循环贷案件数据录入
	"""

    def test_xhd_01_base_info(self):
        """客户基本信息录入"""
        self.case_name = custom.get_current_function_name()
        custom.print_product_info(self.product_info)
        res = self.HAE.input_customer_base_info(self.page,
                                                self.data['applyVo'])
        if not res:
            self.run_result = True
            self.log.error("客户基本信息录入出错!")
            raise AssertionError('客户基本信息录入出错')
        else:
            self.log.info("客户基本信息录入完成!")

    def test_xhd_02_borrowr_info(self):
        """借款人/共贷人/担保人信息"""

        self.test_xhd_01_base_info()
        self.case_name = custom.get_current_function_name()
        try:
            res = self.HAE.input_customer_borrow_info(
                self.page, self.data['custInfoVo'][0])
            if res:
                self.log.info("录入借款人信息结束")
        except Exception as e:
            self.run_result = False
            self.log.error("进件失败!:", e)
            raise e

    def test_xhd_03_Property_info(self):
        """物业信息录入"""

        self.test_xhd_02_borrowr_info()
        self.case_name = custom.get_current_function_name()
        try:
            res = self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name, True)
            if res:
                self.log.info("录入物业信息结束")
            else:
                self.run_result = False
                self.log.error('进件失败:录入物业信息出错!')
        except Exception as e:
            self.run_result = False
            raise e

    def test_xhd_04_applydata(self):
        """申请件录入,提交"""
        try:
            self.test_xhd_03_Property_info()
            self.case_name = custom.get_current_function_name()
            # 提交
            self.HAE.submit(self.page)
        except Exception as e:
            self.run_result = False
            raise e

    def test_xhd_05_get_applyCode(self):
        """申请件查询"""

        self.test_xhd_04_applydata()
        self.case_name = custom.get_current_function_name()
        applycode = self.AQ.get_applycode(self.page, self.cust_name)
        if applycode:
            self.log.info("申请件查询完成")
            self.apply_code = applycode
        else:
            self.run_result = False
            self.log.error("Can't get applyCode!")
            raise AssertionError("Can't get applyCode!")

    def test_xhd_06_show_task(self):
        """查看待处理任务列表"""

        self.test_xhd_05_get_applyCode()
        self.case_name = custom.get_current_function_name()
        next_id = self.PM.process_monitor(self.page, self.apply_code)
        if next_id:
            self.log.info("下一个处理人:" + next_id)
            self.next_user_id = next_id
        else:
            self.run_result = False
            raise ValueError("没有找到下一个处理人!")
        self.page.driver.quit()

        page = Login(self.next_user_id)

        res = self.PT.query_task(page, self.apply_code)
        if res:
            self.log.info("待处理任务查询ok")
            page.driver.quit()
        else:
            self.run_result = False
            self.log.error("待处理任务查询fail")
            raise AssertionError('待处理任务查询fail')

    def test_xhd_07_process_monitor(self):
        """流程监控"""

        self.test_xhd_05_get_applyCode()  # 申请件查询
        self.case_name = custom.get_current_function_name()
        res = self.PM.process_monitor(self.page, self.apply_code)  # l流程监控

        if not res:
            self.run_result = False
            raise AssertionError('流程监控出错!')
        else:
            self.page.user_info['auth']["username"] = res  # 更新下一个登录人
            self.next_user_id = res
            self.log.info("Next Deal User: "******"""分公司主管审批"""

        try:
            # 获取分公司登录ID
            self.test_xhd_07_process_monitor()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            self.PT.approval_to_review(page, self.apply_code, u'分公司主管同意审批')

            # 查看下一步处理人
            next_id = self.PM.process_monitor(page, self.apply_code)
            if not next_id:
                self.run_result = False
                self.log.error("Can't Get Next User")
                raise AssertionError("get Next user error!")
            else:
                self.next_user_id = next_id
                self.log.info("Next Deal User: "******"""分公司经理审批"""

        try:
            # 获取分公司经理登录ID
            self.test_xhd_08_branch_supervisor_approval()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'分公司经理同意审批')
            if not res:
                self.log.error("风控-分公司审批失败")
                raise AssertionError('风控-分公司审批失败')
            else:
                self.log.info("风控-分公司经理完成!")

            # 查看下一步处理人
            self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_xhd_10_regional_prereview(self):
        """区域预复核审批"""

        try:
            # 获取区域预复核员ID
            self.test_xhd_09_branch_manager_approval()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            rs = self.PT.approval_to_review(page, self.apply_code, u'区域预复核通过')
            if not rs:
                self.run_result = False
                self.log.error("风控-区域预复核失败")
                raise AssertionError('风控-区域预复核失败')
            else:
                self.log.info("风控-区域预复核成功!")

            # 查看下一步处理人
            self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_xhd_11_manager_approval(self):
        """高级审批经理审批"""

        try:
            # 获取审批经理ID
            self.test_xhd_10_regional_prereview()
            self.case_name = custom.get_current_function_name()
            if self.next_user_id != self.senior_manager:
                return
            else:
                # 下一个处理人重新登录
                page = Login(self.next_user_id)

                # 审批审核
                result = self.PT.approval_to_review(page, self.apply_code,
                                                    u'高级审批经理审批')
                if not result:
                    self.run_result = False
                    self.log.error("风控-高级审批经理审批失败")
                    raise AssertionError('风控-高级审批经理审批失败')
                else:
                    self.log.info("风控-高级审批经理审批完成")

                # 查看下一步处理人
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_xhd_12_contract_signing(self):
        """签约"""

        rec_bank_info = dict(
            recBankNum=self.data['houseCommonLoanInfoList'][0]['recBankNum'],
            recPhone=self.data['houseCommonLoanInfoList'][0]['recPhone'],
            recBankProvince=self.data['houseCommonLoanInfoList'][0]
            ['recBankProvince'],
            recBankDistrict=self.data['houseCommonLoanInfoList'][0]
            ['recBankDistrict'],
            recBank=self.data['houseCommonLoanInfoList'][0]['recBank'],
            recBankBranch=self.data['houseCommonLoanInfoList'][0]
            ['recBankBranch'],
        )

        # 获取合同打印专员ID
        self.test_xhd_11_manager_approval()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 签约
        rc = Cts.ContractSign(page, self.apply_code, rec_bank_info)
        rs = rc.execute_enter_borroers_bank_info()
        if not rs:
            self.run_result = False
            self.log.error("签约失败")
            raise AssertionError('签约失败')
        else:
            rc.contract_submit()
            self.log.info("签约成功")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_xhd_13_compliance_audit(self):
        """合规审查"""

        # 获取下一步合同登录ID
        self.test_xhd_12_contract_signing()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 合规审查
        res = self.PT.compliance_audit(page, self.apply_code)
        if not res:
            self.run_result = False
            self.log.error("合规审查失败")
            raise AssertionError("合规审查失败")
        else:
            self.log.info("合规审查成功")
            page.driver.quit()

    def test_xhd_14_authority_card_member_transact(self):
        """权证办理"""

        # 合规审查
        self.test_xhd_13_compliance_audit()
        self.case_name = custom.get_current_function_name()
        # 权证员登录
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        res = self.WM.authority_card_transact(page, self.apply_code, self.env)
        if not res:
            self.run_result = False
            self.log.error("权证员上传资料失败")
            raise AssertionError('权证员上传资料失败')
        else:
            self.log.info("权证员上传资料成功!")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_xhd_15_warrant_apply(self):
        """权证请款-原件请款"""

        # 获取合同打印专员ID
        self.test_xhd_14_authority_card_member_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        # 权证请款
        res = self.WM.warrant_apply(page, self.apply_code)
        if not res:
            self.run_result = False
            self.log.error("权证请款失败")
            raise AssertionError('权证请款失败')
        else:
            self.log.info("权证请款成功")
            page.driver.quit()

    def test_xhd_16_finace_transact(self):
        """财务办理"""

        # 权证请款
        self.test_xhd_15_warrant_apply()
        self.case_name = custom.get_current_function_name()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        result = self.FA.finace_transact(page, self.apply_code)
        if not result:
            self.run_result = False
            self.log.error("财务办理失败")
            raise AssertionError('财务办理失败')
        else:
            self.log.info("财务办理成功")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_xhd_17_finace_approval_branch_manager(self):
        """财务分公司经理审批"""

        remark = u"财务分公司经理审批"

        # 下一个处理人
        self.test_xhd_16_finace_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.run_result = False
            raise AssertionError('审批失败!')
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_xhd_18_finace_approval_risk_control_manager(self):
        """财务风控经理审批"""

        remark = u'风控经理审批'

        self.test_xhd_17_finace_approval_branch_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.run_result = False
            self.log.error("财务-风控经理审批出错")
            raise AssertionError('财务-风控经理审批出错')
        else:
            self.log.info("财务-风控经理审批完成")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_xhd_19_finace_approval_financial_accounting(self):
        """财务会计审批"""

        remark = u'财务会计审批'

        self.test_xhd_18_finace_approval_risk_control_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.run_result = False
            self.log.error("财务-财务会计审批出错!")
            raise AssertionError('财务-财务会计审批出错')
        else:
            self.log.info("财务-财务会计审批完成!")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_xhd_20_finace_approval_financial_manager(self):
        """财务经理审批"""

        remark = u'财务经理审批'

        self.test_xhd_19_finace_approval_financial_accounting()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        res = self.FA.finace_approval(page, self.apply_code, remark)
        if not res:
            self.run_result = False
            self.log.error("财务-财务经理审批出错!")
            raise AssertionError('财务-财务经理审批出错')
        else:
            self.log.info("财务-财务经理审批完成!")
            page.driver.quit()

    def test_xhd_21_funds_raise(self):
        """资金主管募资审批"""

        remark = u'资金主管审批'

        self.test_xhd_20_finace_approval_financial_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, remark)
        if not res:
            self.run_result = False
            self.log.error("募资-资金主管审批出错!")
            raise AssertionError('募资-资金主管审批出错!')
        else:
            self.log.info("募资-资金主管审批完成!")
            page.driver.quit()
Ejemplo n.º 8
0
class IntoCase(unittest.TestCase, base.Base, SET):
	"""申请录入进件场景,多借款人"""
	
	def setUp(self):
		self.env_file = "env.json"
		self.data_file = "data_xhd.json"
		base.Base.__init__(self, self.env_file, self.data_file)
		SET.__init__(self)
		self.se = SET()
		self.se.start_run()
	
	def tearDown(self):
		self.end_time = time.clock()
		self.case_using_time(self.begin_time, self.end_time)
		print(self.using_time)
		v_l.append({
			"name":       self.case_name,
			"apply_code": self.apply_code,
			"result":     self.run_result,
			"u_time":     self.using_time,
			"s_time":     self.s_time,
			"e_time":     str(datetime.datetime.now()).split('.')[0]
			})
		self.se.end_run(v_l)
		self.page.driver.quit()
	
	def test_01_one_borrower(self):
		"""单借款人"""
		
		try:
			self.case_name = custom.get_current_function_name()
			print("当前用例编号:" + self.case_name)
			# 录入一个借款人
			custom.print_product_info(self.product_info)
			
			# 1 客户信息-业务基本信息
			self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
			
			# 2 客户基本信息 - 借款人/共贷人/担保人信息
			self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			
			# 3 物业信息
			self.HAE.input_all_bbi_property_info(
				self.page, self.data['applyPropertyInfoVo'][0],
				self.data['applyCustCreditInfoVo'][0],
				self.cust_name
				)
			
			# 提交
			self.HAE.submit(self.page)
			self.countTestCases()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_two_borrower(self, n=2):
		# 录入两个借款人
		self.skipTest("没有完成好, 写法不推荐")
		self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
		
		if n == 1:
			# self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			# 添加借款人
			self.page.driver.find_element_by_xpath('//*[@id="tb"]/a[1]/span[2]').click()
			# 姓名
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[4]/div/table/tbody/tr/td/input').send_keys(u" 小王")
			# 身份证
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[5]/div/table/tbody/tr/td/input').send_keys("360101199101011054")
			
			# 受教育程度
			self.page.driver.find_element_by_id("_easyui_textbox_input3").click()
			self.page.driver.find_element_by_id('_easyui_combobox_i2_0').click()
			
			# 婚姻
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[8]/div/table/tbody/tr/td/span/span/a').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i3_3').click()
			
			# 家庭住址信息
			self.page.driver.find_element_by_id('_easyui_textbox_input5').send_keys("hhhhh")
			# phone
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[10]/div/table/tbody/tr/td/input').send_keys("13683121234")
			# 单位名称
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[11]/div/table/tbody/tr/td/input').send_keys('xxxxx')
			# 公司规模
			self.page.driver.find_element_by_id('_easyui_textbox_input6').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i4_3').click()
			
			# 所属行业
			self.page.driver.find_element_by_id('_easyui_textbox_input7').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i5_2').click()
			
			# 职位
			self.page.driver.find_element_by_id('_easyui_textbox_input9').send_keys("aaaaaa")
			# 日期
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[16]/div/table/tbody/tr/td/input').send_keys('2017-09-01')
			# 工作年限
			self.page.driver.find_element_by_id('_easyui_textbox_input10').send_keys(10)
			# 月均收入
			self.page.driver.find_element_by_id('_easyui_textbox_input11').send_keys(10000)
			# 是否有社保
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-0"]/td[19]/div/table/tbody/tr/td/input').click()
			# 确认
			self.page.driver.find_element_by_xpath('//*[@id="tb"]/a[3]/span[2]').click()
		elif n == 2:
			self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			self.page.driver.find_element_by_xpath('//*[@id="tb"]/a[1]/span[2]').click()
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[4]/div/table/tbody/tr/td/input').send_keys(u"小黑")
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[5]/div/table/tbody/tr/td/input').send_keys("360101199101011054")
			time.sleep(2)
			self.page.driver.find_element_by_id('_easyui_textbox_input14').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i8_2').click()
			
			self.page.driver.find_element_by_id('_easyui_textbox_input15').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i9_0').click()
			
			self.page.driver.find_element_by_id('_easyui_textbox_input16').send_keys("xxxaaaa")
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[10]/div/table/tbody/tr/td/input').send_keys("13912341923")
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[11]/div/table/tbody/tr/td/input').send_keys("yyyyyy")
			self.page.driver.find_element_by_id('_easyui_textbox_input17').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i10_3').click()
			self.page.driver.find_element_by_id('_easyui_textbox_input18').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i11_2').click()
			
			self.page.driver.find_element_by_id('_easyui_textbox_input20').send_keys("bbbbb")
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[16]/div/table/tbody/tr/td/input').send_keys("2017-12-19")
			self.page.driver.find_element_by_id('_easyui_textbox_input21').send_keys(12)
			self.page.driver.find_element_by_id('_easyui_textbox_input22').send_keys(20000)
			
			self.page.driver.find_element_by_xpath(
				'//*[@id="datagrid-row-r1-2-1"]/td[19]/div/table/tbody/tr/td/input').click()
			
			# 确认
			self.page.driver.find_element_by_xpath('//*[@id="tb"]/a[3]/span[2]').click()
			
			# 关联关系信息
			self.page.driver.find_element_by_xpath('//*[@id="tbs"]/a[1]').click()
			self.page.driver.find_element_by_id('_easyui_textbox_input23').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i12_0').click()
			
			self.page.driver.find_element_by_id('_easyui_textbox_input24').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i13_1').click()
			
			self.page.driver.find_element_by_id('_easyui_textbox_input25').click()
			self.page.driver.find_element_by_id('_easyui_combobox_i14_0').click()
			self.page.driver.find_element_by_xpath('//*[@id="tb"]/a[3]/span[2]').click()
			
			# 保存
			self.page.driver.find_element_by_id('apply_module_apply_save').click()
			self.page.driver.find_element_by_xpath('/html/body/div[2]/div[3]/a').click()
	
	def test_03_two_borrower(self):
		"""录入两个借款人"""
		
		try:
			custom.print_product_info(self.product_info)
			self.case_name = custom.get_current_function_name()
			print("当前用例编号:" + self.case_name)
			
			# 录入基本信息
			try:
				# 打印贷款产品信息
				if self.company['branchName'] not in self.city:
					# 非渠道城市进件
					self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
				else:
					# 渠道城市非新产品
					if 'E押通-2.1' not in self.product_info['name']:
						self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
					else:
						# 渠道城市新产品
						self.HAE.input_customer_base_info(self.page, self.data['applyVo'], True)
			except Exception as e:
				self.run_result = False
				raise e
			
			# 录入借款人/共贷人信息
			self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			self.HAE.input_more_borrower(self.page)
			
			# 录入业务基本信息
			self.HAE.input_all_bbi_property_info(
				self.page,
				self.data['applyPropertyInfoVo'][0],
				self.data['applyCustCreditInfoVo'][0],
				self.cust_name
				)
			
			# 提交
			self.HAE.submit(self.page)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_gqt_04_applydata(self):
		"""过桥通申请件录入,提交"""
		
		try:
			self.case_name = custom.get_current_function_name()
			custom.print_product_info(self.product_info)
			data, _ = custom.enviroment_change("data_gqt.json", self.number, self.env)
			self.data.update(data)
			
			# 1 客户信息-业务基本信息
			self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
			
			# 2 客户基本信息 - 借款人/共贷人/担保人信息
			self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			self.HAE.input_more_borrower(self.page)
			
			# 3 物业信息
			self.HAE.input_all_bbi_property_info(
				self.page,
				self.data['applyPropertyInfoVo'][0],
				self.data['applyCustCreditInfoVo'][0],
				"花晶滢",
				True,
				'gqt'
				)
			
			# 提交
			self.HAE.submit(self.page)
			self.log.info("申请件录入完成提交")
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_random_person(self):
		"""随机录入多个借款人"""
		
		try:
			custom.print_product_info(self.product_info)
			self.case_name = custom.get_current_function_name()
			print("当前用例编号:" + self.case_name)
			
			# 录入基本信息
			try:
				# 打印贷款产品信息
				if self.company['branchName'] not in self.city:
					# 非渠道城市进件
					self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
				else:
					# 渠道城市非新产品
					if 'E押通-2.1' not in self.product_info['name']:
						self.HAE.input_customer_base_info(self.page, self.data['applyVo'])
					else:
						# 渠道城市新产品
						self.HAE.input_customer_base_info(self.page, self.data['applyVo'], True)
			except Exception as e:
				self.run_result = False
				raise e
			
			# 录入借款人/共贷人信息
			name_1 = custom.get_name()
			name_2 = custom.get_name()
			self.HAE.input_customer_borrow_info(self.page, self.data['custInfoVo'][0])
			self.HAE.input_random_borrower(self.page, name_1, name_2)
			self.name_2 = name_2
			
			# 录入业务基本信息
			self.HAE.input_all_bbi_property_info(
				self.page,
				self.data['applyPropertyInfoVo'][0],
				self.data['applyCustCreditInfoVo'][0],
				self.cust_name
				)
			
			# 提交
			self.HAE.submit(self.page)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_05_entry_more_person_find_one(self):
		"""根据公贷人或者第二借款人在申请件查询中搜索"""
		
		try:
			self.test_04_random_person()
			self.case_name = custom.get_current_function_name()
			applycode = self.AQ.get_applycode(self.page, self.name_2)
			if applycode:
				self.log.info("根据第二借款人查询申请件查询完成")
				self.apply_code = applycode
			else:
				self.log.error("根据共贷人查不到进件")
				raise ValueError("根据共贷人查不到进件")
		except Exception as e:
			self.run_result = False
			raise e
Ejemplo n.º 9
0
class FallBack(unittest.TestCase, base.Base, SET):
	"""风控回退/拒绝/取消场景"""
	
	def setUp(self):
		self.env_file = "env.json"
		self.data_file = "data_xhd.json"
		base.Base.__init__(self, self.env_file, self.data_file)
		SET.__init__(self)
		self.se = SET()
		self.se.start_run()
	
	def tearDown(self):
		self.end_time = time.clock()
		self.case_using_time(self.begin_time, self.end_time)
		print(self.using_time)
		v_l.append({
			"name": self.case_name,
			"apply_code": self.apply_code,
			"result": self.run_result,
			"u_time": self.using_time,
			"s_time": self.s_time,
			"e_time": str(datetime.datetime.now()).split('.')[0]
			})
		self.se.end_run(v_l)
		self.page.driver.quit()
	
	def get_next_user(self, page, applycode):
		next_id = self.PM.process_monitor(page, applycode)
		if next_id is None:
			self.log.error("没有找到下一步处理人!")
			raise AssertionError("没有找到下一步处理人!")
		else:
			self.next_user_id = next_id
			self.log.info("下一步处理人:" + next_id)
			# 当前用户退出系统
			page.driver.quit()
	
	def test_01_branch_director_fallback(self):
		"""主管回退到申请录入"""
		
		"""
			1. 申请基本信息录入
		"""
		self.case_name = custom.get_current_function_name()
		try:
			
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			
			"""
				2. 风控回退
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管回退
			res = self.PT.approval_to_review(page, self.apply_code, u'回退到申请录入', 1)
			if not res:
				self.run_result = False
				self.log.error("回退失败")
				raise ValueError("回退失败")
			else:
				self.log.info(u'分公司主管回退成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_branch_manager_fallback(self):
		"""分公司经理回退到申请录入"""
		self.case_name = custom.get_current_function_name()
		try:
			# 1. 进件
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			
			# 审批
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管审批
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管审批通过', 0)
			if not res:
				self.run_result = False
				self.log.error("审批失败")
				raise AssertionError('审批失败')
			else:
				self.log.info(u'分公司主管审批通过!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 分公司经理回退
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理回退到申请录入', 1)
			if not res:
				self.run_result = False
				self.log.error("回退失败")
				raise ValueError("回退失败")
			else:
				self.log.info(u'分公司经理回退到申请录入!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_regional_fallback(self):
		"""区域复核回退到申请录入"""
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# ----------- 审批--------------
			user_list = ['分公司主管', '分公司经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# ----------回退-----------
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域预复核回退
			res = self.PT.approval_to_review(page, self.apply_code, u'区域回退到申请录入', 1)
			if not res:
				self.run_result = False
				self.log.error("回退失败")
				raise ValueError("回退失败")
			else:
				self.log.info(u'区域回退到申请录入成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_manage_fallback(self):
		"""高级审批经理回退到申请录入"""
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			# 1. 申请录入
			self.before_application_entry()
			# 2. 审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			if self.next_user_id != self.senior_manager:
				return
			
			# 3. 回退
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 审批经理回退
			res = self.PT.approval_to_review(page, self.apply_code, u'审批经理回退到申请录入成功', 1)
			if not res:
				self.run_result = False
				self.log.error("审批经理回退失败!")
				raise AssertionError('审批经理回退失败!')
			else:
				self.log.info(u'审批经理回退到申请录入成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_05_risk_fallback(self):
		"""风控逐级回退"""
		self.case_name = custom.get_current_function_name()
		option = [u'区域预复核', u'分公司经理', u'分公司风控主管', u'风控专员录入']
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# 2. 风控审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			if self.next_user_id != self.senior_manager:
				return
			
			# 3. 逐级回退
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 审批经理回退到区域预复核
			res = self.PT.risk_approval_fallback(page, self.apply_code, option[0], u'回退到区域预复核')
			if not res:
				self.run_result = False
				self.log.error("审批经理回退到区域预复核失败 !")
				raise AssertionError('审批经理回退到区域预复核失败 !')
			else:
				self.log.info(u'审批经理回退到区域预复核成功!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 区域预复核回退到分公司经理
			res = self.PT.risk_approval_fallback(page, self.apply_code, option[1], u'回退到分公司经理')
			if not res:
				self.run_result = False
				self.log.error("区域预复核回退到分公司经理失败 !")
				raise AssertionError('区域预复核回退到分公司经理失败 !')
			else:
				self.log.info(u'区域预复核回退到分公司经理成功!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 分公司经理回退到分公司主管
			res = self.PT.risk_approval_fallback(page, self.apply_code, option[2], u'回退到分公司主管')
			if not res:
				self.run_result = False
				self.log.error("分公司经理回退到分公司主管失败 !")
				raise AssertionError('分公司经理回退到分公司主管失败 !')
			else:
				self.log.info(u'区分公司经理回退到分公司主管成功!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 分公司主管回退到申请录入
			res = self.PT.risk_approval_fallback(page, self.apply_code, option[3], u'回退到申请录入')
			if not res:
				self.run_result = False
				self.log.error("分公司主管回退到申请录入失败 !")
				raise AssertionError('分公司主管回退到申请录入失败 !')
			else:
				self.log.info(u'分公司主管回退到申请录入成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_01_branch_director_cancel(self):
		"""主管取消"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				1. 申请基本信息录入
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				2. 风控取消
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管取消
			res = self.PT.approval_to_review(page, self.apply_code, u'主管取消', 2)
			if not res:
				self.run_result = False
				self.log.error("分公司主管取消失败")
				raise AssertionError('分公司主管取消失败')
			else:
				self.log.info(u'主管取消!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_branch_manager_cancel(self):
		"""分公司经理取消"""
		self.case_name = custom.get_current_function_name()
		try:
			# 1. 进件
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# 2. 审批
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管审批
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管审批通过', 0)
			if not res:
				self.run_result = False
				self.log.error("审批失败")
				raise AssertionError('审批失败')
			else:
				self.log.info(u'分公司主管审批通过!')
				self.get_next_user(page, self.apply_code)
			
			# 3. 取消
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 分公司经理取消
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理取消', 2)
			if not res:
				self.run_result = False
				self.log.error("分公司经理取消失败!")
				raise ValueError("分公司经理取消失败!")
			else:
				self.log.info(u'分公司经理取消!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_regional_cancel(self):
		"""区域复核取消"""
		self.case_name = custom.get_current_function_name()
		try:
			# 1. 进件
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# 2. 审批
			user_list = ['分公司主管', '分公司经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 3. 取消
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域预复核取消
			res = self.PT.approval_to_review(page, self.apply_code, u'区域取消', 2)
			if not res:
				self.run_result = False
				self.log.error("取消失败")
				raise AssertionError('取消失败')
			else:
				self.log.info(u'区域取消成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_manage_cancel(self):
		"""审批经理取消"""
		self.case_name = custom.get_current_function_name()
		try:
			# 1. 进件
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# 2. 审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 审批经理取消
			res = self.PT.approval_to_review(page, self.apply_code, u'审审批经理取消成功', 2)
			if not res:
				self.run_result = False
				self.log.error("高级审批经理取消失败!")
				raise AssertionError('高级审批经理取消失败')
			else:
				self.log.info(u'高级审批经理取消成功!')
				self.get_next_user(page, self.apply_code)
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_01_branch_director_reject(self):
		"""主管拒绝"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				1. 申请基本信息录入
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				2. 风控拒绝
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'主管拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("主管拒绝失败")
				raise AssertionError('主管拒绝失败')
			else:
				self.log.info('主管拒绝结束!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 拒绝
			value = self.HRL.reconsideration(page, self.apply_code)
			if value:
				self.log.info(u'主管拒绝成功,拒绝单已处于拒绝队列!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'主管拒绝失败,拒绝队列未找到该笔单!')
				raise AssertionError('主管拒绝失败,拒绝队列未找到该笔单!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_01_branch_director_reject_pass(self):
		"""主管拒绝,并复议通过"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				1. 申请基本信息录入
			"""
			custom.print_product_info(self.product_info)
			self.before_application_entry()
			# 2. 进件
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管回退
			res = self.PT.approval_to_review(page, self.apply_code, u'主管拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("主管拒绝失败")
				raise AssertionError('主管拒绝失败')
			else:
				self.log.info(u'主管拒绝!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 1)
			if r1:
				self.log.info(u'主管拒绝成功,复议通过!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'主管拒绝失败,复议出错!')
				raise AssertionError('主管拒绝失败,复议出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_01_branch_director_reject_fail(self):
		"""主管拒绝,并复议不通过"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				1. 申请基本信息录入
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			
			self.before_application_entry()
			"""
				2. 风控拒绝
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管回退
			res = self.PT.approval_to_review(page, self.apply_code, u'主管拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("主管拒绝失败")
				raise AssertionError('主管拒绝失败,复议出错!')
			else:
				self.log.info(u'主管拒绝!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 2)
			if r1:
				self.log.info(u'主管拒绝成功,复议不通过成功!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'主管拒绝失败,复议不通过出错!')
				raise AssertionError('主管拒绝失败,复议不通过出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_branch_manager_reject(self):
		"""分公司经理拒绝"""
		
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				------------------------------------------------------------
									2. 风控审批拒绝
				------------------------------------------------------------
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管审批
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管审批', 0)
			if not res:
				self.run_result = False
				self.log.error("审批失败")
				raise AssertionError('审批失败')
			else:
				self.log.info(u'分公司主管审批通过!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("分公司经理拒绝失败!")
				raise AssertionError('分公司经理拒绝失败!')
			else:
				self.log.info(u'分公司经理拒绝!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'区域经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域经理拒绝失败!")
				raise AssertionError('区域经理拒绝失败!')
			else:
				self.log.info(u'区域经理拒绝成功!')
				self.get_next_user(page, self.apply_code)
			
			# 下一步处理人登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 拒绝
			value = self.HRL.reconsideration(page, self.apply_code)
			if value:
				self.log.info(u'分公司经理拒成功,拒绝单已处于拒绝队列!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'分公司经理拒绝失败,拒绝队列未找到该笔单!')
				raise AssertionError('分公司经理拒绝失败,拒绝队列未找到该笔单!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_branch_manager_reject_pass(self):
		"""分公司经理拒绝,并复议通过"""
		
		self.case_name = custom.get_current_function_name()
		try:
			# 1. 进件
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# 2. 审批
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管审批
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管审批通过', 0)
			if not res:
				self.run_result = False
				self.log.error("审批失败")
				raise AssertionError('审批失败')
			else:
				self.log.info(u'分公司主管审批通过!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司经理回退
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("分公司经理拒绝失败!")
				raise AssertionError('分公司经理拒绝失败!')
			else:
				self.log.info(u'分公司经理拒绝!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'区域经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域经理拒绝拒绝失败!")
				raise AssertionError('区域经理拒绝拒绝失败')
			else:
				self.log.info(u'区域经理拒绝!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 1)
			if r1:
				self.log.info(u'分公司经理拒绝成功,复议通过!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'分公司经理拒绝失败,复议出错!')
				raise AssertionError('分公司经理拒绝失败,复议出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_branch_manager_reject_fail(self):
		"""分公司经理拒绝,并复议不通过"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				1. 申请基本信息录入
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				2. 风控拒绝
			"""
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 分公司主管审批
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司主管审批通过', 0)
			if not res:
				self.run_result = False
				self.log.error("审批失败")
				raise AssertionError('审批失败')
			else:
				self.log.info(u'分公司主管审批通过!')
				self.get_next_user(page, self.apply_code)
			
			page = Login(self.next_user_id)
			# 分公司经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'分公司经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("分公司经理拒绝失败")
				raise AssertionError('分公司经理拒绝失败')
			else:
				self.log.info(u'分公司经理拒绝!')
			
			self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'区域经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域经理拒绝拒绝失败!")
				raise ValueError("区域经理拒绝拒绝失败!")
			else:
				self.log.info(u'区域经理拒绝!')
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 2)
			if r1:
				self.log.info(u'分公司经理拒绝成功,并复议不通过成功!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'分公司经理拒绝成功,但复议不通过出错!')
				raise AssertionError('分公司经理拒绝成功,但复议不通过出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_regional_reject(self):
		"""区域复核拒绝"""
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			
			# 2. 审批
			user_list = ['分公司主管', '分公司经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 3. 拒绝
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域预复核拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'区域拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域拒绝失败")
				raise AssertionError('区域拒绝失败')
			else:
				self.log.info("区域拒绝!")
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败")
				raise AssertionError('高级经理拒绝失败')
			else:
				self.log.info("高级经理拒绝拒绝成功!")
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 拒绝
			value = self.HRL.reconsideration(page, self.apply_code)
			if value:
				self.log.info(u'区域拒绝成功,拒绝单已处于拒绝队列!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'区域失败,拒绝队列未找到该笔单!')
				raise AssertionError('区域失败,拒绝队列未找到该笔单!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_regional_reject_pass(self):
		"""区域复核拒绝,并复议通过"""
		
		self.case_name = custom.get_current_function_name()
		try:
			"""
				---------------------------------------------------------------------
										1. 申请基本信息录入
				---------------------------------------------------------------------
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			
			self.before_application_entry()
			
			"""
				------------------------------------------------------------
									2. 风控审批取消
				------------------------------------------------------------
			"""
			# 2. 审批
			user_list = ['分公司主管', '分公司经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域预复核取消
			res = self.PT.approval_to_review(page, self.apply_code, u'区域拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域拒绝失败")
				raise AssertionError('区域拒绝失败')
			else:
				self.log.info("区域拒绝!")
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 1)
			if r1:
				self.log.info(u'区域拒绝成功!复议通过!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'区域拒绝失败,复议出错!')
				raise AssertionError('区域拒绝失败,复议出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_regional_reject_fail(self):
		"""区域复核拒绝,并复议不通过"""
		self.case_name = custom.get_current_function_name()
		try:
			"""
				---------------------------------------------------------------------
										1. 申请基本信息录入
				---------------------------------------------------------------------
			"""
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				------------------------------------------------------------
									2. 风控审批拒绝
				------------------------------------------------------------
			"""
			# 2. 审批
			user_list = ['分公司主管', '分公司经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 区域预复核取消
			res = self.PT.approval_to_review(page, self.apply_code, u'区域拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("区域拒绝失败")
				raise AssertionError('区域拒绝失败')
			else:
				self.log.info("区域拒绝!")
				self.get_next_user(page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理失败")
				raise AssertionError('高级经理失败')
			else:
				self.log.info("高级经理拒绝成功!")
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 2)
			if r1:
				self.log.info(u'区域拒绝成功,复议不通过成功!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'区域拒绝成功,复议不通过出错!')
				raise AssertionError('区域拒绝成功,复议不通过出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_manage_reject(self):
		"""高级审批经理拒绝"""
		
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			# ------------------------------------------------------------
			# 2. 风控审批拒绝
			# ------------------------------------------------------------
			
			# 2. 审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			if self.next_user_id != self.senior_manager:
				return
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 拒绝
			value = self.HRL.reconsideration(page, self.apply_code)
			if value:
				self.log.info(u'审批经理拒绝成功,拒绝单已处于拒绝队列!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'审批经理拒绝失败,拒绝队列未找到该笔单!')
				raise AssertionError(u'审批经理拒绝失败,拒绝队列未找到该笔单!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_manage_reject_pass(self):
		"""高级审批经理拒绝,并复议通过"""
		
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			"""
				------------------------------------------------------------
									2. 风控审批回退
				------------------------------------------------------------
			"""
			
			# 2. 审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 1)
			if r1:
				self.log.info(u'复议通过!')
				page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'复议出错!')
				raise AssertionError('复议出错!')
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_manage_reject_fail(self):
		"""高级审批经理拒绝,并复议不通过"""
		
		self.case_name = custom.get_current_function_name()
		try:
			custom.print_product_info(self.product_info)
			custom.print_person_info(self.person_info)
			self.before_application_entry()
			
			# 2. 审批
			user_list = ['分公司主管', '分公司经理', '区域经理']
			for i in user_list:
				# 下一个处理人重新登录
				page = Login(self.next_user_id)
				res = self.PT.approval_to_review(page, self.apply_code, i, 0)
				self.risk_approval_result(res, i, page, self.apply_code)
			
			# 下一个处理人重新登录
			page = Login(self.next_user_id)
			
			# 高级经理拒绝
			res = self.PT.approval_to_review(page, self.apply_code, u'高级经理拒绝', 3)
			if not res:
				self.run_result = False
				self.log.error("高级经理拒绝失败!")
				raise AssertionError('高级经理拒绝失败!')
			else:
				self.log.info(u'高级经理拒绝成功!')
				page.driver.quit()
			
			# 高级审批经理登录
			page = Login(self.senior_manager)
			
			# 复议通过
			r1 = self.HRL.reconsideration(page, self.apply_code, 2)
			if r1:
				self.log.info(u'复议不通过成功!')
				self.page.driver.quit()
			else:
				self.run_result = False
				self.log.error(u'复议不通过出错!')
				raise AssertionError(u'复议不通过出错!')
		except Exception as e:
			self.run_result = False
			raise e
Ejemplo n.º 10
0
class SPA(unittest.TestCase, base.Base, SET):
    """特批"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def get_next_user(self, page, applycode):
        next_id = self.PM.process_monitor(page, applycode)
        if next_id is None:
            self.log.error("没有找到下一步处理人!")
            raise AssertionError('没有找到下一步处理人!')
        else:
            self.next_user_id = next_id
            self.log.info("下一步处理人:" + next_id)
            # 当前用户退出系统
            page.driver.quit()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_region_special_approval(self):
        """区域李伟波特批"""
        self.case_name = custom.get_current_function_name()
        custom.print_product_info(self.product_info)
        try:
            self.before_application_entry()
            """
				------------------------------------------------------------
									2. 风控审批-区域特批
				------------------------------------------------------------
			"""
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 分公司主管审批
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'分公司主管审批通过', 0)
            if not res:
                self.run_result = False
                self.log.error("审批失败")
                raise AssertionError('审批失败')
            else:
                self.log.info(u'分公司主管审批通过!')
                self.get_next_user(page, self.apply_code)

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 分公司经理审批通过
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'分公司经理回退到申请录入', 0)
            if not res:
                self.run_result = False
                self.log.error("审批失败")
                raise AssertionError('审批失败')
            else:
                self.log.info(u'分公司经理审批通过!')
                self.get_next_user(page, self.apply_code)

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            if self.next_user_id != 'xn004754':
                # 区域特批
                res = self.PT.approval_to_review(page, self.apply_code,
                                                 u'区域审批经理审批', 0)
                if not res:
                    self.run_result = False
                    self.log.error("区域审批经理审批失败")
                    raise AssertionError('区域审批经理审批失败')
                else:
                    self.log.info(u'区域审批经理审批成功!')
                    self.get_next_user(page, self.apply_code)
            else:
                r = self.PT.special_approval(page, self.apply_code, u'区域特批')
                if not r:
                    self.run_result = False
                    self.log.error('区域特批出错!')
                    raise AssertionError('区域特批出错!')
                else:
                    self.log.info('区域特批通过!')
                    self.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_02_manage_special_approval(self):
        """高级经理特批"""
        try:
            self.test_01_region_special_approval()
            self.case_name = custom.get_current_function_name()
            page = Login(self.next_user_id)
            r = self.PT.special_approval(page, self.apply_code, u'高级经理特批')
            if not r:
                self.run_result = False
                self.log.error('高级经理特批出错!')
                raise AssertionError('高级经理特批出错!')
            else:
                self.log.info('高级经理特批通过!')
                self.get_next_user(page, self.apply_code)
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_03_risk_director_special_approval(self):
        """区域特批,风控总监特批终审"""

        try:
            self.test_02_manage_special_approval()
            self.case_name = custom.get_current_function_name()
            page = Login(self.next_user_id)
            r = self.PT.special_approval(page, self.apply_code, u'风控总监特批')
            if not r:
                self.log.error('风控总监特批出错!')
                raise AssertionError('风控总监特批出错!')
            else:
                self.log.info('风控总监特批通过!')
                self.get_next_user(page, self.apply_code)
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 11
0
class PartRaise(unittest.TestCase, base.Base, SET):
    """部分请款募资"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_cwd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_part_receipt_director_approval(self):
        """400000元部分请款,回执分公司主管审批"""

        # ---------------------------------------------------------------------------------
        #                   1. 申请录入
        # ---------------------------------------------------------------------------------
        self.case_name = custom.get_current_function_name()
        self.update_product_amount(400000)

        # 1 客户信息-业务基本信息

        try:
            # 打印贷款产品信息
            custom.print_product_info(self.product_info)
            if self.company['branchName'] not in product.product_city:
                # 非渠道城市进件
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'])
            else:
                # 渠道城市新产品
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'], True)
        except Exception as e:
            self.run_result = False
            raise e

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        self.HAE.input_customer_borrow_info(self.page,
                                            self.data['custInfoVo'][0])

        # 3 物业信息
        self.HAE.input_all_bbi_property_info(
            self.page, self.data['applyPropertyInfoVo'][0],
            self.data['applyCustCreditInfoVo'][0], self.cust_name)
        # 提交
        self.HAE.submit(self.page)
        self.log.info("申请件录入完成提交")

        apply_code = self.AQ.get_applycode(self.page, self.cust_name)
        if apply_code:
            self.apply_code = apply_code
            self.log.info("申请件查询完成")
            print("apply_code:" + self.apply_code)
        # 流程监控
        result = self.PM.process_monitor(self.page, apply_code)
        if result is not None:
            self.next_user_id = result
            self.log.info("完成流程监控查询")
        else:
            raise ValueError("流程监控查询出错!")

        # ---------------------------------------------------------------------------------------
        # 	                        2. 风控审批流程
        # ---------------------------------------------------------------------------------------

        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        list_mark = [
            "分公司主管审批",
            "分公司经理审批",
            "区域预复核审批",
            # "高级审批经理审批"
        ]

        for e in list_mark:
            res = self.PT.approval_to_review(page, apply_code, e, 0)
            self.risk_approval_result(res, e, page, apply_code)
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

        if self.next_user_id == self.senior_manager:
            res = self.PT.approval_to_review(page, apply_code, '高级审批经理', 0)
            self.risk_approval_result(res, '高级审批经理', page, apply_code)

            page = Login(self.next_user_id)
            # 两个人签约
            rc = Cts.ContractSign(page, self.apply_code, self.rec_bank_info, 2)
            res = rc.execute_enter_borroers_bank_info()
            if res:
                rc.contract_submit()
                self.log.info("合同打印完成!")
                # 查看下一步处理人
                self.next_user_id = common.get_next_user(page, apply_code)

            # -----------------------------------------------------------------------------
            #                                合规审查
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查
            res = self.PT.compliance_audit(page, self.apply_code)
            if res:
                self.log.info("合规审批结束")
                page.driver.quit()
            else:
                self.log.error("合规审查失败")
                raise ValueError("合规审查失败")

            # -----------------------------------------------------------------------------
            #                                权证办理
            # -----------------------------------------------------------------------------
            page = Login(self.company["authority_member"]["user"])
            # 权证员上传权证信息
            res = self.WM.authority_card_transact_2(page, self.apply_code, 1,
                                                    self.env)
            if not res:
                self.log.error("上传权证资料失败")
                raise ValueError("上传权证资料失败")
            else:
                self.log.info("权证办理完成")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                权证请款
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)
            # 部分请款
            res = self.PT.part_warrant_apply(page, self.apply_code)
            if not res:
                self.log.error("权证请款失败!")
                raise ValueError('权证请款失败!')
            else:
                self.log.info("完成权证请款")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                回执提放审批审核,回执分公司主管审批
            # -----------------------------------------------------------------------------
            page = Login(self.next_user_id)
            rec = self.PT.receipt_return(page, self.apply_code)
            if not rec:
                self.log.error("回执分公司主管审批失败")
                raise ValueError('失败')
            else:
                self.log.info("回执分公司主管审批通过")
                self.next_user_id = common.get_next_user(page, self.apply_code)

        else:

            # 两个人签约
            rc = Cts.ContractSign(page, self.apply_code, self.rec_bank_info, 2)
            res = rc.execute_enter_borroers_bank_info()
            if res:
                rc.contract_submit()
                self.log.info("合同打印完成!")
                # 查看下一步处理人
                self.next_user_id = common.get_next_user(page, apply_code)

            # -----------------------------------------------------------------------------
            #                                合规审查
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查
            res = self.PT.compliance_audit(page, self.apply_code)
            if res:
                self.log.info("合规审批结束")
                page.driver.quit()
            else:
                self.log.error("合规审查失败")
                raise ValueError("合规审查失败")

            # -----------------------------------------------------------------------------
            #                                权证办理
            # -----------------------------------------------------------------------------
            page = Login(self.company["authority_member"]["user"])
            # 权证员上传权证信息
            res = self.WM.authority_card_transact_2(page, self.apply_code, 1,
                                                    self.env)
            if not res:
                self.log.error("上传权证资料失败")
                raise ValueError("上传权证资料失败")
            else:
                self.log.info("权证办理完成")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                权证请款
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)
            # 部分请款
            res = self.PT.part_warrant_apply(page, self.apply_code)
            if not res:
                self.log.error("权证请款失败!")
                raise ValueError('权证请款失败!')
            else:
                self.log.info("完成权证请款")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                回执提放审批审核,回执分公司主管审批
            # -----------------------------------------------------------------------------
            page = Login(self.next_user_id)
            rec = self.PT.receipt_return(page, self.apply_code)
            if not rec:
                self.log.error("回执分公司主管审批失败")
                raise ValueError('失败')
            else:
                self.log.info("回执分公司主管审批通过")
                self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_02_part_receipt_manage_approval(self):
        """回执分公司经理审批"""

        self.test_01_part_receipt_director_approval()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rec = self.PT.receipt_return(page, self.apply_code)
        if not rec:
            self.log.error("回执审批经理审批失败")
            raise ValueError('失败')
        else:
            self.log.info("回执审批经理审批通过")
            self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_03_receipt_first_approval(self):
        """第一次回执放款申请"""
        self.test_02_part_receipt_manage_approval()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rec = self.PT.receipt_return(page, self.apply_code)
        if not rec:
            self.log.error("第一次回执放款申请失败")
            raise ValueError('失败')
        else:
            self.log.info("第一次回执放款申请通过")
            self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_04_part_finace_transact(self):
        """部分请款-财务办理"""

        # 权证请款
        self.test_03_receipt_first_approval()
        self.case_name = custom.get_current_function_name()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        rs = self.FA.finace_transact(page, self.apply_code)
        if not rs:
            self.log.error("财务办理失败")
            raise AssertionError('财务办理失败')
        else:
            self.log.info("财务办理结束!")
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_05_part_finace_branch_manage_aproval(self):
        """财务分公司经理审批"""
        remark = u"财务分公司经理审批"

        self.test_04_part_finace_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-分公司经理审批失败")
            raise AssertionError('财务流程-分公司经理审批失败')
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_06_part_finace_approval_risk_control_manager(self):
        """财务风控经理审批"""

        remark = u'风控经理审批'

        self.test_05_part_finace_branch_manage_aproval()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-风控经理审批出错")
            raise AssertionError('财务流程-风控经理审批出错')
        else:
            self.log.info("财务流程-风控经理审批完成")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_07_part_finace_approval_financial_accounting(self):
        """财务会计审批"""

        remark = u'财务会计审批'

        self.test_06_part_finace_approval_risk_control_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rs = self.FA.finace_approval(page, self.apply_code, remark)
        if not rs:
            self.log.error("财务流程-财务会计审批失败")
            raise AssertionError('财务流程-财务会计审批失败')
        else:
            self.log.info("财务流程-财务会计审批完成")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

    def test_08_part_finace_approval_financial_manager(self):
        """财务经理审批"""

        remark = u'财务经理审批'

        self.test_07_part_finace_approval_financial_accounting()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        res = self.FA.finace_approval(page, self.apply_code, remark)
        if not res:
            self.log.error("财务流程-财务经理审批失败")
            raise AssertionError('财务流程-财务经理审批失败')
        else:
            self.log.info("财务流程-财务经理审批完成")
            page.driver.quit()

    def test_09_part_funds_raise(self):
        """资金主管募资审批"""

        remark = u'资金主管审批'

        self.test_08_part_finace_approval_financial_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, remark)
        if not res:
            self.log.error("募资-资金主管审批失败")
            raise AssertionError('募资-资金主管审批失败')
        else:
            self.log.info("募资-资金主管审批完成!")
            page.driver.quit()

    def test_10_part_authority_card_second_deal(self):
        """第二次权证办理"""
        self.test_09_part_funds_raise()
        self.case_name = custom.get_current_function_name()
        page = Login(self.company["authority_member"]["user"])

        # 修改数据库,将第一次请款修改为放款成功,然后才能发起第二次权证请款,否则第二次权证办理不能跟提交
        db = database.DB()

        sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \
		WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \
		WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")"

        contract_no = self.apply_code + '-3-02-1'

        sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21  \
		WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \
		WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")" + "AND CONTRACT_NO =" + "'" + contract_no + "'"

        db.sql_execute(sql_1)
        db.sql_execute(sql_2)
        db.sql_commit()
        time.sleep(3)

        # 权证员上传权证信息
        res = self.WM.authority_card_transact_2(page, self.apply_code, 2,
                                                self.env)
        if not res:
            self.log.error("上传权证资料失败")
            raise ValueError("上传权证资料失败")
        else:
            self.log.info("权证办理完成")
            self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_11_part_warrent_request_money(self):
        """第二次权证请款"""

        self.test_10_part_authority_card_second_deal()
        self.case_name = custom.get_current_function_name()
        # 下一个处理人重新登录
        page = Login(self.next_user_id)
        # 部分请款
        res = self.PT.part_warrant_apply(page, self.apply_code, 1)
        if not res:
            self.log.error("权证请款失败!")
            raise ValueError('权证请款失败!')
        else:
            self.log.info("完成权证请款")
            self.next_user_id = common.get_next_user(page, self.apply_code)

    def test_12_part_finace_transact_second(self):
        """第二次财务办理"""

        self.test_11_part_warrent_request_money()
        self.case_name = custom.get_current_function_name()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        rs = self.FA.finace_transact(page, self.apply_code)
        if not rs:
            self.log.error("财务办理失败")
            raise AssertionError('财务办理失败')
        else:
            self.log.info("财务办理结束!")
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 2)

    def test_13_part_finace_branch_manage_aproval_second(self):
        """第二次财务分公司主管审批"""
        remark = u"财务分公司经理审批"

        self.test_12_part_finace_transact_second()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-分公司经理审批失败")
            raise AssertionError('财务流程-分公司经理审批失败')
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 2)

    def test_14_part_finace_approval_risk_control_manager(self):
        """第二次财务风控经理审批"""
        remark = u'风控经理审批'

        self.test_13_part_finace_branch_manage_aproval_second()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-风控经理审批出错")
            raise AssertionError('财务流程-风控经理审批出错')
        else:
            self.log.info("财务流程-风控经理审批完成")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 2)

    def test_15_part_finace_approval_financial_accounting_second(self):
        """第二次财务会计审批"""

        remark = u'财务会计审批'

        self.test_14_part_finace_approval_risk_control_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rs = self.FA.finace_approval(page, self.apply_code, remark)
        if not rs:
            self.log.error("财务流程-财务会计审批失败")
            raise AssertionError('财务流程-财务会计审批失败')
        else:
            self.log.info("财务流程-财务会计审批完成")

        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 2)

    def test_16_finace_approval_financial_manager_second(self):
        """财务经理审批"""

        remark = u'财务经理审批'

        self.test_15_part_finace_approval_financial_accounting_second()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        res = self.FA.finace_approval(page, self.apply_code, remark)
        if not res:
            self.log.error("财务流程-财务经理审批失败")
            raise AssertionError('财务流程-财务经理审批失败')
        else:
            self.log.info("财务流程-财务经理审批完成")
            page.driver.quit()

    def test_17_part_funds_raise_second(self):
        """第二次募资发起"""

        remark = u'资金主管审批'

        self.test_16_finace_approval_financial_manager_second()
        self.case_name = custom.get_current_function_name()
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, remark)
        if not res:
            self.log.error("募资-资金主管审批失败")
            raise AssertionError('募资-资金主管审批失败')
        else:
            self.log.info("募资-资金主管审批完成!")
            self.page.driver.quit()
Ejemplo n.º 12
0
class WarrantManage(unittest.TestCase, base.Base, SET):
    """权证请款流程"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_eyt.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_warrantManage_original(self):
        """权证原件请款"""
        self.case_name = custom.get_current_function_name()
        try:
            self.update_product_amount(2000000)
            # 1. 申请录入
            self.before_application_entry()
            # 2. 风控审批
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            list_mark = ["分公司主管审批", "分公司经理审批", "区域预复核审批", "高级审批经理审批", "风控总监审批"]

            count = 0
            for e in list_mark:
                if count == 3:
                    if self.next_user_id != self.senior_manager:
                        continue
                res = self.PT.approval_to_review(page, self.apply_code, e, 0)
                self.risk_approval_result(res, e, page, self.apply_code)
                # 下一个处理人重新登录
                page = Login(self.next_user_id)
                count = count + 1

            # -----------------------------------------------------------------------------
            # 	                        3. 合同打印
            # -----------------------------------------------------------------------------

            rc = ContractSign.ContractSign(page, self.apply_code,
                                           self.rec_bank_info, 10)
            res = rc.execute_enter_borroers_bank_info()
            if res:
                rc.contract_submit()

            self.next_user_id = common.get_next_user(page, self.apply_code)

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查
            res = self.PT.compliance_audit(page, self.apply_code)
            if res:
                self.log.info("合规审批结束")
                page.driver.quit()
            else:
                self.run_result = False
                self.log.error("合规审查失败")
                raise ValueError("合规审查失败")

            # 权证办理
            # 权证员登录
            page = Login(self.company["authority_member"]["user"])
            # 权证员上传权证信息
            self.WM.authority_card_transact(page, self.apply_code, self.env)
            self.next_user_id = common.get_next_user(page, self.apply_code)

            page = Login(self.next_user_id)
            # 权证请款
            res = self.WM.warrant_apply(page, self.apply_code)
            if not res:
                self.run_result = False
                self.log.error("权证请款失败!")
                raise ValueError('权证请款失败!')
            else:
                self.log.info("完成权证请款")
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_02_warrantManage_part(self):
        """部分权证请款"""
        self.case_name = custom.get_current_function_name()
        try:
            self.update_product_amount(400000)
            self.before_contract_sign()

            # -----------------------------------------------------------------------------
            # 	                        3. 合同打印
            # -----------------------------------------------------------------------------
            # next transcat person
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 两个人签约
            rc = ContractSign.ContractSign(page, self.apply_code,
                                           self.rec_bank_info, 2)
            res = rc.execute_enter_borroers_bank_info()
            if res:
                rc.contract_submit()
                self.log.info("合同打印完成!")
                # 查看下一步处理人
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                合规审查
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查
            res = self.PT.compliance_audit(page, self.apply_code)
            if res:
                self.log.info("合规审批结束")
                page.driver.quit()
            else:
                self.run_result = False
                self.log.error("合规审查失败")
                raise ValueError("合规审查失败")

            # -----------------------------------------------------------------------------
            #                                权证办理
            # -----------------------------------------------------------------------------
            page = Login(self.company["authority_member"]["user"])
            # 权证员上传权证信息
            res = self.WM.authority_card_transact(page, self.apply_code,
                                                  self.env)
            if not res:
                self.run_result = False
                self.log.error("上传权证资料失败")
                raise ValueError("上传权证资料失败")
            else:
                self.log.info("权证办理完成")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                权证请款
            # -----------------------------------------------------------------------------
            # 下一个处理人重新登录
            page = Login(self.next_user_id)
            # 部分请款
            res = self.PT.part_warrant_apply(page, self.apply_code)
            if not res:
                self.run_result = False
                self.log.error("权证请款失败!")
                raise ValueError('权证请款失败!')
            else:
                self.log.info("完成权证请款")
                self.next_user_id = common.get_next_user(page, self.apply_code)

            # -----------------------------------------------------------------------------
            #                                回执提放审批审核,回执分公司主管审批
            # -----------------------------------------------------------------------------
            receipt_lst = ['回执分公司主管审批', '回执审批经理审批', '第一次回执放款申请']

            for i in receipt_lst:
                page = Login(self.next_user_id)
                rec = self.PT.receipt_return(page, self.apply_code)
                if not rec:
                    self.run_result = False
                    self.log.error(i + "失败")
                    raise ValueError(i + '失败')
                else:
                    self.log.info(i + "通过")
                    self.next_user_id = common.get_next_user(
                        page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 13
0
class QueryProdcut(unittest.TestCase, Base, SET):
    """查询房贷产品"""
    def setUp(self):
        self.env_file = None
        self.data_file = None
        Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)

    def test_query_all_enable_product(self):
        """查询房贷所有的已启动的产品"""

        self.log.info("查询房贷所有的已启动的产品")
        db = database.DB()
        sql = """
		SELECT NAME
		FROM BASE_PRODUCT
			WHERE PRODUCT_TYPE_ID = '4003156770' AND STATUS = 'enable'
		"""

        db.sql_execute(sql)
        res = db.sql_print()

        import report
        r_dir = report.__path__[0]
        l_p = os.path.join(r_dir, 'product.xlsx')
        workbook = xlsxwriter.Workbook(l_p)
        worksheet = workbook.add_worksheet()

        lth = res.__len__()
        fm = workbook.add_format({
            'align': 'center',
        })
        worksheet.write(0, 0, "序号")
        worksheet.write(0, 1, "名称")
        for i in range(1, lth):
            worksheet.write(i, 0, i, fm)
            worksheet.write(i, 1, res[i])

    def test_query_all_disable_product(self):
        """查询房贷所有的已停用的产品"""

        self.log.info("查询房贷所有的已启动的产品")
        db = database.DB()
        sql = """
		SELECT NAME
		FROM BASE_PRODUCT
			WHERE PRODUCT_TYPE_ID = '4003156770' AND STATUS = 'disable'
		"""

        db.sql_execute(sql)
        db.sql_print()
Ejemplo n.º 14
0
class DoneList(unittest.TestCase, base.Base, SET):
    """已处理任务"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_query_done_list(self):
        """查询已处理任务列表"""
        self.case_name = custom.get_current_function_name()
        # 贷款产品信息
        custom.print_product_info(self.product_info)

        try:
            try:
                # 打印贷款产品信息
                if self.company['branchName'] not in self.city:
                    # 非渠道城市进件
                    self.HAE.input_customer_base_info(self.page,
                                                      self.data['applyVo'])
                else:
                    # 渠道城市新产品
                    self.HAE.input_customer_base_info(self.page,
                                                      self.data['applyVo'],
                                                      True)
            except Exception as e:
                self.run_result = False
                raise e

            # 2 客户基本信息 - 借款人/共贷人/担保人信息
            self.HAE.input_customer_borrow_info(self.page,
                                                self.data['custInfoVo'][0])

            # 3 物业信息
            self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name)
            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")

            applycode = self.AQ.get_applycode(self.page, self.cust_name)
            if applycode:
                self.apply_code = applycode
                self.log.info("申请件查询完成")
                print("applycode:" + self.apply_code)
            # 流程监控
            result = self.PM.process_monitor(self.page, self.apply_code)
            if result != None:
                self.next_user_id = result
                self.log.info("完成流程监控查询")
                self.page.driver.quit()
            else:
                self.run_result = False
                self.log.error("流程监控查询出错!")
                raise AssertionError('流程监控查询出错!')

            # 审批
            page = login.Login(self.next_user_id)
            # 审批审核
            self.PT.approval_to_review(page, self.apply_code, u'分公司主管同意审批', 0,
                                       True)
            self.DL.query_done_list(page, self.apply_code)
            page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 15
0
class SpecaiPartRaise(unittest.TestCase, Base, SET):
    """特别的募资场景"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_eyt.json"
        Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_specail_part_raise(self):
        """第一次全额请款,第二次为0"""
        self.case_name = custom.get_current_function_name()
        # ------------合同打印-------------
        try:
            self.before_contract_sign(200000)
            rc = Cts.ContractSign(self.page, self.apply_code,
                                  self.rec_bank_info)
            res = rc.execute_enter_borroers_bank_info()
            if res:
                rc.contract_submit()  # 提交
        except Exception as e:
            self.run_result = False
            raise e
        self.next_user_id = common.get_next_user(self.page, self.apply_code)

        # ------------合规审查------------------
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 合规审查
        res = self.PT.compliance_audit(page, self.apply_code)
        if res:
            self.log.info("合规审批结束")
            page.driver.quit()
        else:
            raise ValueError("合规审查失败")

        # ------------权证办理----------------
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        res = self.WM.authority_card_transact_2(page, self.apply_code, 1,
                                                self.env)
        if not res:
            raise ValueError("上传权证资料失败")
        else:
            self.log.info("权证办理完成")
            self.next_user_id = common.get_next_user(page, self.apply_code)

        # ------------权证请款----------------
        # 下一个处理人重新登录
        page = Login(self.next_user_id)
        # 部分请款
        res = self.PT.part_warrant_apply(page, self.apply_code, 0)
        if not res:
            raise AssertionError('权证请款失败!')
        else:
            self.log.info("完成权证请款")
            self.next_user_id = common.get_next_user(page, self.apply_code)

        # 权证审批流程
        roles = ['回执分公司主管', '回执审批经理审批', '回执业务助理处理']

        for i in roles:
            page = Login(self.next_user_id)
            rec = self.PT.receipt_return(page, self.apply_code)
            if not rec:
                self.log.error(i + "审批失败")
                raise ValueError('失败')
            else:
                self.log.info(i + "审批通过")
                self.next_user_id = common.get_next_user(page, self.apply_code)

        # ------------财务流程----------------------
        page = Login(self.company["business_assistant"]["user"])
        rs = self.FA.finace_transact(page, self.apply_code)
        if not rs:
            self.log.error("财务办理失败")
            raise AssertionError('财务办理失败')
        else:
            self.log.info("财务办理结束!")
        # 查看下一步处理人
        self.next_user_id = common.get_next_user(page, self.apply_code, 1)

        role2 = ['分公司经理审', '风控经理', '财务会计', '财务经理']

        for e in role2:
            self.case_name = custom.get_current_function_name()
            page = Login(self.next_user_id)
            result = self.FA.finace_approval(page, self.apply_code, e + '审批通过')
            if not result:
                raise AssertionError(e + '审批失败')
            # 查看下一步处理人
            self.next_user_id = common.get_next_user(page, self.apply_code, 1)

        # ----------发起募资-----------------------------
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, '第一次资金主管募资发起')
        if not res:
            self.log.error("募资-资金主管审批失败")
            raise AssertionError('募资-资金主管审批失败')
        else:
            self.log.info("募资-资金主管审批完成!")
            page.driver.quit()

        # 修改数据表为放款成功!
        db = database.DB()

        sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \
				WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \
				WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")"

        contract_no = self.apply_code + '-3-02-1'

        sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21  \
				WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \
				WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")" + "AND CONTRACT_NO =" + "'" + contract_no + "'"

        db.sql_execute(sql_1)
        db.sql_execute(sql_2)
        db.sql_commit()
        time.sleep(3)

        # ----------第二次权证办理-----------------------------

        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        res = self.WM.authority_card_transact_2(page, self.apply_code, 2,
                                                self.env)
        if not res:
            self.log.error("上传权证资料失败")
            raise ValueError("上传权证资料失败")
        else:
            self.log.info("权证办理完成")
            self.next_user_id = common.get_next_user(page, self.apply_code)

        # ---------第二次权证请款--------------------------------
        # 下一个处理人重新登录
        page = Login(self.next_user_id)

        # 第二次请款金额为0
        res = self.PT.part_warrant_apply(page, self.apply_code, 2)
        if not res:
            raise ValueError('第二次权证请款金额为0请款流程出错!')
        else:
            self.log.info("第二次权证请款金额为0请款流程ok!")
        self.next_user_id = common.get_next_user(page, self.apply_code)
        page.driver.quit()

        # --------------------------回执审批流程---------------------
        page = Login(self.next_user_id)
        rec = self.PT.receipt_return(page, self.apply_code)
        if not rec:
            self.log.error("审批失败")
            raise ValueError('失败')
        else:

            self.log.info("审批通过,放款成功")
            page.driver.quit()
Ejemplo n.º 16
0
class UploadImageData(unittest.TestCase, base.Base, SET):
    """影响资料上传"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_01_upload_image(self):
        """房贷专员:上传权证资料"""
        self.case_name = custom.get_current_function_name()
        try:
            custom.print_product_info(self.product_info)

            # 1 客户信息-业务基本信息
            if self.HAE.input_customer_base_info(self.page,
                                                 self.data['applyVo']):
                self.log.info("录入基本信息完成")

            # 2 客户基本信息 - 借款人/共贷人/担保人信息
            self.HAE.input_customer_borrow_info(self.page,
                                                self.data['custInfoVo'][0])

            # 3 物业信息
            self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name)
            # 上传影像资料
            res = self.HAE.upload_image_file(self.page, self.exe, self.image)
            if res:
                self.log.info("上传影像资料成功!")
            else:
                self.run_result = False
                raise res

            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")

            apply_code = self.AQ.get_applycode(self.page, self.cust_name)
            if apply_code:
                self.apply_code = apply_code
                self.log.info("申请件查询完成")
                print("apply_code:" + self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_02_upload_image_delete(self):
        """房贷专员删除权证资料"""

        self.skipTest("图片定位困难")
        self.case_name = custom.get_current_function_name()
        custom.print_product_info(self.product_info)
        custom.print_person_info(self.person_info)

        # 1 客户信息-业务基本信息
        if self.HAE.input_customer_base_info(self.page, self.data['applyVo']):
            self.log.info("录入基本信息完成")

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        self.HAE.input_customer_borrow_info(self.page,
                                            self.data['custInfoVo'][0])

        # 3 物业信息
        self.HAE.input_all_bbi_property_info(
            self.page, self.data['applyPropertyInfoVo'][0],
            self.data['applyCustCreditInfoVo'][0], self.cust_name)
        # 删除影像资料
        res = self.HAE.upload_image_file(self.page, self.exe, self.image, True)
        if res:
            self.log.info("上传影像资料成功!")
        else:
            raise res

        # 提交
        self.HAE.submit(self.page)
        self.log.info("申请件录入完成提交")

        apply_code = self.AQ.get_applycode(self.page, self.cust_name)
        if apply_code:
            self.apply_code = apply_code
            self.log.info("申请件查询完成")
            print("apply_code:" + self.apply_code)

    def test_03_upload_many_image(self):
        """专员-上传多张权证资料"""
        self.case_name = custom.get_current_function_name()
        try:
            custom.print_product_info(self.product_info)
            custom.print_person_info(self.person_info)

            # 1 客户信息-业务基本信息
            if self.HAE.input_customer_base_info(self.page,
                                                 self.data['applyVo']):
                self.log.info("录入基本信息完成")

            # 2 客户基本信息 - 借款人/共贷人/担保人信息
            self.HAE.input_customer_borrow_info(self.page,
                                                self.data['custInfoVo'][0])

            # 3 物业信息
            self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name)
            # 上传影像资料

            for i in range(0, 5):
                res = self.HAE.upload_image_file(self.page, self.exe,
                                                 self.image)
                if res:
                    self.log.info("上传第" + str(i) + "张影像资料成功!")
                else:
                    self.run_result = False
                    raise res

            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")

            apply_code = self.AQ.get_applycode(self.page, self.cust_name)
            if apply_code:
                self.apply_code = apply_code
                self.log.info("申请件查询完成")
                print("apply_code:" + self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_04_branch_director_upload_image(self):
        """分公司主管:上传权证资料"""

        try:
            self.case_name = custom.get_current_function_name()
            custom.print_product_info(self.product_info)
            custom.print_person_info(self.person_info)

            # 1 客户信息-业务基本信息
            if self.HAE.input_customer_base_info(self.page,
                                                 self.data['applyVo']):
                self.log.info("录入基本信息完成")

            # 2 客户基本信息 - 借款人/共贷人/担保人信息
            self.HAE.input_customer_borrow_info(self.page,
                                                self.data['custInfoVo'][0])

            # 3 物业信息
            self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name)
            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")

            apply_code = self.AQ.get_applycode(self.page, self.cust_name)
            if apply_code:
                self.apply_code = apply_code
                self.log.info("申请件查询完成")
                print("apply_code:" + self.apply_code)

            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
            # Login
            page = Login(self.next_user_id)
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'分公司主管同意审批', 0, True)
            if not res:
                self.run_result = False
                self.log.error("can't find applycode")
                raise ValueError("can't find applycode")
            else:
                self.log.info("风控审批-分公司主管审批结束")
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_05_branch_manage_upload_image(self):
        """分公司经理-上传权证资料"""

        try:
            self.test_04_branch_director_upload_image()
            self.case_name = custom.get_current_function_name()

            page = Login(self.next_user_id)
            # 审批并上传权证资料
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'分公司经理同意审批', 0, True)
            if not res:
                self.run_result = False
                self.log.error("can't find applycode")
                raise ValueError("can't find applycode")
            else:
                self.log.info("风控审批-分公司经理审批结束")
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_06_area_manage_upload_image(self):
        """区域经理-上传权证资料"""
        self.case_name = custom.get_current_function_name()
        try:
            self.test_05_branch_manage_upload_image()
            self.case_name = custom.get_current_function_name()
            # 区域审批审核,并上传资料
            page = Login(self.next_user_id)
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'区域经理同意审批', 0, True)
            if not res:
                self.run_result = False
                self.log.error("can't find applyCode")
                raise ValueError("can't find applyCode")
            else:
                self.log.info("风控审批-区域经理审批结束")
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_07_senior_manager_upload_image(self):
        """高级审批经理-上传权证资料"""

        try:
            self.test_06_area_manage_upload_image()
            self.case_name = custom.get_current_function_name()
            # 高级审批审核,并上传资料
            page = Login(self.next_user_id)
            res = self.PT.approval_to_review(page, self.apply_code,
                                             u'高级经理同意审批', 0, True)
            if not res:
                self.log.error("can't find applyCode")
                raise ValueError("can't find applyCode")
            else:
                self.log.info("风控审批-高级经理审批结束")
                self.next_user_id = common.get_next_user(page, self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_08_compliance_Officer_original(self):
        """合规审查员上传影像资料"""

        try:
            self.case_name = custom.get_current_function_name()
            self.update_product_amount(2000000)
            # ---------------------------------------------------------------------------------
            #                   1. 申请录入
            # ---------------------------------------------------------------------------------

            # 1 客户信息-业务基本信息
            if self.HAE.input_customer_base_info(self.page,
                                                 self.data['applyVo']):
                self.log.info("录入基本信息完成")

            # 2 客户基本信息 - 借款人/共贷人/担保人信息
            self.HAE.input_customer_borrow_info(self.page,
                                                self.data['custInfoVo'][0])

            # 3 物业信息
            self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name)
            # 提交
            self.HAE.submit(self.page)
            self.log.info("申请件录入完成提交")

            apply_code = self.AQ.get_applycode(self.page, self.cust_name)
            if apply_code:
                self.apply_code = apply_code
                self.log.info("申请件查询完成")
                print("apply_code:" + self.apply_code)
            # 流程监控
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)

            # ---------------------------------------------------------------------------------------
            # 	                        2. 风控审批流程
            # ---------------------------------------------------------------------------------------

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            list_mark = ["分公司主管审批", "分公司经理审批", "区域预复核审批", "高级审批经理审批", "风控总监审批"]

            for e in list_mark:
                res = self.PT.approval_to_review(page, apply_code, e, 0)
                self.risk_approval_result(res, e, page, apply_code)
                # 下一个处理人重新登录
                page = Login(self.next_user_id)

            # -----------------------------------------------------------------------------
            # 	                        3. 合同打印
            # -----------------------------------------------------------------------------

            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            res = ContractSign.ContractSign(page, self.apply_code,
                                            self.rec_bank_info, 10)
            res.execute_enter_borroers_bank_info()
            res.contract_submit()

            self.next_user_id = common.get_next_user(page, self.apply_code)

            # 合规审查
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查, 并上传影像资料
            res = self.PT.compliance_audit(page, self.apply_code, True)
            if res:
                self.log.info("合规审批结束")
                page.driver.quit()
            else:
                self.run_result = False
                self.log.error("合规审查失败")
                raise ValueError("合规审查失败")
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 17
0
class EntryRandomProduct(unittest.TestCase, base.Base, SET):
    """任意产品进件"""
    def setUp(self):

        self.env_file = "env.json"
        self.data_file = "data_eyt.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

        pd = random.choice(product['YES'])  # 渠道产品
        print(pd)
        self.product_info.update(dict(name=pd['name']),
                                 period=str(pd['period']))
        # 设置产品
        self.data['applyVo']['productName'] = pd['name']
        self.data['applyVo']['applyPeriod'] = str(pd['period'])

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_random_product_01_base_info(self):
        """客户基本信息录入"""
        self.case_name = custom.get_current_function_name()
        try:
            # 打印贷款产品信息
            custom.print_product_info(self.product_info)
            if self.company['branchName'] not in product_city:
                # 非渠道城市进件
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'])
            else:
                # 渠道城市新产品
                self.HAE.input_customer_base_info(self.page,
                                                  self.data['applyVo'], True)
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_02_borrowr_info(self):
        """借款人/共贷人/担保人信息"""

        try:
            self.test_random_product_01_base_info()
            self.case_name = custom.get_current_function_name()
            res = self.HAE.input_customer_borrow_info(
                self.page, self.data['custInfoVo'][0])
            if res:
                self.log.info("录入借款人信息结束")
        except Exception as e:
            self.log.error("进件失败!")
            self.run_result = False
            raise e

    def test_random_product_03_Property_info(self):
        """物业信息录入"""

        try:
            self.test_random_product_02_borrowr_info()
            self.case_name = custom.get_current_function_name()
            res = self.HAE.input_all_bbi_property_info(
                self.page, self.data['applyPropertyInfoVo'][0],
                self.data['applyCustCreditInfoVo'][0], self.cust_name, True)
            if res:
                self.log.info("录入物业信息结束")
            else:
                self.log.error('进件失败:录入物业信息出错!')
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_04_applydata(self):
        """申请件录入,提交"""

        try:
            self.test_random_product_03_Property_info()
            self.case_name = custom.get_current_function_name()
            self.HAE.submit(self.page)
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_05_get_applyCode(self):
        """申请件查询"""

        try:
            self.test_random_product_04_applydata()
            self.case_name = custom.get_current_function_name()
            applycode = self.AQ.get_applycode(self.page, self.cust_name)
            if applycode:
                self.log.info("申请件查询完成")
                self.apply_code = applycode
            else:
                self.log.error("can't get applyCode!")
                raise ValueError("can't get applyCode!")
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_06_show_task(self):
        """查看待处理任务列表"""

        try:
            self.test_random_product_05_get_applyCode()
            self.case_name = custom.get_current_function_name()
            next_id = self.PM.process_monitor(self.page, self.apply_code)
            if next_id:
                self.log.info("下一个处理人:" + next_id)
                self.next_user_id = next_id
            else:
                raise ValueError("没有找到下一个处理人!")
            self.page.driver.quit()

            page = Login(self.next_user_id)

            res = self.PT.query_task(page, self.apply_code)
            if res:
                self.log.info("待处理任务列表中存在该笔案件!")
            else:
                self.log.error("待处理任务列表中不存在该笔案件!")
                raise ValueError("查询失败")
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_07_process_monitor(self):
        """流程监控"""
        try:
            self.test_random_product_05_get_applyCode()  # 申请件查询
            self.case_name = custom.get_current_function_name()
            res = self.PM.process_monitor(self.page, self.apply_code)  # l流程监控
            if not res:
                raise ValueError("流程监控错误!")
            else:
                self.page.user_info['auth']["username"] = res  # 更新下一个登录人
                self.next_user_id = res
                self.log.info("next deal User: "******"""分公司主管审批"""

        try:
            # 获取分公司登录ID
            self.test_random_product_07_process_monitor()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            self.PT.approval_to_review(page, self.apply_code, u'分公司主管同意审批', 0,
                                       True)

            # 查看下一步处理人
            next_id = self.PM.process_monitor(page, self.apply_code)
            if not next_id:
                raise AssertionError("没有找到下一个处理人")
            else:
                self.next_user_id = next_id
                self.log.info("下一个处理人:" + self.next_user_id)
                # 当前用户退出系统
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_09_branch_manager_approval(self):
        """分公司经理审批"""

        try:
            # 获取分公司经理登录ID
            self.test_random_product_08_branch_supervisor_approval()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            self.PT.approval_to_review(page, self.apply_code, u'分公司经理同意审批')

            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code)
            if not res:
                raise AssertionError("没有找到下一个处理人")
            else:
                self.next_user_id = res
                self.log.info("下一个处理人: " + self.next_user_id)
                # 当前用户退出系统
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_10_regional_prereview(self):
        """区域预复核审批"""
        try:
            # 获取区域预复核员ID
            self.test_random_product_09_branch_manager_approval()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 审批审核
            res = self.PT.approval_to_review(page, self.apply_code, u'区域预复核通过')
            if not res:
                self.log.error("区域预复核失败")
                raise AssertionError("区域预复核失败")
            else:
                self.log.info("区域预复核审批完成!")

            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code)
            if not res:
                self.log.error("Can't not found the next UserId")
                raise AssertionError("Can't not found the next UserId")
            else:
                self.next_user_id = res
                self.log.info("next_user_id %s", self.next_user_id)
                # 当前用户退出系统
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_11_manager_approval(self):
        """高级审批经理审批"""
        try:
            # 获取审批经理ID
            self.test_random_product_10_regional_prereview()
            self.case_name = custom.get_current_function_name()
            if self.next_user_id != self.senior_manager:
                return
            else:
                # 下一个处理人重新登录
                page = Login(self.next_user_id)
                # 审批审核
                self.PT.approval_to_review(page, self.apply_code, u'高级审批经理审批')
                # 查看下一步处理人
                res = self.PM.process_monitor(page, self.apply_code)
                if not res:
                    raise AssertionError('没有找到下一个处理人')
                else:
                    self.next_user_id = res
                    self.log.info("下一个处理人:" + res)
                    # 当前用户退出系统
                    page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_12_contract_signing(self):
        """签约"""

        # 收款银行信息
        rec_bank_info = dict(
            recBankNum='6210302082441017886',
            recPhone='13686467482',
            recBankProvince=u'湖南省',
            recBankDistrict=u'长沙',
            recBank=u'中国农业银行',
            recBankBranch=u'北京支行',
        )

        try:
            # 获取合同打印专员ID
            self.test_random_product_11_manager_approval()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)
            # 签约
            rc = Cts.ContractSign(page, self.apply_code, rec_bank_info)
            res = rc.execute_enter_borroers_bank_info()
            # if res:
            # 	rc.contract_submit()

            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code)
            if not res:
                raise AssertionError('没有找到下一个处理人')
            else:
                self.next_user_id = res
                self.log.info("下一个处理人: " + self.next_user_id)
                # 当前用户退出系统
                page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_13_compliance_audit(self):
        """合规审查"""

        try:
            # 获取下一步合同登录ID
            self.test_random_product_12_contract_signing()
            self.case_name = custom.get_current_function_name()
            # 下一个处理人重新登录
            page = Login(self.next_user_id)

            # 合规审查
            res = self.PT.compliance_audit(page, self.apply_code)
            if res:
                self.log.info("合规审查通过")
            else:
                self.log.error("合规审查失败")
                raise AssertionError('合规审查失败')
            page.driver.quit()
        except Exception as e:
            self.run_result = False
            raise e

    def test_random_product_14_authority_card_member_transact(self):
        """权证办理"""

        try:
            # 合规审查
            self.test_random_product_13_compliance_audit()
            self.case_name = custom.get_current_function_name()
            # 权证员登录
            page = Login(self.company["authority_member"]["user"])
            # 权证员上传权证信息
            rs = self.WM.authority_card_transact(page, self.apply_code,
                                                 self.env)
            if not rs:
                self.log.error("上传权证信息失败")
                raise AssertionError('上传权证信息失败')

            # 查看下一步处理人
            res = self.PM.process_monitor(page, self.apply_code)
            if not res:
                self.log.error("权证办理-没找到下一步处理人")
                raise AssertionError('权证办理-没找到下一步处理人')
            else:
                self.next_user_id = res
                self.log.info("下一步处理人:%s", self.next_user_id)
                # 当前用户退出系统
                page.driver.quit()
        except BaseException as e:
            self.run_result = False
            raise e

    def test_random_product_15_warrant_apply(self):
        """权证请款-原件请款"""

        # 获取合同打印专员ID
        self.test_random_product_14_authority_card_member_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        # 权证请款
        res = self.WM.warrant_apply(page, self.apply_code)
        if res:
            self.log.info("权证请款成功")
            page.driver.quit()
        else:
            self.log.error("权证请款失败")
            raise AssertionError('权证请款失败')

    def test_random_product_16_finace_transact(self):
        """财务办理"""

        # 权证请款
        self.test_random_product_15_warrant_apply()
        self.case_name = custom.get_current_function_name()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        rs = self.FA.finace_transact(page, self.apply_code)
        if not rs:
            self.log.error("财务办理失败")
            raise AssertionError('财务办理失败')

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.log.error("没有找到下一步处理人")
            raise AssertionError('没有找到下一步处理人')
        else:
            self.next_user_id = res
            self.log.info("下一步处理人:%s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_random_product_17_finace_approval_branch_manager(self):
        """财务分公司经理审批"""

        remark = u"财务分公司经理审批"

        # 下一个处理人
        self.test_random_product_16_finace_transact()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-分公司经理审批失败")
            raise AssertionError('财务流程-分公司经理审批失败')
        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.log.error("没有找到下一步处理人")
            raise AssertionError('没有找到下一步处理人')
        else:
            self.next_user_id = res
            self.log.info("下一步处理人: %s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_random_product_18_finace_approval_risk_control_manager(self):
        """财务风控经理审批"""

        remark = u'风控经理审批'
        self.test_random_product_17_finace_approval_branch_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        result = self.FA.finace_approval(page, self.apply_code, remark)
        if not result:
            self.log.error("财务流程-风控经理审批出错")
            raise AssertionError('财务流程-风控经理审批出错')
        else:
            self.log.info("财务流程-风控经理审批完成")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.log.error("Can't found the next userId!")
            raise AssertionError("Can't found the next userId!")
        else:
            self.next_user_id = res
            self.log.info("下一步处理人:%s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_random_product_19_finace_approval_financial_accounting(self):
        """财务会计审批"""
        remark = u'财务会计审批'
        self.test_random_product_18_finace_approval_risk_control_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        rs = self.FA.finace_approval(page, self.apply_code, remark)
        if not rs:
            self.log.error("财务流程-财务会计审批失败")
            raise AssertionError('财务流程-财务会计审批失败')
        else:
            self.log.info("财务流程-财务会计审批完成")

        # 查看下一步处理人
        res = self.PM.process_monitor(page, self.apply_code, 1)
        if not res:
            self.log.error("Can't found The next UserId")
            raise AssertionError("Can't found The next UserId")
        else:
            self.next_user_id = res
            self.log.info("nextId is %s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_random_product_20_finace_approval_financial_manager(self):
        """财务经理审批"""

        remark = u'财务经理审批'

        self.test_random_product_19_finace_approval_financial_accounting()
        self.case_name = custom.get_current_function_name()
        page = Login(self.next_user_id)
        res = self.FA.finace_approval(page, self.apply_code, remark)
        if not res:
            self.log.error("财务流程-财务经理审批失败")
            raise AssertionError('财务流程-财务经理审批失败')
        else:
            self.log.info("财务流程-财务经理审批完成")
            page.driver.quit()

    def test_random_product_21_funds_raise(self):
        """募资-资金主管募资审批"""

        remark = u'资金主管审批'

        self.test_random_product_20_finace_approval_financial_manager()
        self.case_name = custom.get_current_function_name()
        page = Login(self.treasurer)
        res = self.RA.funds_raise(page, self.apply_code, remark)
        if not res:
            self.log.error("募资-资金主管审批失败")
            raise AssertionError('募资-资金主管审批失败')
        else:
            self.log.info("募资-资金主管审批完成!")
            self.page.driver.quit()

    def test_random_product_22_base_data_push(self):
        """基础数据推送数据"""
        try:
            self.test_random_product_21_funds_raise()
        except Exception as e:
            self.log.error("募资错误")
            raise e

        # self.apply_code = 'NT20180529E08'

        # 修改放款
        sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \
				WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \
				WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")"

        sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21  \
				WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \
				WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")"

        # 修改合同签约表
        sql_3 = "UPDATE HOUSE_CONTRACT_SIGN SET STATUS = 'PASS' " \
                " WHERE APPLY_ID = (SELECT t.apply_id FROM house_apply_info t \
				WHERE t.apply_code ="                                + "'" + self.apply_code + "')"

        db = database.DB()
        db.sql_execute(sql_1)
        db.sql_execute(sql_2)
        db.sql_execute(sql_3)
        db.sql_commit()
        time.sleep(3)

        # 基础数据同步
        page = Login(self.treasurer)
        self.BaseData.push_data_to_financial(page, self.apply_code)
        page.driver.quit()
Ejemplo n.º 18
0
class ContractSign(unittest.TestCase, base.Base, SET):
    """合同签约"""
    def setUp(self):
        self.env_file = "env.json"
        self.data_file = "data_xhd.json"
        base.Base.__init__(self, self.env_file, self.data_file)
        SET.__init__(self)
        self.se = SET()
        self.se.start_run()

    def tearDown(self):
        self.end_time = time.clock()
        self.case_using_time(self.begin_time, self.end_time)
        print(self.using_time)
        v_l.append({
            "name": self.case_name,
            "apply_code": self.apply_code,
            "result": self.run_result,
            "u_time": self.using_time,
            "s_time": self.s_time,
            "e_time": str(datetime.datetime.now()).split('.')[0]
        })
        self.se.end_run(v_l)
        self.page.driver.quit()

    def test_one_person_sign(self):
        """单人签约"""
        try:
            self.before_contract_sign()
            self.case_name = custom.get_current_function_name()

            # 签约
            common.make_signing(self.page, self.apply_code, self.rec_bank_info)
            self.log.info("签约完成")
            # 查看下一步处理人
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_two_person_sign(self):
        """两人签约"""

        try:
            # 修改贷款金额
            self.update_product_amount(400000)
            self.before_contract_sign()
            self.case_name = custom.get_current_function_name()

            # 两个人签约
            res = common.make_signing(self.page, self.apply_code,
                                      self.rec_bank_info, 2)
            if res:
                self.log.info("合同打印完成!")
            # 查看下一步处理人
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_03_three_person_sign(self):
        """三人签约"""

        try:
            # 修改贷款金额
            self.update_product_amount(600000)
            self.before_contract_sign()
            self.case_name = custom.get_current_function_name()

            # 两个人签约
            common.make_signing(self.page, self.apply_code, self.rec_bank_info,
                                3)
            self.log.info("合同打印完成")
            # 查看下一步处理人
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_04_four_person_sign(self):
        """四人签约"""

        try:
            # 贷款金额
            self.update_product_amount(800000)
            self.before_contract_sign()
            self.case_name = custom.get_current_function_name()

            # 两个人签约
            common.make_signing(self.page, self.apply_code, self.rec_bank_info,
                                4)
            self.log.info("合同打印完成")

            # 查看下一步处理人
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e

    def test_05_five_person_sign(self):
        """五人签约"""

        try:

            # 贷款金额
            self.update_product_amount(1000000)
            self.before_contract_sign()
            self.case_name = custom.get_current_function_name()

            # 5个人签约
            common.make_signing(self.page, self.apply_code, self.rec_bank_info,
                                5)
            self.log.info("合同打印完成")

            # 查看下一步处理人
            self.next_user_id = common.get_next_user(self.page,
                                                     self.apply_code)
        except Exception as e:
            self.run_result = False
            raise e
Ejemplo n.º 19
0
class AddContract(unittest.TestCase, base.Base, SET):
	"""多借款人签约"""
	
	def setUp(self):
		
		self.env_file = "env.json"
		self.data_file = "data_eyt.json"
		base.Base.__init__(self, self.env_file, self.data_file)
		SET.__init__(self)
		self.se = SET()
		self.se.start_run()
		
		pd = random.choice(product['YES'])
		print(pd)
		self.product_info.update(dict(name=pd['name']), period=str(pd['period']))
		# 设置产品
		self.data['applyVo']['productName'] = pd['name']
		self.data['applyVo']['applyPeriod'] = str(pd['period'])
	
	def tearDown(self):
		self.end_time = time.clock()
		self.case_using_time(self.begin_time, self.end_time)
		print(self.using_time)
		v_l.append({
			"name":       self.case_name,
			"apply_code": self.apply_code,
			"result":     self.run_result,
			"u_time":     self.using_time,
			"s_time":     self.s_time,
			"e_time":     str(datetime.datetime.now()).split('.')[0]
			})
		self.se.end_run(v_l)
		self.page.driver.quit()
	
	def get_next_user(self, page, applycode):
		next_id = self.PM.process_monitor(page, applycode)
		if next_id is None:
			self.log.error("没有找到下一步处理人!")
			raise AssertionError('没有找到下一步处理人!')
		else:
			self.next_user_id = next_id
			self.log.info("下一步处理人:" + next_id)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_01_1person_contract(self):
		"""单人签约"""
		self.case_name = custom.get_current_function_name()
		try:
			self.before_contract_sign(200000)
			
			rc = Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info)
			res = rc.execute_enter_borroers_bank_info()
			if res:
				rc.contract_submit()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_02_2Person_contract(self):
		"""双人签约"""
		try:
			# 贷款金额
			self.update_product_amount(400000)
			self.before_contract_sign(400000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 2).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_03_3Person_contract(self):
		"""三人签约"""
		
		try:
			# 贷款金额
			self.update_product_amount(600000)
			self.before_contract_sign(600000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 3).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_04_4Person_contract(self):
		"""四人签约"""
		
		try:
			# 贷款金额
			self.update_product_amount(800000)
			self.before_contract_sign(800000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 4).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_05_5Person_contract(self):
		"""五人签约"""
		
		try:
			# 贷款金额
			self.update_product_amount(1000000)
			self.before_contract_sign(1000000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 5).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_06_6Person_contract(self):
		"""六人签约"""
		
		try:
			# 贷款金额
			self.update_product_amount(1200000)
			self.before_contract_sign(1200000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 6).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_07_7Person_contract(self):
		"""七人签约"""
		
		try:
			
			# 贷款金额
			self.update_product_amount(1400000)
			self.before_contract_sign(1400000)
			self.case_name = custom.get_current_function_name()
			
			Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 7).execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_08_10Person_contract(self):
		"""10人签约"""
		
		try:
			# 贷款金额
			self.update_product_amount(2000000)
			self.before_contract_sign(2000000)
			self.case_name = custom.get_current_function_name()
			
			res = Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 10)
			res.execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e
	
	def test_09_20Person_contract(self):
		"""20人签约
		"""
		
		try:
			# 贷款金额
			self.update_product_amount(4000000)
			self.before_contract_sign(4000000)
			self.case_name = custom.get_current_function_name()
			
			res = Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info, 20)
			res.execute_enter_borroers_bank_info()
		except Exception as e:
			self.run_result = False
			raise e