class EYT(unittest.TestCase):
    '''E押通-2.0产品测试'''
    def _init_params(self):
        self.cust_info = {
            '_cust_base_info': {
                'productName': u'E押通-2.0(二押)',  # 贷款产品
                'applyAmount': 200000,  # 申请金额
                'applyPeriod': 36,  # 贷款期数
                'branchManager': u"小明",
                'branchManagerCode': "xn111",
                'teamGroup': u"A队",
                "teamGroupCode": "xn0001",
                'teamManager': u"小王",
                'teamManagerCode': "xn0001",
                'sale': u"王刚",
                'saleCode': "xn0002",
                'monthIncome': 3000,
                'checkApprove': u"同意",
            },
            '_borrow_info': {
                'custName': getName(),
                'idNum': '360101199101011054',
                'phone': "13564789215",
                'address': u"湖南长沙",
                'companyName': u'小牛普惠管理有限公司',
                'postName': u'工程师',
                'workDate': u'2011-02-03',  # 入职日期
                'workYear': 5,  # 工作年限
                'monthIncoming': 15000  # 月均收入
            },
            'applyCode': '',
            'next_user_id': '',
        }
        self.loan_amount = 200000  # 拆分金额

        self.property_info = {
            'propertyOwner': self.cust_info['_borrow_info']['custName'],  # 产权人
            'propertyNo': 'EYT2017230',  # 房产证号
            'propertyStatus': True,  # 是否涉贷物业
            'propertyAge': 10,  # 房龄
            'propertyArea': 220,  # 建筑面积
            'registrationPrice': 333,  # 等级价
            'address': {
                'propertyAddressProvince': u'河北省',
                'propertyAddressCity': u'秦皇岛市',
                'propertyAddressDistinct': u'山海关区',
                'propertyAddressDetail': u'具体地址信息',
            },
            'evaluationSumAmount': 200,  # 评估公允价总值
            'evaluationNetAmount': 200,  # 评估公允价净值
            'slSumAmount': 202,  # 世联评估总值
            "slPrice": 203,  # 中介评估总值
            "agentSumAmout": 221,  # 中介评估净值
            "netSumAmount": 230,  # 网评总值
            "netAmount": 240,  # 网评净值
            "localSumAmount": 230,  # 当地评估总值
            "localNetValue": 290,  # 当地评估净值
            "remark": u"周边环境很好,带学位房,交通便利,风景秀丽.",  # 物业配套描述
            "localAssessmentOrigin": u'房产局',  # 当地评估来源
            "assessmentOrigin": u'世联行',  # 评估来源
            "evaluationCaseDescrip": u'好的没话说',  # 评估情况描述
        }

    def setUp(self):
        self._init_params()
        self.page = Login()
        self.applyCode = ""
        self.log = Log()

        try:
            import config
            rootdir = config.__path__[0]
            config_env = os.path.join(rootdir, 'env.json')
            print("config_env:" + config_env)
            with open(config_env, 'r') as f:
                self.da = json.load(f)
                self.number = self.da["number"]
                self.env = self.da["enviroment"]

            filename = "data_cwd.json"
            data, company = enviroment_change(filename, self.number, self.env)
            # 录入的源数据
            self.data = data
            # 分公司选择
            self.company = company
        except Exception as e:
            print('load config error:', str(e))
            raise

    def tearDown(self):
        self.page.quit()

    '''
		  E押通案件数据录入
	'''

    def test_eyt_01_base_info(self):
        '''客户基本信息录入'''
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])

    def test_ety_02_borrowr_info(self):
        '''借款人/共贷人/担保人信息'''
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])
        common.input_customer_borrow_info(self.page,
                                          self.cust_info['_borrow_info'])

    def test_eyt_03_Property_info(self):
        '''物业信息录入'''
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])
        common.input_customer_borrow_info(self.page,
                                          self.cust_info['_borrow_info'])
        common.input_bbi_Property_info(self.page)

    def test_eyt_04_applydata(self):
        '''申请件录入,提交'''

        # 1 客户信息-业务基本信息
        # log_to().info(u"客户基本信息录入")
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        # log_to().info(u"借款人/共贷人信息录入")
        self.custName = common.input_customer_borrow_info(
            self.page, self.cust_info['_borrow_info'])[1]

        # 3 物业信息
        # log_to().info(u"物业基本信息录入")
        common.input_bbi_Property_info(self.page)

        # 提交
        common.submit(self.page)

    def test_eyt_05_get_applyCode(self):
        '''申请件查询'''

        self.test_eyt_04_applydata()
        # name = self.cust_info['_borrow_info']['custName']
        applycode = common.get_applycode(self.page, self.custName)
        if applycode:
            self.log.info("申请件查询完成")
            self.cust_info['applyCode'] = applycode
            self.applyCode = applycode
        else:
            self.log.error("can't get applyCode!")
            raise

    def test_eyt_06_show_task(self):
        '''查看待处理任务列表'''
        self.test_eyt_05_get_applyCode()
        next_id = common.process_monitor(self.page, self.applyCode)
        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 = common.query_task(page, self.applyCode)
        if res:
            self.log.info("待处理任务列表中存在该笔案件!")
        else:
            self.log.info("待处理任务列表中不存在该笔案件!")
            raise

    def test_eyt_07_process_monitor(self):
        '''流程监控'''
        self.test_eyt_05_get_applyCode()  # 申请件查询
        res = common.process_monitor(self.page, self.applyCode)  # l流程监控

        if not res:
            raise ValueError("流程监控错误!")
        else:
            self.page.user_info['auth']["username"] = res  # 更新下一个登录人
            print self.page.user_info['auth']["username"]
            self.cust_info['next_user_id'] = res
            self.next_user_id = res
            self.log.info("next deal User: "******"下一个处理人:" + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_quit_system(self):
        '''退出系统'''
        logout(self.page.driver)
        self.page.driver.close()  # 关闭浏览器

    def test_eyt_09_branch_manager_approval(self):
        '''分公司经理审批'''

        # 获取分公司经理登录ID
        self.test_eyt_08_branch_supervisor_approval()

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

        # 审批审核
        common.approval_to_review(page, self.cust_info['applyCode'],
                                  u'分公司经理同意审批')

        # 查看下一步处理人
        res = common.process_monitor(page, self.cust_info['applyCode'])
        if not res:
            raise
        else:
            self.cust_info['next_user_id'] = res
            self.next_user_id = res
            self.log.info("下一个处理人: " + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_eyt_10_regional_prereview(self):
        '''区域预复核审批'''

        # 获取区域预复核员ID
        self.test_eyt_09_branch_manager_approval()

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

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

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

    def test_eyt_11_manager_approval(self):
        '''高级审批经理审批'''

        # 获取审批经理ID
        self.test_eyt_10_regional_prereview()

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

        # 审批审核
        common.approval_to_review(page, self.applyCode, u'高级审批经理审批')

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            raise
        else:
            self.cust_info['next_user_id'] = res
            self.next_user_id = res
            self.log.info("下一个处理人:" + res)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_12_contract_signing(self):
        '''签约'''

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

        # 扣款银行信息
        rep_bank_info = dict(
            rep_name=u'习近平',
            rep_id_num='420101198201013526',
            rep_bank_code='6210302082441017886',
            rep_phone='13686467482',
            provice=u'湖南省',
            district=u'长沙',
            rep_bank_name=u'中国银行',
            rep_bank_branch_name=u'北京支行',
        )

        # 获取合同打印专员ID
        self.test_eyt_11_manager_approval()

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

        # 签约
        common.make_signing(page, self.cust_info['applyCode'], rec_bank_info)

        # 查看下一步处理人
        res = common.process_monitor(page, self.cust_info['applyCode'])
        if not res:
            raise
        else:
            self.cust_info['next_user_id'] = res
            self.next_user_id = res
            self.log.info("下一个处理人: " + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_13_compliance_audit(self):
        '''合规审查'''

        # i_frame = 'bTabs_tab_house_commonIndex_todoList'
        # 获取下一步合同登录ID
        self.test_12_contract_signing()

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

        # 合规审查
        res = common.compliance_audit(page, self.cust_info['applyCode'])
        if res:
            Log().info("合规审查通过")
        else:
            Log().error("合规审查失败")
            raise
        page.driver.quit()

    def test_eyt_14_authority_card_member_transact(self):
        '''权证办理'''

        # print  u"申请编号:" + self.applyCode
        # 合规审查
        self.test_13_compliance_audit()
        # 权证员登录
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        rs = common.authority_card_transact(page, self.applyCode)
        if not rs:
            Log().error("上传权证信息失败")
            raise
        # common.authority_card_transact(page, "GZ20171213C06")
        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            Log().error("权证办理-没找到下一步处理人")
            raise
        else:
            self.next_user_id = res
            Log().info("下一步处理人:%s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_eyt_15_warrant_apply(self):
        '''权证请款-原件请款'''

        # 获取合同打印专员ID
        self.test_eyt_14_authority_card_member_transact()
        page = Login(self.next_user_id)
        # 权证请款
        res = common.warrant_apply(page, self.applyCode)
        if res:
            Log().info("权证请款成功")
        else:
            Log().error("权证请款失败")
            raise

    def test_eyt_16_finace_transact(self):
        '''财务办理'''

        # 权证请款
        self.test_eyt_15_warrant_apply()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        rs = common.finace_transact(page, self.applyCode)
        if not rs:
            Log().error("财务办理失败")
            raise

        # page = Login('xn052298')
        # common.finace_transact(page, 'CS20171215C02')

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

    def test_eyt_17_finace_approve_branch_manager(self):
        '''财务分公司经理审批'''

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

        # 下一个处理人
        self.test_eyt_16_finace_transact()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)
        if not result:
            Log().error("财务流程-分公司经理审批失败")
            raise
        # page = Login('xn028154')
        # common.finace_approve(page, "CS20171215X14", remark)
        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode, 1)
        if not res:
            Log().error("没有找到下一步处理人")
            raise
        else:
            self.next_user_id = res
            Log().info("下一步处理人: %s", self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()

    def test_eyt_18_finace_approve_risk_control_manager(self):
        '''财务风控经理审批'''

        remark = u'风控经理审批'

        self.test_eyt_17_finace_approve_branch_manager()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)
        if not result:
            Log().error("财务流程-风控经理审批出错")
            raise
        else:
            Log().info("财务流程-风控经理审批完成")

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

    def test_eyt_19_finace_approve_financial_accounting(self):
        '''财务会计审批'''

        remark = u'财务会计审批'

        self.test_eyt_18_finace_approve_risk_control_manager()
        page = Login(self.next_user_id)
        rs = common.finace_approve(page, self.applyCode, remark)
        if not rs:
            Log().error("财务流程-财务会计审批失败")
            raise
        else:
            Log().info("财务流程-财务会计审批完成")

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

    def test_eyt_20_finace_approve_financial_manager(self):
        '''财务经理审批'''

        remark = u'财务经理审批'

        self.test_eyt_19_finace_approve_financial_accounting()
        page = Login(self.next_user_id)
        res = common.finace_approve(page, self.applyCode, remark)
        if not res:
            Log().error("财务流程-财务经理审批失败")
            raise
        else:
            Log().info("财务流程-财务经理审批完成")
            self.page.driver.quit()

    def test_eyt_21_funds_raise(self):
        '''资金主管募资审批'''

        remark = u'资金主管审批'

        self.test_eyt_20_finace_approve_financial_manager()
        page = Login('xn0007533')
        res = common.funds_raise(page, self.applyCode, remark)
        if not res:
            Log().error("募资-资金主管审批失败")
            raise
        else:
            Log().info("募资-资金主管审批完成!")
            self.page.driver.quit()
Beispiel #2
0
class GQT(unittest.TestCase):
    '''过桥通-1.0产品测试'''
    def setUp(self):
        self.page = Login()
        self.applyCode = ''
        self.next_user_id = ""
        self.cust_info = dict(
            _borrow_info=dict(
                custName=getName(),
                idNum="360101199101011054",
                phone="13564789215",
                address=u"湖南长沙",
                companyName=u'小牛普惠管理有限公司',
                postName=u'工程师',
                workDate=u'2011-02-03',  # 入职日期
                workYear=5,  # 工作年限
                monthIncoming=15000  # 月均收入
            ),
            _cust_base_info=dict(
                productName=u'过桥通-1.0(一线城市)',  # 贷款产品
                applyAmount=50000,  # 申请金额
                applyPeriod=10,  # 贷款天数
                branchManager=u"小明",
                branchManagerCode="xn111",
                teamGroup=u"A队",
                teamGroupCode="xn0001",
                teamManager=u"小王",
                teamManagerCode="xn0001",
                sale=u"王刚",
                saleCode="xn0002",
                monthIncome=3000,
                checkApprove=u"同意",
            ))

        self.loan_amount = 200000  # 拆分金额
        self.log = Log()

        try:
            import config
            rootdir = config.__path__[0]
            config_env = os.path.join(rootdir, 'env.json')
            # print("config_env:" + config_env)
            with open(config_env, 'r') as f:
                self.da = json.load(f)
                self.number = self.da["number"]
                self.env = self.da["enviroment"]

            filename = "data_gqt.json"
            data, company = enviroment_change(filename, self.number, self.env)
            # 录入的源数据
            self.data = data
            # 分公司选择
            self.company = company
        except Exception as e:
            print('load config error:', str(e))
            raise

    def tearDown(self):
        self.page.quit()

    '''
		  过桥通案件数据录入
	'''

    def test_gqt_01_base_info(self):
        '''过桥通产品客户基本信息录入'''

        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])
        self.log.info("客户基本信息录入结束")

    def test_gqt_02_input(self):
        '''过桥通产品借款人信息录入'''

        # 1 客户信息-业务基本信息
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        common.input_customer_borrow_info(self.page,
                                          self.cust_info['_borrow_info'])

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

        # 1 客户信息-业务基本信息
        common.input_customer_base_info(self.page,
                                        self.cust_info['_cust_base_info'])

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        common.input_customer_borrow_info(self.page,
                                          self.cust_info['_borrow_info'])

        common.input_cwd_bbi_Property_info(
            self.page, self.data['applyPropertyInfoVo'][0],
            self.data['applyCustCreditInfoVo'][0])

        self.log.info("录入物业信息结束")

    def test_gqt_04_applydata(self):
        '''申请件录入,提交'''

        # 1 客户信息-业务基本信息
        common.input_customer_base_info(self.page, self.data['applyVo'])

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

        # 3 物业信息
        common.input_cwd_bbi_Property_info(
            self.page, self.data['applyPropertyInfoVo'][0],
            self.data['applyCustCreditInfoVo'][0], True, 'gqt')

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

    def test_gqt_05_get_applyCode(self):
        '''申请件查询'''

        self.test_gqt_04_applydata()
        applycode = common.get_applycode(self.page, self.custName)

        if applycode:
            self.log.info("申请件查询完成")
            self.applyCode = applycode
            return applycode, True
        else:
            return None, False

    def test_gqt_06_show_task(self):
        '''查看待处理任务列表'''

        result = self.test_gqt_05_get_applyCode()[0]
        next_id = common.process_monitor(self.page, self.applyCode)
        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 = common.query_task(page, self.applyCode)
        if res:
            self.log.info("查询待处理任务成功")
            return True
        else:
            return False

    def test_gqt_07_process_monitor(self):
        '''流程监控'''

        result = self.test_gqt_05_get_applyCode()  # 申请件查询
        res = common.process_monitor(self.page, result[0])  # l流程监控

        if not res:
            self.log.error("流程监控查询失败")
            raise
        else:
            self.page.user_info['auth']["username"] = res  # 更新下一个登录人
            print self.page.user_info['auth']["username"]
            self.next_user_id = res
            self.log.info("完成流程监控查询")
            return res, result[0]  # (下一个处理人ID, 申请件ID)

    def test_gqt_08_branch_supervisor_approval(self):
        '''分公司主管审批'''

        # 获取分公司登录ID
        res = self.test_gqt_07_process_monitor()
        print "userId:" + res[0]

        # 下一个处理人重新登录
        page = Login(res[0])

        # 审批审核
        res = common.approval_to_review(page, res[1], u'分公司主管同意审批')
        if not res:
            self.log.error("can't find applycode")
            raise ValueError("can't find applycode")

        # 查看下一步处理人
        next_id = common.process_monitor(page, self.applyCode)
        if not res:
            self.log.error("流程监控查询失败")
            raise
        else:
            self.next_user_id = next_id
            self.log.info("风控审批-分公司主管审批结束")
            # 当前用户退出系统
            self.page.driver.quit()
            return next_id  # 下一步处理人ID

    def test_gqt_09_branch_manager_approval(self):
        '''分公司经理审批'''

        # 获取分公司经理登录ID
        next_id = self.test_gqt_08_branch_supervisor_approval()

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

        # 审批审核
        res = common.approval_to_review(page, self.applyCode, u'分公司经理同意审批')
        if not res:
            self.log.error("can't find applycode")
            raise ValueError("can't find applycode")

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            return False
        else:
            self.next_user_id = res
            self.log.info("风控审批-分公司经理审批结束")
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_10_regional_prereview(self):
        '''区域预复核审批'''

        # 获取区域预复核员ID
        next_id = self.test_gqt_09_branch_manager_approval()

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

        # 审批审核
        res = common.approval_to_review(page, self.applyCode, u'区域预复核通过')
        if not res:
            raise ValueError("can't find applycode")

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            return False
        else:
            self.next_user_id = res
            self.log.info("区域预复核审批结束")
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_11_manager_approval(self):
        '''审批经理审批'''

        # 获取审批经理ID
        next_id = self.test_gqt_10_regional_prereview()

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

        # 审批审核
        res = common.approval_to_review(page, self.applyCode, u'审批经理审批')
        if not res:
            self.log.error("can't find applycode")
            raise ValueError("can't find applycode")

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            return False
        else:
            self.next_user_id = res
            self.log.info("风控审批-审批经理审批结束")
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_12_contract_signing(self):
        '''签约'''

        i_frame = 'bTabs_tab_house_commonIndex_todoList'

        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'],
        )

        # 扣款银行信息
        rep_bank_info = dict(
            rep_name=u'习近平',
            rep_id_num='420101198201013526',
            rep_bank_code='6210302082441017886',
            rep_phone='13686467482',
            provice=u'湖南省',
            district=u'长沙',
            rep_bank_name=u'中国银行',
            rep_bank_branch_name=u'北京支行',
        )

        # 获取合同打印专员ID
        next_id = self.test_gqt_11_manager_approval()

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

        # 签约
        common.make_signing(page, self.applyCode, rec_bank_info)

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            return False
        else:
            self.next_user_id = res
            self.log.info("合同打印完成")
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_13_compliance_audit(self):
        '''合规审查'''

        # 获取下一步合同登录ID
        next_id = self.test_gqt_12_contract_signing()

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

        # 合规审查
        res = common.compliance_audit(page, self.applyCode)
        if res:
            self.log.info("合规审批结束")
        else:
            self.log.error("合规审查失败")

    def test_gqt_14_authority_card_member_transact(self):
        '''权证办理'''

        # print  u"申请编号:" + self.applyCode
        # 合规审查
        self.test_gqt_13_compliance_audit()
        # 权证员登录
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        common.authority_card_transact(page, self.applyCode)
        # common.authority_card_transact(page, "GZ20171213C06")
        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            self.log.error("上传权证资料失败")
            raise
        else:
            self.log.info("权证办理完成")
            self.next_user_id = res
            # 当前用户退出系统
            page.driver.quit()
            self.page.driver.quit()
            return res

    def test_gqt_15_warrant_apply(self):
        '''权证请款-原件请款'''

        # 获取合同打印专员ID
        next_id = self.test_gqt_14_authority_card_member_transact()
        page = Login(next_id)
        # 权证请款
        res = common.warrant_apply(page, self.applyCode)
        if not res:
            self.log.error("权证请款失败!")
            raise
        else:
            self.log.info("完成权证请款")
        # page = Login('xn052298')
        # common.warrant_apply(page, "CS20171214X07")
        self.page.driver.quit()

    def test_gqt_16_finace_transact(self):
        '''财务办理'''

        # 权证请款
        self.test_gqt_15_warrant_apply()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        common.finace_transact(page, self.applyCode)
        self.log.info("完成财务办理")
        # page = Login('xn052298')
        # common.finace_transact(page, 'CS20171215C02')

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode, 1)
        if not res:
            return False
        else:
            self.next_user_id = res
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_17_finace_approve_branch_manager(self):
        '''财务分公司经理审批'''

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

        # 下一个处理人
        self.test_gqt_16_finace_transact()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)

        if not result:
            return False
        else:
            # page = Login('xn028154')
            # common.finace_approve(page, "CS20171215X14", remark)
            self.log.info("财务流程-分公司经理审批结束")
            # 查看下一步处理人
            res = common.process_monitor(page, self.applyCode, 1)
            if not res:
                return False
            else:
                self.next_user_id = res
                print("nextId:" + res)
                # 当前用户退出系统
                page.driver.quit()
                self.page.driver.quit()
                return res

    def test_gqt_18_finace_approve_risk_control_manager(self):
        '''财务风控经理审批'''

        remark = u'风控经理审批'

        self.test_gqt_17_finace_approve_branch_manager()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)
        if result:
            self.log.info("财务流程-风控经理审批结束")
        else:
            self.log.error("Error: 风控经理审批出错!")
            raise
        # page = Login('xn003625')
        # common.finace_approve(page, "CS20171215X14", remark)
        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode, 1)
        if not res:
            return False
        else:
            self.next_user_id = res
            print("nextId:" + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_19_funds_appprove(self):
        '''资金主管审批'''

        remark = u'资金主管审批'
        self.test_gqt_18_finace_approve_risk_control_manager()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)
        if result:
            self.log.info("财务流程-资金主管审批结束")
        else:
            self.log.error("Error-资金主管审批报错!")
            raise
        # page = Login('xn037166')
        # common.finace_approve(page, "CS20171215X09", remark)

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode, 1)
        if not res:
            return False
        else:
            self.next_user_id = res
            print("nextId:" + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_20_finace_approve_financial_accounting(self):
        '''财务会计审批'''

        remark = u'财务会计审批'

        self.test_gqt_19_funds_appprove()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)
        if result:
            self.log.info("财务流程-财务会计审批结束")
        else:
            self.log.error("Error-财务会计审批报错!")
            raise
        # page = Login('xn037166')
        # common.finace_approve(page, "CS20171215X09", remark)

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode, 1)
        if not res:
            return False
        else:
            self.next_user_id = res
            print("nextId:" + self.next_user_id)
            # 当前用户退出系统
            self.page.driver.quit()
            return res

    def test_gqt_21_finace_approve_financial_manager(self):
        '''财务经理审批'''

        remark = u'财务经理审批'

        self.test_gqt_20_finace_approve_financial_accounting()
        page = Login(self.next_user_id)
        res = common.finace_approve(page, self.applyCode, remark)
        if res:
            self.log.info("财务流程-财务经理审批结束")
        else:
            self.log.error("Error-财务经理审批出错!")
            raise

    def test_gqt_22_funds_raise(self):
        '''资金主管募资审批'''

        remark = u'资金主管审批'

        self.test_gqt_21_finace_approve_financial_manager()
        page = Login('xn0007533')
        res = common.funds_raise(page, self.applyCode, remark)
        if res:
            self.log.info("募资流程-资金主管审批结束")
            self.page.driver.quit()
        else:
            self.log.error("Error-募资出错!")
            raise
