Example #1
0
	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:" + self.next_user_id)
			# 当前用户退出系统
			self.page.driver.quit()
Example #2
0
	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()
Example #3
0
    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
Example #4
0
	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()
Example #5
0
	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()
Example #6
0
    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()
Example #7
0
	def test_xhd_11_manager_approval(self):
		'''高级审批经理审批'''
		
		# 获取审批经理ID
		self.test_xhd_10_regional_prereview()
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 审批审核
		result = common.approval_to_review(page, self.applyCode, u'高级审批经理审批')
		if not result:
			Log().error("风控-高级审批经理审批失败")
			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()
Example #8
0
    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()
Example #9
0
	def test_xhd_09_branch_manager_approval(self):
		'''分公司经理审批'''
		
		# 获取分公司经理登录ID
		self.test_xhd_08_branch_supervisor_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 found the next userId!")
			raise
		else:
			self.next_user_id = res
			Log().info("next User Id is :%s", res)
			# 当前用户退出系统
			self.page.driver.quit()
Example #10
0
    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()
Example #11
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
Example #12
0
    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
Example #13
0
    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()
Example #14
0
    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()
Example #15
0
	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()
Example #16
0
	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()
Example #17
0
    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()
Example #18
0
    def setUp(self):
        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.page = Login()
            self.log = Log()

            self.evt = dict(data=data, company=company)
        except Exception as e:
            print('load config error:', str(e))
            raise
Example #19
0
	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()
Example #20
0
    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()
Example #21
0
    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()
Example #22
0
	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()
Example #23
0
    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()
