def test_e_caiwu_approve(self): u"""财务审批""" casename = sys._getframe().f_code.co_name view = "OK" except_result = "流程结束" process_type = "平台财务" # self.loanno = "SK0027-BK-1712-00009" print("财务审批开始") print("使用的贷款单号是:" + self.loanno) from com.ea.pages.todo_page import TodoPage, ApproveCaiwuPage try: todopage = TodoPage(self.driver) approvecaiwupage = ApproveCaiwuPage(self.driver) # 进入待办查询页面 menu.go_to_wait_todo_query(self.driver) todopage.input_yewuno(self.loanno) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(process_type) # 拖动页面到最下面 approvecaiwupage.scroll_to_special_condition() approvecaiwupage.input_special_condition(view) approvecaiwupage.click_save_button() approvecaiwupage.click_confirm_button() approvecaiwupage.input_approve_view(view) approvecaiwupage.click_tongguo_button() approvecaiwupage.click_confirm_button() time.sleep(3) menu.go_to_platform_caiwu_approve(self.driver) actual_result = approvecaiwupage.get_result(self.loanno) self.assertEqual(actual_result, except_result) print("财务审批结束") except Exception as e: tools.get_screenshot(self.driver, self.screenshot_path, casename) raise e
def loan_clear_approve(driver, loanno, screenshot_path, casename): u"""审批贷款结清流程""" types = "提前还款" clear_date = "2017-10-10" approve_view = "OK" expect_result = "还款完成" # self.loanno = "SK0027-BP-1801-00002" from com.ea.pages.todo_page import TodoPage, LoanClearApprove try: print("审批贷款结清开始") print("使用的贷款单号是:" + loanno) todopage = TodoPage(driver) loanclearapprovepage = LoanClearApprove(driver) menu.go_to_wait_todo_query(driver) todopage.input_yewuno(loanno) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(types) loanclearapprovepage.scroll_to_clear_date() loanclearapprovepage.input_clear_date(clear_date) loanclearapprovepage.click_save_button() loanclearapprovepage.click_confirm_button() loanclearapprovepage.input_approve_view(approve_view) loanclearapprovepage.click_tongguo_button() loanclearapprovepage.click_confirm_button() time.sleep(5) menu.go_to_loan_query(driver) actual_result = loanclearapprovepage.get_result(loanno) assert actual_result == expect_result print("审批贷款结清结束") except Exception as e: tools.get_screenshot(driver, screenshot_path, casename) raise e
def zhengxin_approve(self): approveview = "OK" process_type = "新征信查询" card_date = "2028-11-11" expect_result = "流程结束" print("审批征信开始") print("审批时的征信账号是:" + self.zhengxindanhao) from com.ea.pages.todo_page import TodoPage, ApproveZhengxinPage todopage = TodoPage(self.driver) approvepage = ApproveZhengxinPage(self.driver) menu.go_to_wait_todo_query(self.driver) todopage.input_yewuno(self.zhengxindanhao) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(process_type) approvepage.page_down() approvepage.input_approve_view(approveview) approvepage.click_approve_button() approvepage.click_confirm_button() time.sleep(3) todopage.click_first_row(process_type) approvepage.page_down() approvepage.upload_file(self.pic_path) approvepage.input_cardno_date(card_date) approvepage.click_save_button() approvepage.click_confirm_button() approvepage.input_approve_view(approveview) approvepage.click_approve_button() approvepage.click_confirm_button() time.sleep(3) menu.go_to_personnel_zhengxin_query(self.driver) actual_result = approvepage.get_result(self.zhengxindanhao) assert actual_result == expect_result print("审批征信结束")
def charge_approve(driver, loanno, fullname, pic_path, screenshot_path, casename): u"""审批收费流程""" expect_result = "流程结束" process_type = "保证金管理费" pay_time = "2017-10-10" approve_view = "OK" daokuan_total = "50000" pay_date = "2017-10-10" # self.loanno = "SK0027-BK-1712-00012" print("审批收费流程开始") print("使用的贷款单号是:" + loanno) try: from com.ea.pages.todo_page import TodoPage, ApproveCharge todopage = TodoPage(driver) approvechaegepage = ApproveCharge(driver) # 进入待办查询页面 menu.go_to_wait_todo_query(driver) todopage.input_yewuno(loanno) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(process_type) approvechaegepage.scroll_to_payer() approvechaegepage.input_payer(fullname) approvechaegepage.input_pay_time(pay_time) approvechaegepage.click_save_button() time.sleep(1) approvechaegepage.scroll_to_approve_view() time.sleep(3) approvechaegepage.input_print_voucher(pic_path) time.sleep(1) approvechaegepage.input_approve_view(approve_view) approvechaegepage.click_tongguo_button() approvechaegepage.click_confirm_button() time.sleep(5) todopage.click_first_row(process_type) approvechaegepage.scroll_to_daokuan_total() time.sleep(1) approvechaegepage.input_daokuan_total(daokuan_total) approvechaegepage.input_pay_date(pay_date) approvechaegepage.select_collect_acount(1) approvechaegepage.click_save_button() approvechaegepage.scroll_to_approve_view() approvechaegepage.input_approve_view(approve_view) approvechaegepage.click_tongguo_button() approvechaegepage.click_confirm_button() time.sleep(5) menu.go_to_charge_query(driver) actual_result = approvechaegepage.get_result(loanno) assert actual_result == expect_result print("审批收费流程结束") except Exception as e: tools.get_screenshot(driver, screenshot_path, casename) raise e
def loan_approve(driver, loanno, screenshot_path, casename): u"""贷款审批""" number = "0" view = "OK" process_type = "征信准入" except_result = "征信准入完成" # self.loanno = "SK0027-BK-1712-00006" print("审批贷款开始") print("使用的贷款单号是:" + loanno) from com.ea.pages.todo_page import TodoPage, ApproveLoanPage try: todopage = TodoPage(driver) approvepage = ApproveLoanPage(driver) # 进入待办查询页面 menu.go_to_wait_todo_query(driver) todopage.input_yewuno(loanno) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(process_type) approvepage.scrollto_edit() approvepage.click_edit() approvepage.input_bank_overdue(number) approvepage.input_credit_overdue(number) approvepage.input_nobank_overdue(number) approvepage.scrollto_save_button() approvepage.click_save_button() time.sleep(2) approvepage.scrollto_approve_view() approvepage.input_approve_view(view) approvepage.click_tongguo() approvepage.click_confirm() time.sleep(3) menu.go_to_loan_query(driver) time.sleep(1) actual_result = approvepage.get_result(loanno) assert actual_result == except_result print("审批贷款结束") except Exception as e: tools.get_screenshot(driver, screenshot_path, casename) raise e
def approve_inside(driver, loanno, screenshot_path, casename, loan_mode): u"""审批内部审批流程""" global y expect_result = "结束" process_type = "内部审批" view = "OK" print("开始审批内审流程") print("使用的贷款单号是:" + loanno) from com.ea.pages.todo_page import TodoPage, ApproveInsidePage todopage = TodoPage(driver) approveinsidepage = ApproveInsidePage(driver) # 进入待办查询页面 try: menu.go_to_wait_todo_query(driver) todopage.input_yewuno(loanno) todopage.click_query_all() todopage.click_search_button() if loan_mode == "共享模式": y = 7 elif loan_mode == "自营模式": y = 6 else: print("输入的模式有误,请确认!!") for i in range(y): todopage.click_first_row(process_type) approveinsidepage.scroll_to_approve_view() approveinsidepage.input_approve_view(view) approveinsidepage.click_tongguo_button() approveinsidepage.click_confirm_button() time.sleep(5) # 切换到内部审批页面 menu.go_to_inside_approve(driver) actual_result = approveinsidepage.get_result(loanno) assert actual_result == expect_result print("审批内审流程结束") except Exception as e: tools.get_screenshot(driver, screenshot_path, casename) raise e
def interview_approve(driver, loanno, fullname, screenshot_path, casename): u"""面签审批""" expect_result = "已放款" types = "面签提报" card_daoqi_date = "2017-10-10" approve_view = "OK" isphonecheck = "是" phonecheckmessage = "OK" isfujianover = "是" file_path = gl.file_path # self.loanno = "SK0027-BP-1801-00002" # self.fullname = "何器" print("面签审批开始") print("使用的贷款单号是:" + loanno) try: from com.ea.pages.todo_page import TodoPage, ApproveInterview todopage = TodoPage(driver) approveinterviepage = ApproveInterview(driver) menu.go_to_wait_todo_query(driver) todopage.input_yewuno(loanno) todopage.click_query_all() todopage.click_search_button() todopage.click_first_row(types) approveinterviepage.scroll_to_approve_view() approveinterviepage.input_approve_view(approve_view) approveinterviepage.click_tongguo() approveinterviepage.click_confirm() time.sleep(5) todopage.click_first_row(types) approveinterviepage.scroll_to_is_phone_check() approveinterviepage.select_is_phone_check(isphonecheck) approveinterviepage.input_phone_check_message(phonecheckmessage) approveinterviepage.click_phone_save_button() time.sleep(1) approveinterviepage.select_is_fujian_over(isfujianover) approveinterviepage.click_fujian_save_button() time.sleep(1) approveinterviepage.scroll_to_approve_view() approveinterviepage.input_approve_view(approve_view) approveinterviepage.click_tongguo() approveinterviepage.click_confirm() time.sleep(5) todopage.click_first_row(types) approveinterviepage.scroll_to_card_date() approveinterviepage.input_card_daoqi_date(card_daoqi_date) approveinterviepage.click_save_bank_loan_data() time.sleep(1) tools.create_huankuanjihua(fullname) approveinterviepage.input_file(file_path) time.sleep(3) approveinterviepage.input_approve_view(approve_view) approveinterviepage.click_tongguo() approveinterviepage.click_confirm() time.sleep(5) menu.go_to_loan_query(driver) actual_result = approveinterviepage.get_result(loanno) assert actual_result == expect_result print("审批面签提报结束") except Exception as e: tools.get_screenshot(driver, screenshot_path, casename) raise e