Beispiel #3
0
class XHD(unittest.TestCase):
	'''循环贷流程用例'''
	
	def _init_params(self):
		self.cust_info = dict(
				_borrow_info=dict(
						custName=getName(),
						idNum="360101199101011054",
						phone="13564789215",
						address=u"湖南长沙",
						companyName=u'小牛普惠管理有限公司',
						postName=u'工程师',
						workDate=u'2011-02-03',  # 入职日期
						workYear=5,  # 工作年限
						monthIncoming=15000  # 月均收入
						),
				_cust_base_info=dict(
						productName=u'循环贷-1.0',  # 贷款产品
						applyAmount=200000,  # 申请金额
						applyPeriod=10,  # 贷款天数
						branchManager=u"小明",
						branchManagerCode="xn111",
						teamGroup=u"A队",
						teamGroupCode="xn0001",
						teamManager=u"小王",
						teamManagerCode="xn0001",
						sale=u"王刚",
						saleCode="xn0002",
						monthIncome=3000,
						checkApprove=u"同意",
						)
				)
		
		self.property_info = dict(
				propertyOwner=self.cust_info['_borrow_info']['custName'],
				propertyNo="ABCDEFG",
				)
	
	def setUp(self):
		self._init_params()
		self.page = Login()
		self.applyCode = ''
		self.log = Log()
		try:
			import config
			rootdir = config.__path__[0]
			config_env = os.path.join(rootdir, 'env.json')
			print("config_env:" + config_env)
			with open(config_env, 'r') as f:
				self.da = json.load(f)
				self.number = self.da["number"]
				self.env = self.da["enviroment"]
			
			filename = "data_cwd.json"
			data, company = enviroment_change(filename, self.number, self.env)
			# 录入的源数据
			self.data = data
			# 分公司选择
			self.company = company
		except Exception as e:
			print('load config error:', str(e))
			raise
	
	def tearDown(self):
		self.page.quit()
	
	'''
		  循环贷案件数据录入
	'''
	
	def test_xhd_01_base_info(self):
		'''客户基本信息录入'''
		res = common.input_customer_base_info(self.page, self.cust_info['_cust_base_info'])
		if not res:
			self.log.error("客户基本信息录入出错!")
			raise
		else:
			self.log.info("客户基本信息录入完成!")
	
	def test_xhd_02_borrowr_info(self):
		'''借款人/共贷人/担保人信息'''
		common.input_customer_base_info(self.page, self.cust_info['_cust_base_info'])
		common.input_customer_borrow_info(self.page, self.cust_info['_borrow_info'])
	
	def test_xhd_03_Property_info(self):
		'''物业信息录入'''
		common.input_customer_base_info(self.page, self.cust_info['_cust_base_info'])
		common.input_customer_borrow_info(self.page, self.cust_info['_borrow_info'])
		common.input_bbi_Property_info(self.page)
	
	def test_xhd_04_applydata(self):
		'''申请件录入,提交'''
		
		# 1 客户信息-业务基本信息
		# log_to().info(u"客户基本信息录入")
		common.input_customer_base_info(self.page, self.cust_info['_cust_base_info'])
		
		# 2 客户基本信息 - 借款人/共贷人/担保人信息
		# log_to().info(u"借款人/共贷人信息录入")
		self.custName = common.input_customer_borrow_info(self.page, self.cust_info['_borrow_info'])[1]
		
		# 3 物业信息
		# log_to().info(u"物业基本信息录入")
		common.input_bbi_Property_info(self.page)
		
		# 提交
		common.submit(self.page)
	
	def test_xhd_05_get_applyCode(self):
		'''申请件查询'''
		
		self.test_xhd_04_applydata()
		applycode = common.get_applycode(self.page, self.custName)
		if applycode:
			self.log.info("申请件查询完成")
			self.applyCode = applycode
		else:
			self.log.error("Can't get applyCode!")
			raise
	
	def test_xhd_06_show_task(self):
		'''查看待处理任务列表'''
		self.test_xhd_05_get_applyCode()
		next_id = common.process_monitor(self.page, self.applyCode)
		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 = common.query_task(page, self.applyCode)
		if res:
			self.log.info("待处理任务查询ok")
		else:
			self.log.info("待处理任务查询fail")
			raise
	
	def test_xhd_07_process_monitor(self):
		'''流程监控'''
		
		self.test_xhd_05_get_applyCode()  # 申请件查询
		res = common.process_monitor(self.page, self.applyCode)  # l流程监控
		
		if not res:
			raise
		else:
			self.page.user_info['auth']["username"] = res  # 更新下一个登录人
			self.next_user_id = res
			self.log.info("Next Deal User: "******"Can't Get Next User")
			raise
		else:
			self.next_user_id = next_id
			self.log.info("Next Deal User: "******"风控-分公司审批失败")
			raise
		else:
			Log().info("风控-分公司经理完成!")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode)
		if not res:
			Log().error("Can't found the next userId!")
			raise
		else:
			self.next_user_id = res
			Log().info("next User Id is :%s", res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_10_regional_prereview(self):
		'''区域预复核审批'''
		
		# 获取区域预复核员ID
		self.test_xhd_09_branch_manager_approval()
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 审批审核
		rs = common.approval_to_review(page, self.applyCode, u'区域预复核通过')
		if not rs:
			Log().error("风控-区域预复核失败")
			raise
		else:
			Log().info("风控-区域预复核成功!")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode)
		if not res:
			self.log.error("Can't Get next User")
			raise
		else:
			self.next_user_id = res
			self.log.info("Next deal User:"******"风控-高级审批经理审批失败")
			raise
		else:
			Log().info("风控-高级审批经理审批完成")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode)
		if not res:
			Log().error("Can't found Next userId!")
			raise
		else:
			self.next_user_id = res
			Log().info("next_user_id: %s", res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	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'],
				)
		
		# 扣款银行信息
		rep_bank_info = dict(
				rep_name=u'习近平',
				rep_id_num='420101198201013526',
				rep_bank_code='6210302082441017886',
				rep_phone='13686467482',
				provice=u'湖南省',
				district=u'长沙',
				rep_bank_name=u'中国银行',
				rep_bank_branch_name=u'北京支行',
				)
		
		# 获取合同打印专员ID
		self.test_xhd_11_manager_approval()
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 签约
		rs = common.make_signing(page, self.applyCode, rec_bank_info)
		if not rs:
			Log().error("签约失败")
			raise
		else:
			Log().info("签约成功")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode)
		if not res:
			self.log.error("Can't Get Next User")
			raise
		else:
			self.next_user_id = res
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_13_compliance_audit(self):
		'''合规审查'''
		
		# 获取下一步合同登录ID
		self.test_xhd_12_contract_signing()
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 合规审查
		res = common.compliance_audit(page, self.applyCode)
		if not res:
			Log().error("合规审查失败")
			raise
		else:
			Log().info("合规审查成功")
			self.page.driver.quit()
	
	def test_xhd_14_authority_card_member_transact(self):
		'''权证办理'''
		
		# print  u"申请编号:" + self.applyCode
		# 合规审查
		self.test_xhd_13_compliance_audit()
		# 权证员登录
		page = Login(self.company["authority_member"]["user"])
		# 权证员上传权证信息
		res = common.authority_card_transact(page, self.applyCode)
		if not res:
			Log().error("权证员上传资料失败")
			raise
		else:
			Log().info("权证员上传资料成功!")
		# common.authority_card_transact(page, "GZ20171213C06")
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode)
		if not res:
			Log().error("Can't found The next UserId!")
			raise
		else:
			self.next_user_id = res
			Log().info("Next UserId is :%s", res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_15_warrant_apply(self):
		'''权证请款-原件请款'''
		
		# 获取合同打印专员ID
		self.test_xhd_14_authority_card_member_transact()
		page = Login(self.next_user_id)
		# 权证请款
		res = common.warrant_apply(page, self.applyCode)
		if not res:
			Log().error("权证请款失败")
			raise
		else:
			Log().info("权证请款成功")
	
	def test_xhd_16_finace_transact(self):
		'''财务办理'''
		
		# 权证请款
		self.test_xhd_15_warrant_apply()
		# 业务助理登录
		page = Login(self.company["business_assistant"]["user"])
		result = common.finace_transact(page, self.applyCode)
		if not result:
			Log().error("财务办理失败")
			raise
		else:
			Log().info("财务办理成功")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode, 1)
		if not res:
			Log().error("Can't found the next user id")
			raise
		else:
			self.next_user_id = res
			Log().info("Next user Id is: %s", res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_17_finace_approve_branch_manager(self):
		'''财务分公司经理审批'''
		
		remark = u"财务分公司经理审批"
		
		# 下一个处理人
		self.test_xhd_16_finace_transact()
		page = Login(self.next_user_id)
		result = common.finace_approve(page, self.applyCode, remark)
		if not result:
			raise
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode, 1)
		if not res:
			Log().error("Can't found the next user Id")
			raise
		else:
			self.next_user_id = res
			Log().info("Next user Id is: %s", res)
			print("nextId:" + res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_18_finace_approve_risk_control_manager(self):
		'''财务风控经理审批'''
		
		remark = u'风控经理审批'
		
		self.test_xhd_17_finace_approve_branch_manager()
		page = Login(self.next_user_id)
		result = common.finace_approve(page, self.applyCode, remark)
		if not result:
			Log().error("财务-风控经理审批出错")
			raise
		else:
			Log().info("财务-风控经理审批完成")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode, 1)
		if not res:
			Log().error("Can't found the next user id")
			raise
		else:
			self.next_user_id = res
			Log().info("nextId: %s", res)
			print("nextId:" + self.next_user_id)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_19_finace_approve_financial_accounting(self):
		'''财务会计审批'''
		
		remark = u'财务会计审批'
		
		self.test_xhd_18_finace_approve_risk_control_manager()
		page = Login(self.next_user_id)
		result = common.finace_approve(page, self.applyCode, remark)
		if not result:
			Log().error("财务-财务会计审批出错!")
			raise
		else:
			Log().info("财务-财务会计审批完成!")
		
		# 查看下一步处理人
		res = common.process_monitor(page, self.applyCode, 1)
		if not res:
			Log().error("can't found The next user Id!")
			raise
		else:
			self.next_user_id = res
			print("nextId:" + self.next_user_id)
			Log().info("nextId :%s", res)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def test_xhd_20_finace_approve_financial_manager(self):
		'''财务经理审批'''
		
		remark = u'财务经理审批'
		
		self.test_xhd_19_finace_approve_financial_accounting()
		page = Login(self.next_user_id)
		res = common.finace_approve(page, self.applyCode, remark)
		if not res:
			Log().error("财务-财务经理审批出错!")
			raise
		else:
			Log().info("财务-财务经理审批完成!")
			self.page.driver.quit()
	
	def test_xhd_21_funds_raise(self):
		'''资金主管募资审批'''
		
		remark = u'资金主管审批'
		
		self.test_xhd_20_finace_approve_financial_manager()
		page = Login('xn0007533')
		res = common.funds_raise(page, self.applyCode, remark)
		if not res:
			Log().error("募资-资金主管审批出错!")
			raise
		else:
			Log().info("募资-资金主管审批完成!")
			self.page.driver.quit()
