Commit 5022aeb8 by taoke

添加电子证照 --添加查看驾照分 用例

parent c3959743
...@@ -99,6 +99,22 @@ class TestDrivingLicense(): ...@@ -99,6 +99,22 @@ class TestDrivingLicense():
"""断言""" """断言"""
assert res['code'] == expectData['code'] assert res['code'] == expectData['code']
@pytest.mark.scoreDetail
@allure.story("驾照扣分记录")
@allure.link("http://yapi.hikcreate.com/project/32/interface/api/5332")
@allure.description("/drivingLicense/score/detail")
@allure.title("{inData[testPoint]}")
@pytest.mark.parametrize("inData", get_excelData(workBook, '电子证照', 'scoreDetail'))
def test_scoreDetail(self, inData):
url = f"{BMCConfig().pvthost}{inData['url']}"
method = inData['method']
req_data = inData['reqData']
expectData = inData['expectData']
headers = inData['headers']
"""请求"""
res = request_main(url, headers, method, req_data)
"""断言"""
assert res['code'] == expectData['code']
def teardown_class(self): def teardown_class(self):
"""清除""" """清除"""
...@@ -106,9 +122,9 @@ class TestDrivingLicense(): ...@@ -106,9 +122,9 @@ class TestDrivingLicense():
if __name__ == '__main__': if __name__ == '__main__':
for one in os.listdir('../../report/tmp'): # 列出对应文件夹的数据 for one in os.listdir('../../report/tmp'): # 列出对应文件夹的数据 '-m','scoreDetail' ,
if 'json' in one: if 'json' in one:
os.remove(f'../../report/tmp/{one}') os.remove(f'../../report/tmp/{one}')
pytest.main(['test_ ElectronicLicense.py', '-s', '--alluredir', '../../report/tmp']) pytest.main(['test_ ElectronicLicense.py', '-s','-m','scoreDetail' , '--alluredir','../../report/tmp'])
# 启动默认浏览器打开报告 # 启动默认浏览器打开报告
os.system('allure serve ../../report/tmp') os.system('allure serve ../../report/tmp')
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