def test_login_success(self): '''参数化、用户名、密码正确,登录成功''' try: f = open('../date/recharge.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] password = line.split(',')[1] pologin = LoginPage(self.driver) pologin.open() sleep(1) pologin.pppiglogin_noclose_Action(username, '111111') sleep(2) porecharge = Recharge(self.driver) # 充值 -- 充值金额 -- 立即充值 # amount = '9000000' amount = '9000000' porecharge.recharge1_Action(amount) # 江西充值页面_已加入手动输入验证码 sleep(1) porecharge.jx_recharge_Action('111111') sleep(2) print(username+'用户充值成功') function.insert_img(self.driver, "pppig_recharge_success.png") sleep(1) pologout = LoginPage(self.driver) pologout.pppiglogin_close_button() sleep(1) except BaseException as e: print(e)
def test_login_success(self): '''充值''' try: f = open('../date/recharge/recharge2.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] # password = line.split(',')[1] pologin = LoginPage(self.driver) pologin.open() sleep(1) pologin.pppiglogin_noclose_Action(username, '111111') sleep(2) porecharge = Recharge(self.driver) # 充值 -- 充值金额 -- 立即充值 amount = '9000000' # amount = '1' porecharge.recharge1_Action(amount) # 江西充值页面_已加入手动输入验证码 sleep(1) porecharge.jx_recharge_Action('111111') sleep(1) logger_info = log() logger_info.setMSG('info', "username = {}充值成功".format(username)) print("username = {}充值成功".format(username)) pologout = LoginPage(self.driver) pologout.pppiglogin_close_button() sleep(1) except BaseException as e: print(e)
def test_register_success(self): '''注册''' try: f = open('../date/register.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] # 取第一列用户名数据 password = line.split(',')[1] # 取第二列密码数据 # getcode = line.split(',')[2] # 取第三列验证码数据 sql语句 realname = line.split(',')[2] idcode = line.split(',')[3] bankcard = line.split(',')[4] # 注册 poRegister = GoRegister(self.driver) sleep(2) # 查询验证码 poRegistercode = SelectMySQL() poRegister.open() # 下方用例包含点击获取验证码 poRegister.goregisternoinvite1_Action(username, password, "1111") sleep(2) checkCode = poRegistercode.select_Data( "select validCode from mobile_authen where mobile= {} and mobileAuthenid>3399000 ORDER BY sendTime desc limit 0,1" .format(username)) # 下方用例包含输入验证码 - 同意协议 - 点击注册 # poRegister.goregisternoinvite2_Action(checkCode) # 有邀请码 poRegister.goregisterokinvite_Action(checkCode, '43676626') # 实名认证 poopendepository = Opendepository(self.driver) # 立即开通银行存管 poopendepository.opendepository1_Action() sleep(2) poopendepository.opendepository2_Action( realname, idcode, bankcard) # 江西银行-网贷资金存管账户开立-银行卡号 poopendepository.opendepository3_Action(bankcard) # 跳转等待 sleep(7) # 点击前往我的账户 poopendepository.pppigto_Go_myaccount() # 有一个跳转的过程要加等待 sleep(2) # 设置交易密码 poset_transaction_password = SetTransactionPWD(self.driver) sleep(2) poset_transaction_password.pppigset_Transaction_password_Action( '111111', '111111') sleep(10) # 修改手机号 pomodifyphone = Modify_cellphone_Page(self.driver) pomodifyphone.pppigmodify_phone_Action('15120080522', username) pologout = LoginPage(self.driver) pologout.pppiglogin_close_button() except BaseException as e: print(e)
def test_login_success(self): '''开通银行存管,设置交易密码,修改手机号''' try: f = open('../date/register.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] # 取第一列用户名数据 password = line.split(',')[1] # 取第二列密码数据 # getcode = line.split(',')[2] # 取第三列验证码数据 sql语句 realname = line.split(',')[2] idcode = line.split(',')[3] bankcard = line.split(',')[4] po = LoginPage(self.driver) po.open() po.pppiglogin_noclose_Action(username, password) sleep(2) # 立即开通银行存管 poopendepository = Opendepository(self.driver) poopendepository.opendepository_repeat_Action() sleep(2) # poopendepository.opendepository2_Action(realname, idcode, bankcard) poopendepository.opendepository2_Action( realname, idcode, bankcard) # 江西银行-网贷资金存管账户开立-银行卡号 sleep(1) poopendepository.opendepository3_Action(bankcard) # 跳转等待 sleep(6) # 点击前往我的账户 poopendepository.pppigto_Go_myaccount() # 有一个跳转的过程要加等待 sleep(2) # 设置交易密码 poset_transaction_password = SetTransactionPWD(self.driver) sleep(2) poset_transaction_password.pppigset_Transaction_password_Action( '111111', '111111') sleep(10) # 修改手机号 pomodifyphone = Modify_cellphone_Page(self.driver) pomodifyphone.pppigmodify_phone_Action('15120080522', username) pologout = LoginPage(self.driver) pologout.pppiglogin_close_button() print(username + '充值成功!!!') except BaseException as e: print(e)
def test_login_success(self): '''用户名、密码正确,登录成功''' try: po = LoginPage(self.driver) po.open() username = '******' po.pppiglogin_noclose_Action(username, '111111') sleep(2) self.assertEqual(po.pppiglogin_success_user(), username) # 登录成功后断言右上角的用户信息 print(po.pppiglogin_success_user() + '登陆成功') # 打印用户登录成功 function.insert_img(self.driver, "pppig_login_success.png") # 截图 except BaseException as e: mylog = log() mylog.error(e) print(e)
def test_0login_success(self): '''用户名、密码正确,登录成功''' try: po = LoginPage(self.driver) po.open() username = '******' po.pppiglogin_noclose_Action(username, '111111') sleep(2) self.assertEqual(po.pppiglogin_success_user(), 'pppig'+username) # 登录成功后断言右上角的用户信息 print(po.pppiglogin_success_user()+'登陆成功') # 打印用户登录成功 function.insert_img(self.driver, "pppig_login_success.png") # 截图 mylog = log() mylog.setMSG('info', '0.输入正确的用户名和密码,点击提交按钮,验证是否能正确登录。(正常输入)') except BaseException as e: print(e) mylog = log() mylog.setMSG('error', '执行失败,发生错误')
def test_register_success(self): '''只是参数化注册''' f = open('../date/onlyregister.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] # 取第一列用户名数据 poRegister = GoRegister(self.driver) sleep(2) poRegistercode = SelectMySQL() poRegister.open() # 我要出借 poRegister.goregisternoinvite1_Action(username, "111111", "1111") # 我要借款 # poRegister.goregisternoinvite3_Action(username, "111111", "1111") sleep(3) checkCode = poRegistercode.select_Data( "select validCode from mobile_authen where mobile={} and mobileAuthenid>3399000 ORDER BY sendTime desc limit 0,1" .format(username)) poRegister.goregisternoinvite2_Action(checkCode) # 登出 pologout = LoginPage(self.driver) pologout.pppiglogin_close_button() # function.insert_img(self.driver, "success.png")
def test_login_success(self): '''修改手机号''' # try: po = LoginPage(self.driver) po.open() username = 15110867276 po.pppiglogin_noclose_Action(username, '111111') sleep(2) # 修改手机号 pomodifyphone = Modify_cellphone_Page(self.driver) pomodifyphone.pppigmodify_phone_Action('15120080522', username) sleep(5)
def test_to_invest_success(self): '''投资''' po = LoginPage(self.driver) sleep(2) po.open() po.pppiglogin_Action("13011111101", "111111") sleep(3) po_debtcession = To_investdebtcession(self.driver) po_debtcession.pppiginvestdebtcession_Action1() sleep(3) po_debtcession.pppiginvestdebtcession_Action2() sleep(3) po_debtcession.pppiginvestdebtcession_Action3('111111')
def test_login_success(self): '''充值''' # try: pologin = LoginPage(self.driver) pologin.open() pologin.pppiglogin_noclose_Action('13294756409', '111111') sleep(1) # 设置交易密码 poset_transaction_password = SetTransactionPWD(self.driver) sleep(2) poset_transaction_password.pppigset_Transaction_password_Action( '111111', '111111') sleep(10)
def test_pppig_user_answer(self): tusp = To_User_Snswer_page(self.driver) lp = LoginPage(self.driver) sleep(2) #登录 lp.open() sleep(2) lp.pppiglogin_noclose_Action("13011111101", "111111") sleep(4) #风险测评 tusp.open() sleep(2) tusp.pppigToUserAnswer_Action1(4,4,1,2,3,4,4) function.insert_img(self.driver, "success3.png")
def test_login_success(self): '''修改手机号''' # try: f = open('../date/findcellphone.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] po = LoginPage(self.driver) po.open() po.pppiglogin_noclose_Action(username, '111111') sleep(2) # 修改手机号 pomodifyphone = Modify_cellphone_Page(self.driver) pomodifyphone.pppigmodify_phone_Action('15120080522', username) sleep(5)
def test_setpwd_changembl(self): u'''设置交易密码,修改手机号''' pologin = LoginPage(self.driver) pologin.open() username = 15110867276 pologin.pppiglogin_noclose_Action(username, '111111') sleep(1) # 设置交易密码 poset_transaction_password = SetTransactionPWD(self.driver) sleep(2) poset_transaction_password.pppigset_Transaction_password_Action( '111111', '111111') sleep(10) pomodifyphone = Modify_cellphone_Page(self.driver) pomodifyphone.pppigmodify_phone_Action('15120080522', username)
def test_login_success(self): '''参数化、用户名、密码正确,登录成功''' try: f = open('../date/name.txt') # f = open('D:\\name.txt') lines = f.readlines() for line in lines: username = line.split(',')[0] password = line.split(',')[1] po = LoginPage(self.driver) # sleep(1) po.open() po.pppiglogin_close_Action(username, password) sleep(2) except BaseException as e: print(e)
def test_withdraw_deposit(self): '''登录后进行提现操作''' try: pologin = LoginPage(self.driver) pologin.open() username = '******' pologin.pppiglogin_noclose_Action(username, "111111") sleep(1) powithdraw = Withdraw_Deposit(self.driver) sleep(2) amount = '1' powithdraw.rapid_Withdrawal_Action(amount) sleep(2) powithdraw.withdraw_Jx_Transaction_Password_Action('111111') sleep(10) # self.assertEqual(powithdraw.pppig_anready_withdrawal(), '取现操作已执行') function.insert_img(self.driver, "取现操作已执行.png") print('用户' + username + '提现' + amount + ' 元' + ' 提现操作已执行') except Exception as e: print(e)
def test_login_success(self): '''参数化、用户名、密码正确,登录成功''' pologin = LoginPage(self.driver) pologin.open() sleep(1) username = 13011111102 pologin.pppiglogin_noclose_Action(username, '111111') sleep(2) porecharge = Recharge(self.driver) # 充值 -- 充值金额 -- 获取短信验证码按钮 amount = 9000000 porecharge.recharge1_Action(amount) # 江西充值页面_已加入手动输入验证码 porecharge.jx_recharge_Action('111111') # 手动输入验证码 # sleep(15) # 立即充值 # porecharge.pppigalertenter_button() sleep(5) logger_info = log() logger_info.setMSG('info', "username = {}充值成功".format(username)) print("username = {}充值成功".format(username)) function.insert_img(self.driver, "pppig_recharge_success.png")
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)
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)
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_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)
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)
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)