Beispiel #4
0
class CWD(unittest.TestCase):
    '''车位贷流程用例'''
    def setUp(self):
        self.page = Login()
        self.applyCode = ''
        self.next_user_id = ""
        local_dir = os.getcwd()
        print("local_dir: %s " % local_dir)
        self.log = custom.Log()
        # 环境初始化
        # self._enviroment_change(0)
        try:
            import config
            rootdir = config.__path__[0]
            config_env = os.path.join(rootdir, 'env.json')
            print("config_env:" + config_env)
            with open(config_env, 'r') as f:
                self.da = json.load(f)
                self.number = self.da["number"]
                self.env = self.da["enviroment"]

            filename = "data_cwd.json"
            data, company = custom.enviroment_change(filename, self.number,
                                                     self.env)
            # 录入的源数据
            self.data = data
            # 分公司选择
            self.company = company
        except Exception as e:
            print('load config error:', str(e))
            raise

    def _enviroment_change(self, i):
        '''
			环境切换
		:param i:   分公司序号  "0" 广州, "1" 长沙
		:return:
		'''
        # 导入数据
        import config
        rd = config.__path__[0]
        config_env = os.path.join(rd, 'env.json')
        data_config = os.path.join(rd, "data_cwd.json")
        with open(data_config, 'r') as f:
            self.data = json.load(f)
            print(self.data['applyVo']['productName'])

        # 环境变量, 切换分公司
        with open(config_env, 'r') as f1:
            self.env = json.load(f1)
            self.company = self.env["SIT"]["company"][i]

    def tearDown(self):
        self.page.quit()

    def skipTest(self, reason):
        pass

    def test_cwd_01_base_info(self):
        '''客户基本信息录入'''

        common.input_customer_base_info(self.page, self.data['applyVo'])
        self.log.info("客户基本信息录入结束")

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

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

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

        self.test_cwd_02_borrowr_info()

        data1 = self.data['applyPropertyInfoVo'][0]
        data2 = self.data['applyCustCreditInfoVo'][0]

        res = common.input_cwd_bbi_Property_info(self.page, data1, data2, True)
        if res:
            self.log.info("录入物业信息结束")
        else:
            raise

    def test_cwd_04_applydata(self):
        '''申请件录入,提交'''

        # 1 客户信息-业务基本信息
        # log_to().info(u"客户基本信息录入")
        common.input_customer_base_info(self.page, self.data['applyVo'])

        # 2 客户基本信息 - 借款人/共贷人/担保人信息
        # log_to().info(u"借款人/共贷人信息录入")
        self.custName = common.input_customer_borrow_info(
            self.page, self.data['custInfoVo'][0])[1]

        # 3 物业信息
        # log_to().info(u"物业基本信息录入")
        common.input_cwd_bbi_Property_info(
            self.page, self.data['applyPropertyInfoVo'][0],
            self.data['applyCustCreditInfoVo'][0], True)

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

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

        self.test_cwd_04_applydata()
        applycode = common.get_applycode(self.page, self.custName)

        if applycode:
            self.log.info("申请件查询完成")
            self.applyCode = applycode
        else:
            raise ValueError("申请件查询失败")

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

        self.test_cwd_05_get_applyCode()
        next_id = common.process_monitor(self.page, self.applyCode)
        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 = common.query_task(page, self.applyCode)
        if res:
            self.log.info("查询待处理任务成功")
        else:
            self.log.error("查询待处理任务失败!")
            raise

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

        self.test_cwd_05_get_applyCode()  # 申请件查询
        res = common.process_monitor(self.page, self.applyCode)  # l流程监控

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

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

        # 获取分公司登录ID
        self.test_cwd_07_process_monitor()

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

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

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

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

        # 获取分公司经理登录ID
        self.test_cwd_08_branch_supervisor_approval()

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

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

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

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

        # 获取区域预复核员ID
        self.test_cwd_09_branch_manager_approval()

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

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

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

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

        # 获取审批经理ID
        self.test_cwd_10_regional_prereview()

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

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

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            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'],
        )

        # 扣款银行信息
        rep_bank_info = dict(
            rep_name=u'习近平',
            rep_id_num='420101198201013526',
            rep_bank_code='6210302082441017886',
            rep_phone='13686467482',
            provice=u'湖南省',
            district=u'长沙',
            rep_bank_name=u'中国银行',
            rep_bank_branch_name=u'北京支行',
        )

        # 获取合同打印专员ID
        self.test_cwd_11_manager_approval()

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

        # 签约
        common.make_signing(page, self.applyCode, rec_bank_info)

        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            self.log.error("Can't found next User!")
        else:
            self.next_user_id = res
            self.log.info("合同打印完成")
            self.log.info("Next deal User:"******"合规审批结束")
        else:
            self.log.error("合规审查失败")
            raise
        self.page.driver.quit()

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

        # 合规审查
        self.test_cwd_13_compliance_audit()
        # 权证员登录
        page = Login(self.company["authority_member"]["user"])
        # 权证员上传权证信息
        common.authority_card_transact(page, self.applyCode)
        # 查看下一步处理人
        res = common.process_monitor(page, self.applyCode)
        if not res:
            self.log.error("上传权证资料失败")
            raise
        else:
            self.log.info("权证办理完成")
            self.next_user_id = res
            self.log.info("Next deal user:"******"权证请款失败!")
            raise
        else:
            self.log.info("完成权证请款")
            page.driver.quit()
        self.page.driver.quit()

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

        # 权证请款
        self.test_cwd_15_warrant_apply()
        # 业务助理登录
        page = Login(self.company["business_assistant"]["user"])
        common.finace_transact(page, self.applyCode)
        self.log.info("完成财务办理")
        # page = Login('xn052298')
        # common.finace_transact(page, 'CS20171215C02')

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

        # 下一个处理人
        self.test_cwd_16_finace_transact()
        page = Login(self.next_user_id)
        result = common.finace_approve(page, self.applyCode, remark)

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

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

    def test_cwd_19_finace_approve_financial_accounting(self):
        '''财务会计审批'''

        remark = u'财务会计审批'

        self.test_cwd_18_finace_approve_risk_control_manager()
        page = Login(self.next_user_id)
        common.finace_approve(page, self.applyCode, remark)

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

    def test_cwd_20_finace_approve_financial_manager(self):
        '''财务经理审批'''

        remark = u'财务经理审批'

        self.test_cwd_19_finace_approve_financial_accounting()
        page = Login(self.next_user_id)
        res = common.finace_approve(page, self.applyCode, remark)
        if res:
            self.log.info("财务流程-财务经理审批结束")
        else:
            self.log.error("Error: 财务经理审批出错!")
            raise

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

        remark = u'资金主管审批'

        self.test_cwd_20_finace_approve_financial_manager()
        page = Login('xn0007533')
        res = common.funds_raise(page, self.applyCode, remark)
        if res:
            self.log.info("募资流程-资金主管审批结束")
            self.page.driver.quit()
        else:
            self.log.error("Error: 募资流程出错!")
            raise