Commit c815fb9f by taoke

[交委项目]修改--风险中因查询sql写错,引起的新增备注用例失败

parent d90e4967
......@@ -59,12 +59,12 @@ def riskPointdelete():
class TestRiskMan():
workBook = xlrd.open_workbook(f'{BaseConfig.root_path}/test_case_data/safe_transportation/jgd_riskCase.xlsx')
@pytest.mark.run(order=661) # 需要在绑定用例之后
# @pytest.mark.run(order=661)
@allure.story("风险规则配置")
@allure.title("{inData[testPoint]}")
@allure.testcase("http://yapi.hikcreate.com/project/336/interface/api/73931")
@pytest.mark.parametrize("inData", get_excelData(workBook, "风险管理中心", "riskSave"))
def test_riskPointsave(self, inData):
def test_1riskpointsave(self, inData):
url = f"{SafeTransportationConfig().SSO_url}{inData['url']}"
headers = inData['headers']
method = inData['method']
......@@ -78,10 +78,10 @@ class TestRiskMan():
def riskPointID(self):
"""返回新增的测试数据的id"""
mysql = MYSQL(*BaseConfig.test_mysql)
info=mysql.ExecuQuery("select id from db_tbd_base1.risk_info where risk_name='自动化新增';")
info=mysql.ExecuQuery("select id from db_tbd_base1.risk_info where risk_name like '自动化新增%';")
return info[0]['id']
@allure.story("风险规则配置")
@allure.story("风险规则配置") # 编辑
@allure.title("{inData[testPoint]}")
@allure.testcase("http://yapi.hikcreate.com/project/336/interface/api/73931")
@pytest.mark.parametrize("inData", get_excelData(workBook, "风险管理中心", "riskupdateSave"))
......@@ -160,7 +160,7 @@ class TestRiskMan():
allure.attach(f"{res}", "响应结果", allure.attachment_type.TEXT)
assert res['code'] == expectData['code']
@pytest.mark.run(order=662) # 设置顺序为了在新增风险后执行
@allure.story("风险备注配置")
@allure.title("{inData[testPoint]}")
# @allure.testcase("")
......@@ -219,6 +219,7 @@ if __name__ == '__main__':
for one in os.listdir('../../../report/tmp'):
if 'json' or 'txt' in one:
os.remove(f'../../../report/tmp/{one}')
pytest.main(['test_riskManagement.py', '-s', '-m','pppp', '--alluredir','../../../report/tmp'])
pytest.main(['test_riskManagement.py', '-s', '--alluredir','../../../report/tmp'])
# 启动默认浏览器打开报告
os.system('allure serve ../../../report/tmp')
\ No newline at end of file
os.system('allure serve ../../../report/tmp')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment