Ejemplo n.º 1
0
    def test_huankuan(self):
        '''还款'''
        try:
            f = open('../date/huankuan.txt')
            lines = f.readlines()
            for line in lines:
                loanId = line.split(',')[0]
                investmentamount = line.split(',')[1]
                po = LoginPage(self.driver)
                po.open()
                username = '******'
                po.pppiglogin_noclose_Action(username, '111111')
                sleep(2)
                # po.open_R('/backingBorrow')
                po.open_R('/repayDetail?loanId={}'.format(loanId))
                pohuankuan = Huankuan(self.driver)
                pohuankuan.pppighuankuan_Action()
                po1 = To_invest(self.driver)
                po1.pppiginvest_Action4("111111")
                sleep(2)
                poclose = LoginPage(self.driver)
                poclose.pppiglogin_close_button()


        except BaseException as e:
            print(e)
Ejemplo n.º 2
0
 def test_to_invest_success(self):
     '''投资'''
     try:
         # for i in range(1, 10):
         po = LoginPage(self.driver)
         sleep(2)
         po.open()
         username = '******'
         po.pppiglogin_noclose_Action(username, "111111")
         sleep(2)
         po.open_R('/recommendloanDetail?loanId=36210')
         po1 = To_invest(self.driver)
         sleep(2)
         amount = '1000'
         # 使用加息券
         # po1.pppiguse_ratecoupon_Invest_Action(amount)
         # 使用红包
         # po1.pppiguse_Redpacket_Invest_Action(amount)
         # po1.pppiguse_no_Coupon_Invest_Action(amount)
         # 不使用卡券余额全投
         po1.pppiguse_NoRedpacket_Invest_All_Action()
         # 余额全投——使用红包——即刻投资
         # po1.pppiguse_Redpacket_Invest_All_Action()
         # 使用加息券余额全投
         # po1.pppiguse_Rate_Coupon_Invest_All_Action()
         sleep(2)
         po1.pppiginvest_Action3("1111")
         sleep(2)
         po1.pppiginvest_Action4("111111")
         sleep(2)
         poclose = LoginPage(self.driver)
         poclose.pppiglogin_close_button()
         print('用户' + username + '投资' + amount + '元' + '投资成功')
     except BaseException as e:
         print(e)
Ejemplo n.º 3
0
    def test_cuse_NoRedpacket_invest_success(self):
        '''不适用卡券投资'''
        try:
            f = open('../date/invest/invest3.txt')
            lines = f.readlines()
            for line in lines:
                username = line.split(',')[0]
                investmentamount = line.split(',')[1]
                po = LoginPage(self.driver)
                sleep(2)
                po.open()
                po.pppiglogin_noclose_Action(username, "111111")  # 用户登陆
                sleep(2)
                po.open_R(
                    '/recommendloanDetail?loanId={}'.format(loanId))  # 标的 URL
                po1 = To_invest(self.driver)
                sleep(2)
                # 不使用卡券
                po1.pppiguse_no_Coupon_Invest_Action(investmentamount)
                # 不使用卡券余额全投
                # po1.pppiguse_NoRedpacket_Invest_All_Action()  # 余额全投   使用加息券
                # 使用加息券余额全投
                # po1.pppiguse_Rate_Coupon_Invest_All_Action()
                sleep(2)
                po1.pppiginvest_Action3("1111")  # 图形验证码
                sleep(2)
                po1.pppiginvest_Action4("111111")  # 交易密码
                sleep(2)
                poclose = LoginPage(self.driver)
                poclose.pppiglogin_close_button()
                function.insert_img(self.driver, "invest_success.png")  # 截图
                print('用户' + username + '投资' + investmentamount + '元' + '投资成功')

        except BaseException as e:
            print(e)
Ejemplo n.º 4
0
    def test_login_success(self):
        '''用户名、密码正确,登录成功'''
        try:
            for i in range(1, 100):
                po = LoginPage(self.driver)
                po.open()
                username = '******'
                po.pppiglogin_noclose_Action(username, '111111')
                sleep(2)
                po.open_R('/getNotTrusteePay')
                poshoutuo = Shoutuo(self.driver)
                poshoutuo.pppigshoutuo_Action()
                po1 = To_invest(self.driver)
                po1.pppiginvest_Action4("111111")
                sleep(2)
                poclose = LoginPage(self.driver)
                poclose.pppiglogin_close_button()

        except BaseException as e:
            print(e)
Ejemplo n.º 5
0
    def test_huankuan(self):
        '''还款'''
        try:
            for i in range(1, 100):
                po = LoginPage(self.driver)
                po.open()
                username = '******'
                po.pppiglogin_noclose_Action(username, '111111')
                sleep(2)
                # po.open_R('/backingBorrow')
                po.open_R('/repayDetail?loanId={}'.format(loanId))
                pohuankuan = Huankuan(self.driver)
                pohuankuan.pppighuankuan_Action()
                po1 = To_invest(self.driver)
                po1.pppiginvest_Action4("111111")
                sleep(2)
                poclose = LoginPage(self.driver)
                poclose.pppiglogin_close_button()

        except BaseException as e:
            print(e)
 def test_to_invest_success(self):
     '''投资'''
     try:
         f = open('../date/invest/loanId.txt')
         lines = f.readlines()
         for line in lines:
             loanId = line.split(',')[0]
             investmentamount = line.split(',')[1]
             po = LoginPage(self.driver)
             sleep(2)
             po.open()
             username = '******'
             po.pppiglogin_noclose_Action(username, "111111")
             sleep(2)
             po.open_R('/recommendloanDetail?loanId={}'.format(loanId))
             po1 = To_invest(self.driver)
             sleep(2)
             amount = '1000'
             # 使用加息券
             # po1.pppiguse_ratecoupon_Invest_Action(amount)
             # 使用红包
             # po1.pppiguse_Redpacket_Invest_Action(amount)
             # po1.pppiguse_no_Coupon_Invest_Action(amount)
             # 不使用卡券余额全投
             po1.pppiguse_NoRedpacket_Invest_All_Action()
             # 余额全投——使用红包——即刻投资
             # po1.pppiguse_Redpacket_Invest_All_Action()
             # 使用加息券余额全投
             # po1.pppiguse_Rate_Coupon_Invest_All_Action()
             sleep(2)
             po1.pppiginvest_Action3("1111")
             sleep(2)
             po1.pppiginvest_Action4("111111")
             sleep(2)
             poclose = LoginPage(self.driver)
             poclose.pppiglogin_close_button()
             print('用户' + username + '投资' + amount + '元' + '投资成功')
     except BaseException as e:
         print(e)