class contractSign(unittest.TestCase):
	'''合同签约'''
	
	def setUp(self):
		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.page = Login()
			self.log = Log()
			
			# 录入的源数据
			self.data = data
			# 分公司选择
			self.company = company
		except Exception as e:
			self.log.error('load config error:', str(e))
			raise
	
	def get_next_user(self, page, applyCode):
		next_id = common.process_monitor(page, applyCode)
		if next_id is None:
			self.log.error("没有找到下一步处理人!")
			raise
		else:
			self.next_user_id = next_id
			self.log.info("下一步处理人:" + next_id)
			# 当前用户退出系统
			self.page.driver.quit()
	
	def tearDown(self):
		pass
	
	def test_one_person_sign(self):
		'''单人签约'''
		
		# ---------------------------------------------------------------------------------
		#                   1. 申请录入
		# ---------------------------------------------------------------------------------
		
		# 1 客户信息-业务基本信息
		if common.input_customer_base_info(self.page, self.data['applyVo']):
			self.log.info("录入基本信息完成")
		
		# 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])
		# 提交
		common.submit(self.page)
		self.log.info("申请件录入完成提交")
		
		applyCode = common.get_applycode(self.page, self.custName)
		if applyCode:
			self.applyCode = applyCode
			self.log.info("申请件查询完成")
			print("applyCode:" + self.applyCode)
		# 流程监控
		result = common.process_monitor(self.page, applyCode)
		if result is not None:
			self.next_user_id = result
			self.log.info("完成流程监控查询")
		else:
			self.log.error("流程监控查询出错!")
			raise
		
		# ---------------------------------------------------------------------------------------
		# 	                        2. 风控审批流程
		# ---------------------------------------------------------------------------------------
		
		# 下一个处理人重新登录
		page = Login(result)
		
		# 分公司主管审批
		res = common.approval_to_review(page, applyCode, u'分公司主管审批通过', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司主管审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 分公司经理审批
		res = common.approval_to_review(page, applyCode, u'分公司经理回退到申请录入', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司经理审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 区域预复核审批
		res = common.approval_to_review(page, applyCode, u'区域预复核审批通过', 0)
		if not res:
			self.log.error("区域预复核审批失败!")
			raise
		else:
			self.log.info("区域预复核审批通过")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 审批经理审批通过
		res = common.approval_to_review(page, applyCode, u'审批经理审批通过', 0)
		if not res:
			self.log.error("审批经理审批失败!")
			raise
		else:
			self.log.info("审批经理审批通过成功!")
			self.get_next_user(page, applyCode)
		
		# -----------------------------------------------------------------------------
		# 	                        3. 合同打印
		# -----------------------------------------------------------------------------
		
		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'北京支行',
				)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 签约
		common.make_signing(page, self.applyCode, rec_bank_info)
		self.log.info("签约完成")
		# 查看下一步处理人
		self.get_next_user(page, applyCode)
	
	def test_two_person_sign(self):
		'''两人签约'''
		
		# ---------------------------------------------------------------------------------
		#                   1. 申请录入
		# ---------------------------------------------------------------------------------
		
		self.data['applyVo']['applyAmount'] = 400000
		# 1 客户信息-业务基本信息
		if common.input_customer_base_info(self.page, self.data['applyVo']):
			self.log.info("录入基本信息完成")
		
		# 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])
		# 提交
		common.submit(self.page)
		self.log.info("申请件录入完成提交")
		
		applyCode = common.get_applycode(self.page, self.custName)
		if applyCode:
			self.applyCode = applyCode
			self.log.info("申请件查询完成")
			print("applyCode:" + self.applyCode)
		# 流程监控
		result = common.process_monitor(self.page, applyCode)
		if result is not None:
			self.next_user_id = result
			self.log.info("完成流程监控查询")
		else:
			self.log.error("流程监控查询出错!")
			raise
		
		# ---------------------------------------------------------------------------------------
		# 	                        2. 风控审批流程
		# ---------------------------------------------------------------------------------------
		
		# 下一个处理人重新登录
		page = Login(result)
		
		# 分公司主管审批
		res = common.approval_to_review(page, applyCode, u'分公司主管审批通过', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司主管审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 分公司经理审批
		res = common.approval_to_review(page, applyCode, u'分公司经理审批通过', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司经理审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 区域预复核审批
		res = common.approval_to_review(page, applyCode, u'区域预复核审批通过', 0)
		if not res:
			self.log.error("区域预复核审批失败!")
			raise
		else:
			self.log.info("区域经理审批通过")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 审批经理审批通过
		res = common.approval_to_review(page, applyCode, u'审批经理审批通过', 0)
		if not res:
			self.log.error("审批经理审批失败!")
			raise
		else:
			self.log.info("审批经理审批通过成功!")
			self.get_next_user(page, applyCode)
		
		# -----------------------------------------------------------------------------
		# 	                        3. 合同打印
		# -----------------------------------------------------------------------------
		
		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'北京支行',
				)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 两个人签约
		common.make_signing(page, self.applyCode, rec_bank_info, 2)
		self.log.info("合同打印完成!")
		# 查看下一步处理人
		self.get_next_user(page, applyCode)
	
	def test_03_three_person_sign(self):
		'''三人签约'''
		
		# ---------------------------------------------------------------------------------
		#                   1. 申请录入
		# ---------------------------------------------------------------------------------
		
		self.data['applyVo']['applyAmount'] = 600000
		# 1 客户信息-业务基本信息
		if common.input_customer_base_info(self.page, self.data['applyVo']):
			self.log.info("录入基本信息完成")
		
		# 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])
		# 提交
		common.submit(self.page)
		self.log.info("申请件录入完成提交")
		
		applyCode = common.get_applycode(self.page, self.custName)
		if applyCode:
			self.applyCode = applyCode
			self.log.info("申请件查询完成")
			print("applyCode:" + self.applyCode)
		# 流程监控
		result = common.process_monitor(self.page, applyCode)
		if result is not None:
			self.next_user_id = result
			self.log.info("完成流程监控查询")
		else:
			self.log.error("流程监控查询出错!")
			raise
		
		# ---------------------------------------------------------------------------------------
		# 	                        2. 风控审批流程
		# ---------------------------------------------------------------------------------------
		
		# 下一个处理人重新登录
		page = Login(result)
		
		# 分公司主管审批
		res = common.approval_to_review(page, applyCode, u'分公司主管审批通过', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司主管审批通过")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 分公司经理审批
		res = common.approval_to_review(page, applyCode, u'分公司经理审批通过', 0)
		if not res:
			self.log.error("审批失败")
			raise
		else:
			self.log.info("分公司经理审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 区域预复核审批
		res = common.approval_to_review(page, applyCode, u'区域预复核审批通过', 0)
		if not res:
			self.log.error("区域预复核审批失败!")
			raise
		else:
			self.log.info("区域经理审批通过!")
			self.get_next_user(page, applyCode)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 审批经理审批通过
		res = common.approval_to_review(page, applyCode, u'审批经理审批通过', 0)
		if not res:
			self.log.error("审批经理审批失败!")
			raise
		else:
			self.log.info("高级审批经理审批成功!")
			self.get_next_user(page, applyCode)
		
		# -----------------------------------------------------------------------------
		# 	                        3. 合同打印
		# -----------------------------------------------------------------------------
		
		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'北京支行',
				)
		
		# 下一个处理人重新登录
		page = Login(self.next_user_id)
		
		# 两个人签约
		common.make_signing(page, self.applyCode, rec_bank_info, 3)
		self.log.info("合同打印完成")
		# 查看下一步处理人
		self.get_next_user(page, applyCode)
class SPA(unittest.TestCase):
    '''特批'''
    def setUp(self):
        self.log = Log()
        try:
            import config
            rootdir = config.__path__[0]
            config_env = os.path.join(rootdir, 'env.json')
            self.log.info("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_eyt.json"
            data, company = enviroment_change(filename, self.number, self.env)
            self.page = Login()

            # 录入的源数据
            self.data = data
            # 分公司选择
            self.company = company
        except Exception as e:
            self.log.error('load config error:', str(e))
            raise

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

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

    def test_01_region_special_approval(self):
        '''区域李伟波特批'''
        '''
			---------------------------------------------------------------------
									1. 申请基本信息录入
			---------------------------------------------------------------------
		'''
        # 1 客户信息-业务基本信息
        if common.input_customer_base_info(self.page, self.data['applyVo']):
            self.log.info("录入基本信息完成")

        # 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])
        # 提交
        common.submit(self.page)
        self.log.info("申请件录入完成提交")
        self.log.info("主借人:" + self.custName)
        applyCode = common.get_applycode(self.page, self.custName)

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

        # 流程监控
        result = common.process_monitor(self.page, applyCode)
        if result is not None:
            self.next_user_id = result
            self.log.info("完成流程监控查询")
            self.page.driver.quit()
        else:
            self.log.error("流程监控查询出错!")
            raise
        '''
			------------------------------------------------------------
								2. 风控审批-区域特批
			------------------------------------------------------------
		'''
        # 下一个处理人重新登录
        page = Login(result)

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

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

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

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

        if self.next_user_id != 'xn004754':
            # 区域特批
            res = common.approval_to_review(page, applyCode, u'区域审批经理审批', 0)
            if not res:
                self.log.error("区域审批经理审批失败")
                raise
            else:
                self.log.info(u'区域审批经理审批成功!')
                self.get_next_user(page, applyCode)
        else:
            r = common.special_approval(page, self.applyCode, u'区域特批')
            if not r:
                self.log.error('区域特批出错!')
                raise
            else:
                self.log.info('区域特批通过!')
                page.driver.quit()

    def test_02_manage_special_approval(self):
        '''高级经理特批'''

        self.test_01_region_special_approval()

        page = Login(self.next_user_id)
        r = common.special_approval(page, self.applyCode, u'高级经理特批')
        if not r:
            self.log.error('高级经理特批出错!')
            raise
        else:
            self.log.info('高级经理特批通过!')
            self.get_next_user(page, self.applyCode)
            page.driver.quit()

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

        self.test_02_manage_special_approval()

        page = Login(self.next_user_id)
        r = common.special_approval(page, self.applyCode, u'风控总监特批')
        # r = common.approval_to_review(page, self.applyCode, u'区域审批经理审批', 0)
        if not r:
            self.log.error('风控总监特批出错!')
            raise
        else:
            self.log.info('风控总监特批通过!')
            self.get_next_user(page, self.applyCode)
            page.driver.quit()
Example #26
0
class warrantManage(unittest.TestCase):
    def setUp(self):
        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.page = Login()
            self.log = Log()

            # 录入的源数据
            self.data = data
            # 分公司选择
            self.company = company
        except Exception as e:
            self.log.error('load config error:', str(e))
            raise

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

    def tearDown(self):
        pass

    def test_warrantManage_original(self):
        '''原件请款'''
        '''
			1. 申请录入
		'''
        # 1 客户信息-业务基本信息
        if common.input_customer_base_info(self.page, self.data['applyVo']):
            self.log.info("录入基本信息完成")

        # 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])
        # 提交
        common.submit(self.page)
        self.log.info("申请件录入完成提交")

        applyCode = common.get_applycode(self.page, self.custName)
        if applyCode:
            self.applyCode = applyCode
            self.log.info("申请件查询完成")
            print("applyCode:" + self.applyCode)
        # 流程监控
        result = common.process_monitor(self.page, applyCode)
        if result is not None:
            self.next_user_id = result
            self.log.info("完成流程监控查询")
        else:
            self.log.error("流程监控查询出错!")
            raise
        '''
			2. 风控审批流程
		'''

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

        # 分公司主管审批
        res = common.approval_to_review(page, applyCode, u'分公司主管审批通过', 0)
        if not res:
            self.log.error("审批失败")
            raise

        self.get_next_user(page, applyCode, u'分公司主管审批通过!')

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

        # 分公司经理审批
        res = common.approval_to_review(page, applyCode, u'分公司经理回退到申请录入', 0)
        if not res:
            self.log.error("审批失败")
            raise

        self.get_next_user(page, applyCode, u'分公司经理审批通过!')

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

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

        self.get_next_user(page, applyCode, u'区域预复核审批通过!')

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

        # 审批经理审批通过
        res = common.approval_to_review(page, applyCode, u'审批经理审批通过', 0)
        if not res:
            self.log.error("审批经理审批失败!")
            raise

        self.get_next_user(page, applyCode, u'审批经理审批成功!')
        '''
			3. 合同打印
		'''
        # 下一个处理人重新登录
        page = Login(self.next_user_id)
Example #27
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
Example #28
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()
Example #29
0
class IntoCase(unittest.TestCase):
    '''进件场景'''
    def setUp(self):
        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.page = Login()
            self.log = Log()

            self.evt = dict(data=data, company=company)
        except Exception as e:
            print('load config error:', str(e))
            raise

    def tearDown(self):
        pass

    def test_01_one_borrower(self):
        '''单借款人'''

        name = custom.get_current_function_name()
        print("当前用例编号:" + name)
        # 录入一个借款人

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

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

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

        # 提交
        common.submit(self.page)
        self.countTestCases()

    def test_02_two_borrower(self, n=2):
        # 录入两个借款人
        self.skipTest("xxxxx")
        # n = 2
        common.input_customer_base_info(self.page, self.evt['data']['applyVo'])

        if n == 1:
            # common.input_customer_borrow_info(self.page, self.evt['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:
            common.input_customer_borrow_info(
                self.page, self.evt['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()

    # 提交
    # self.page.driver.find_element_by_id('apply_module_apply_submit').click()

    def test_03_two_borrower(self):
        '''录入两个借款人'''

        name = custom.get_current_function_name()
        print("当前用例编号:" + name)
        # 录入基本信息
        common.input_customer_base_info(self.page, self.evt['data']['applyVo'])
        # 录入借款人/共贷人信息
        common.input_customer_borrow_info(self.page,
                                          self.evt['data']['custInfoVo'][0])
        common.input_more_borrower(self.page)
        # 录入业务基本信息
        common.input_cwd_bbi_Property_info(
            self.page, self.evt['data']['applyPropertyInfoVo'][0],
            self.evt['data']['applyCustCreditInfoVo'][0])

        # 提交
        common.submit(self.page)
        self.page.driver.quit()

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

        data, _ = custom.enviroment_change("data_gqt.json", self.number,
                                           self.env)

        self.evt['data'].update(data)
        # self.page = Login()

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

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

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

        # 提交
        common.submit(self.page)
        self.log.info("申请件录入完成提交")
Example #30
0
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()