def test_financial_list(self): "投资记录-理财中列表数据验证" entry_page = Entry_page(self.driver) myinvsetrecorepage=entry_page.open_my_invset_recore_Page() invest_list_value=myinvsetrecorepage.logic_get_invest_value() sql = Exce_SQLserver() contract_number = sql.execSql_getList("SELECT top 1 new_product_name,new_name,new_instreststartdate,new_quitdate,new_planmoney,new_planmoney_Base from new_investdetailBase WHERE new_accountname = '24004F6C-7C08-E711-80C9-00155D01F903' AND new_status=100000000 order BY new_paidon desc") entry_page.saveScreenshot('financial_data') #断言验证 #断言理财名称 self.assertIn(invest_list_value["invest_text_name"],contract_number[0][0]) #断言合同编号 self.assertIn(contract_number[0][1],invest_list_value["invest_product_no"]) #断言起息日 self.assertEquals(invest_list_value["start_income_day"], (contract_number[0][2].date()+datetime.timedelta(days = 1)).strftime("%Y-%m-%d")) #断言结息日 if '年年生利' in invest_list_value["invest_text_name"]: self.assertIn("随时申请退出",invest_list_value["end_income_day"]) else: self.assertEquals(invest_list_value["end_income_day"],(contract_number[0][3].date().strftime("%Y-%m-%d"))) #断言 实际投资金额 self.assertIn(str(contract_number[0][4])[:-6]+ ","+ str(contract_number[0][4])[-6:],invest_list_value["reality_invest"]) #断言 意向投资金额 self.assertIn(str(contract_number[0][5])[:-6]+ ","+ str(contract_number[0][5])[-6:],invest_list_value["expected_invest"])
def test_Exited_list(self): "投资记录-已退出列表数据验证" entry_page = Entry_page(self.driver,phone='17712345606',pwd='qwe123') myinvsetrecorepage = entry_page.open_my_invset_recore_Page() time.sleep(0.2) myinvsetrecorepage.el_exited_btn.click() invest_list_value = myinvsetrecorepage.logic_get_invest_value() sql = Exce_SQLserver() contract_number = sql.execSql_getList( "SELECT top 1 new_product_name,new_name,new_instreststartdate,new_quitdate,new_planmoney,new_planmoney_Base from new_investdetailBase WHERE new_accountname = 'F86EEE35-2940-E711-80D3-00155D02B414' AND new_status=100000002 order BY new_paidon desc") entry_page.saveScreenshot('test_Exited_list') # 断言验证 # 断言理财名称 self.assertIn(invest_list_value["invest_text_name"], contract_number[0][0]) # 断言合同编号 self.assertIn(contract_number[0][1], invest_list_value["invest_product_no"]) # 断言起息日 self.assertEquals(invest_list_value["start_income_day"], (contract_number[0][2].date() + datetime.timedelta(days=1)).strftime("%Y-%m-%d")) # 断言结息日 self.assertEquals(invest_list_value["end_income_day"], (contract_number[0][3].date() + datetime.timedelta(days=1)).strftime("%Y-%m-%d")) # 断言 实际投资金额 self.assertIn(str(contract_number[0][4])[:-6] + "," + str(contract_number[0][4])[-6:], invest_list_value["reality_invest"]) # 断言 意向投资金额 self.assertIn(str(contract_number[0][5])[:-6] + "," + str(contract_number[0][5])[-6:], invest_list_value["expected_invest"])