Пример #1
0
def approve_inside_by_role(driver, loanno, screenshot_path, casename):
    u"""审批内部审批流程"""
    expect_result = "结束"
    process_type = "内部审批"
    view = "OK"
    print("开始审批内审流程")
    print("使用的贷款单号是:" + loanno)
    from com.ea.pages.todo_page import TodoPage, ApproveInsidePage
    # 进入待办查询页面
    try:
        todopage = TodoPage(driver)
        approveinsidepage = ApproveInsidePage(driver)
        while tools.get_approver_acount_by_yewuno(loanno, process_type):
            approver_account = tools.get_approver_acount_by_yewuno(loanno, process_type)
            login.login(driver, username=approver_account)
            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)
            approveinsidepage.scroll_to_approve_view()
            approveinsidepage.input_approve_view(view)
            approveinsidepage.click_tongguo_button()
            approveinsidepage.click_confirm_button()
            driver.delete_all_cookies()
        # 切换到内部审批页面
        login.login(driver)
        menu.go_to_inside_approve(driver)
        # time.sleep(5)
        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 test_b_zhengxin_approve(self):
     u"""审批征信"""
     casename = sys._getframe().f_code.co_name
     try:
         process_type = "新征信查询"
         approver_account = tools.get_approver_acount_by_yewuno(self.zhengxindanhao, process_type)
         login.login(self.driver, username=approver_account)
         self.newzhengxin.zhengxin_approve_by_role(self.zhengxindanhao, process_type)
     except Exception as e:
         tools.get_screenshot(self.driver, self.screenshot_path, casename)
         raise e
Пример #3
0
def loan_by_role_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:
        approver_account = tools.get_approver_acount_by_yewuno(loanno, process_type)
        login.login(driver, username=approver_account)
        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 test_e_caiwu_approve(self):
     u"""财务审批"""
     casename = sys._getframe().f_code.co_name
     view = "OK"
     except_result = "审批完成"
     process_type = "平台财务"
     # self.loanno = "D200-BK-1801-00002"
     print("财务审批开始")
     print("使用的贷款单号是:" + self.loanno)
     from com.ea.pages.todo_page import TodoPage, ApproveCaiwuPage
     try:
         approver_account = tools.get_approver_acount_by_yewuno(
             self.loanno, process_type)
         login.login(self.driver, username=approver_account)
         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(5)
         menu.go_to_yiban_query(self.driver)
         actual_result = approvecaiwupage.get_result_by_role(self.loanno)
         self.assertEqual(actual_result, except_result)
         print("财务审批结束")
     except Exception as e:
         tools.get_screenshot(self.driver, self.screenshot_path, casename)
         raise e
Пример #5
0
def loan_clear_approve_by_role(driver, loanno, screenshot_path, casename):
    u"""审批贷款结清流程"""
    process_type = "提前还款"
    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)
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        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(process_type)
        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
Пример #6
0
def charge_approve_by_role(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:
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        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()
        driver.delete_all_cookies()
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        # 进入待办查询页面
        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_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
Пример #7
0
def interview_approve_by_role(driver, loanno, fullname, screenshot_path,
                              casename):
    u"""面签审批"""
    expect_result = "已放款"
    process_type = "面签提报"
    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
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        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(process_type)
        approveinterviepage.scroll_to_approve_view()
        approveinterviepage.input_approve_view(approve_view)
        approveinterviepage.click_tongguo()
        approveinterviepage.click_confirm()
        driver.delete_all_cookies()
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        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)
        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()
        driver.delete_all_cookies()
        approver_account = tools.get_approver_acount_by_yewuno(
            loanno, process_type)
        login.login(driver, username=approver_account)
        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)
        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()
        driver.delete_all_cookies()
        login.login(driver)
        menu.go_to_loan_query(driver)
        # time.sleep(5)
        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