Commit 19b8f911 by 文鑫

增加title

parent d7915055
...@@ -10,6 +10,8 @@ from common.getData import DoExcelByPandas ...@@ -10,6 +10,8 @@ from common.getData import DoExcelByPandas
@allure.feature('系统设置') @allure.feature('系统设置')
class TestSystem(): class TestSystem():
parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1') parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1')
# data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1')
@allure.title('{story}')
@pytest.mark.parametrize('id,url,data,story,method,severity,condition,except_result',parametrize) @pytest.mark.parametrize('id,url,data,story,method,severity,condition,except_result',parametrize)
def test(self,id,url,data,story,method,severity,condition,except_result): # test开头的测试函数 def test(self,id,url,data,story,method,severity,condition,except_result): # test开头的测试函数
headers = getHeader.get_Header() headers = getHeader.get_Header()
...@@ -17,8 +19,11 @@ class TestSystem(): ...@@ -17,8 +19,11 @@ class TestSystem():
json = eval(data) json = eval(data)
if method == 'post': if method == 'post':
r = requests.post(url = url,json = json,headers = headers) r = requests.post(url = url,json = json,headers = headers)
response = r.json() else:
assert response[condition] == except_result # 断言成功 r = requests.get(url=url)
response = r.json()
# print (type(response[condition]))
assert response[condition] == str(except_result)
......
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