def test_buy_above3(self): """“订单为已发货状态,且卡内余额等于还款金额,进行还款操作"""'' # 修改待发货到已发货 # self.click_button(papaandroid.b_My) self.click_button(papaandroid.b_order_center) myms = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms.sql_assign_exec( "update csm_order set status='3' where user_id='2018072411392004050001343390' and id='660' ") myms_csorder = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info) myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=3 where contract_id='CO20180803003959191'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=221 where id='CO20180803003959191' ") myms.sql_assign_exec( "update csm_order set status=4,contract_status=221 where contract_no ='CO20180803003959191'") self.back() self.back() self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath(papaandroid.thirdorder_state[1]).text self.assertEqual(order_state, '交易完成') self.click_button(papaandroid.thirdorder_state) self.assertTrue(self.isElement(papaandroid.tx_assertSettlement)) print("已结清,还款成功状态正确") myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=1 where contract_id='CO20180803003959191'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=212 where id='CO20180803003959191' ") myms.sql_assign_exec( "update csm_order set status=2,contract_status=212 where contract_no ='CO20180803003959191'") self.back() self.back()
def test_saling_above3(self): """“多期转卖成功,已存在逾期,点击查看还款计划"""'' self.click_button(papaandroid.b_order_center) myms = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms_csorder = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info) myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=4 where contract_id='CO20180803004188670'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=230 where id='CO20180803004188670' ") myms.sql_assign_exec( "update csm_order set contract_status=230 where contract_no ='CO20180803004188670'") self.back() self.back() self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath(papaandroid.tx_firstorder_state[1]).text self.assertEqual(order_state, '已逾期') print("已逾期状态正确") myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=1 where contract_id='CO20180803004188670'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=212 where id='CO20180803004188670' ") myms.sql_assign_exec( "update csm_order set status=1,contract_status=212 where contract_no ='CO20180803004188670'") # myms.sql_assign_exec( "update csm_order set status='2' where user_id='2018072411392004050001343390' and id='559'") # myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=1 where contract_id='CO20180803003959191'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=212 where id='CO20180803003959191' ") myms.sql_assign_exec( "update csm_order set status=2,contract_status=212 where contract_no ='CO20180803003959191'") myms.conn_close() myms.cur_close()
def test_saling_above2(self): """“转卖选择多期,提前结清,点击查看还款计划"""'' self.click_button(papaandroid.b_order_center) myms = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms_csorder = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info) myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=3 where contract_id='CO20180803004188670'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=221 where id='CO20180803004188670' ") myms.sql_assign_exec( "update csm_order set status=4,contract_status=221 where contract_no ='CO20180803004188670'") self.back() self.back() self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath(papaandroid.tx_firstorder_state[1]).text self.assertEqual(order_state, '已结清') print("已结清,还款成功状态正确") myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=1 where contract_id='CO20180803004188670'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=212 where id='CO20180803004188670' ") myms.sql_assign_exec( "update csm_order set status=1,contract_status=212 where contract_no ='CO20180803004188670'") self.back() self.back()
def test_saling_above1(self): """“单期转卖成功,还款,银行卡余额等于还款金额"""'' self.pop_close() self.click_button(papaandroid.b_good) self.click_button(papaandroid.b_hotProduct) self.click_button(papaandroid.b_resell) self.click_button(papaandroid.b_seven) self.back() self.back() self.click_button(papaandroid.b_My) self.click_button(papaandroid.b_order_center) myms = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms_csorder = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info) myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=3 where contract_id='CO20180803004175620'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=221 where id='CO20180803004175620' ") myms.sql_assign_exec( "update csm_order set status=4,contract_status=221 where contract_no ='CO20180803004175620'") self.back() self.back() self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath(papaandroid.secondorder_state[1]).text self.assertEqual(order_state, '已结清') print("已结清,还款成功状态正确") myms_csorder.sql_assign_exec( " update cso_repayment_plan set repayment_status=1 where contract_id='CO20180803004175620'") myms_csorder.sql_assign_exec( "update cso_contract_msg set contract_Status=212 where id='CO20180803004175620' ") myms.sql_assign_exec( "update csm_order set status=1,contract_status=212 where contract_no ='CO20180803004175620'") self.back() self.back()
def test_buy_below1(self): """“商品详情页面点击立即购买,修改处理订单状态 待发货状态-已发货-已完成""" '' self.pop_close() # self.login('new') self.click_button(papaandroid.b_good) self.click_button(papaandroid.b_hotProduct) #点击购买 self.click_button(papaandroid.b_buy) self.click_button(papaandroid.b_CashPayments) self.click_button(papaandroid.b_SelectBank1) self.click_button(papaandroid.b_SelectBank2) # self.click_button(papaandroid.b_ConfirmPurchase) # self.assertTrue(self.isElement(papaandroid.b_add_bank)) # print("进入选择银行卡界面") # sleep(5) # self.back() self.back() self.back() self.back() self.click_button(papaandroid.b_My) self.click_button(papaandroid.b_order_center) #修改订单状态 order_state = self.driver.find_element_by_xpath( papaandroid.fourthorder_state[1]).text self.assertEqual(order_state, '待发货') print("商品为待发货状态正确") self.back() self.back() #修改待发货到已发货 myms = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms.sql_assign_exec( "update csm_order set status='3' where user_id='2018072411392004050001343390' and id='559' " ) self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath( papaandroid.fourthorder_state[1]).text self.assertEqual(order_state, '已发货') print("商品为已发货状态正确") self.back() self.back() # 修改已发货到交易完成 myms.sql_assign_exec( "update csm_order set status='4' where user_id='2018072411392004050001343390' and id='559' " ) sleep(5) self.click_button(papaandroid.b_order_center) order_state = self.driver.find_element_by_xpath( papaandroid.fourthorder_state[1]).text self.assertEqual(order_state, '交易完成') print("商品为交易完成状态正确") # 验证信用回收 self.click_button(papaandroid.fourthorder_state) self.click_button(papaandroid.b_credit_recycling2) # self.assertTrue(self.isElement(papaandroid.tx_credit_recycling)) # print("订单详情页点击信用回收按钮,跳转正确") # self.back() self.back() self.back() self.back()
from common import sql_normal_csldata, sql_normal_csmall, sql_normal_csorder, sql_normal_cspown, sql_normal_cscuser myms = sql_normal_csldata.mysql_connect(sql_normal_csldata.db_info) myms2 = sql_normal_csmall.mysql_connect(sql_normal_csmall.db_info) myms3 = sql_normal_csorder.mysql_connect(sql_normal_csorder.db_info) myms4 = sql_normal_cspown.mysql_connect(sql_normal_cspown.db_info) myms5 = sql_normal_cscuser.mysql_connect(sql_normal_cscuser.db_info) b = myms.sql_exec_normal( "select data_id from csl_data_bank_card_00 where app_user_id='191134'") print(b) b2 = myms2.sql_exec_normal( "INSERT INTO csm_user_address (user_id, name,phone,province,city)" " VALUES ('2018072411392004050001343390', '吴越欣','RsxeVNONBDbnk63cH2p3hgA7SjTJ8EGl2lzvnOR51U87aK1imH/btOy6OQ0fNA3+k3v/Nh1qevvw\nN2mUAa3rszWRBs0nlJY4aTIsEXHV6vPy60Knwa0oFiLXlRDZwHA0xFBrsPn+qoWDdHY5cIQnJ9E0\nRYMz9hc0HQGkuXR2MO8=','湖北省','仙桃市')" ) print(b2) b3 = myms3.sql_exec_normal( "select id from cso_audit_log where audit_result='301'") print(b3) b4 = myms4.sql_exec_normal( "select product_icon from csp_product where quota_min='1000'") print(b4) b5 = myms5.sql_exec_normal( "select app_user_id from csc_user_msg where phone='8izDsmjveBr/IQMfWmzmvg=='" ) print(b5) # order_amount_num=myms.sql_assign_exec("") # print(myms)