Commit 25e4c889 by huangchengcheng

Merge remote-tracking branch 'origin/master' into master

parents 1903985e 34db1b95
......@@ -12,28 +12,40 @@ from common.tools import request_main
from config import BMCConfig
@allure.epic("账号信息基本功能")
# @allure.feature("账号信息基本功能")
@allure.feature("登录")
class TestLogin():
workBook = xlrd.open_workbook(f'{BMCConfig.root_path}/test_case_data/bmc/bmc_testcase_20210513.xlsx')
@allure.story("账号信息基本功能")
workBook = xlrd.open_workbook(f'{BMCConfig.root_path}/test_case_data/bmc/bmc_login_20210513.xlsx')
@allure.story("登录")
@allure.severity("")
@allure.title("{inData[testPoint]}")
@allure.testcase("{inData[yapiAddress]}")
@allure.description("url:/auth/login 。。。。")
@pytest.mark.parametrize("inData", get_excelData(workBook,'账号信息基本功能', 'login'))
@pytest.mark.parametrize("inData", get_excelData(workBook,'登录', 'login'))
def test_login(self,inData):
url = f"{BMCConfig().host}{inData['url']}"
method = inData['method']
req_data = inData['reqData']
expectData = inData['expectData']
headers = config.BMCConfig.loginheader
#res = requests.post(url = url,headers =headers,json =req_data )
res = request_main(url= url,headers = headers,method =method,data = req_data,has_token=True)
# print(res)
print(res)
assert res['code'] == expectData['code']
@allure.story("激活")
@allure.link("")
@allure.description("/user/credit/idAuth")
@allure.title("{inData[testPoint]}")
@pytest.mark.parametrize("inData", get_excelData(workBook, '登录', 'Active'))
def test_active(self,inData):
url = f"{BMCConfig().host}{inData['url']}"
method = inData['method']
req_data = inData['reqData']
expectData = inData['expectData']
headers = config.BMCConfig.headers
res = request_main(url=url, headers=headers, method=method, data=req_data)
print(res)
assert res['code'] == expectData['code']
if __name__ == '__main__':
pytest.main(['-s', '-v', 'test_accountinfo.py',
r'--alluredir=D:\项目\接口自动化\InterfaceAutoTest\report', '--clean-alluredir'])
......
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