# bpm_test_res1.html

Report generated on 05-Sep-2024 at 14:37:13 by pytest-html v3.1.0

## Summary

22 tests ran in 5.43 seconds.

(Un)check the boxes to filter the results.

10 passed, 0 skipped, 12 failed, 0 errors, 0 expected failures, 0 unexpected passes, 60 rerun

## Results

Result | Test | Duration | Links
--- | --- | --- | ---
No results found. Try to check the filters
Failed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.25 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Failed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Failed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.06 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868723118080"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868869918720"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869033496576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869176102912"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869318709248"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869603921920"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869754916864"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869893328896"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870040129536"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870186930176"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870472142848"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870639915008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870811881472"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870958682112"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871105482752"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.04 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871373918208"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871545884672"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581875899572224"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876063150080"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876239310848"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876528717824"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876679712768"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876830707712"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876985896960"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581877136891904"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877606653952"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877740871680"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877879283712"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878000918528"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878122553344"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878378405888"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878495846400"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878634258432"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878781059072"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878923665408"}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.04 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F2C6B40>('message')
E + where <built-in method get of dict object at 0x000001D80F2C6B40> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Failed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F19C840>('message')
E + where <built-in method get of dict object at 0x000001D80F19C840> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-添加维度-高-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/addDem-post-application/json-case_data0-expect_data0-delete-sql_data0-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加维度成功' == '添加维度成功！'
E
E - 添加维度成功！
E ? -
E + 添加维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF39C10>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '添加维度'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/addDem', method = 'post', mime = 'application/json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}
expect_data = {'message': '添加维度成功'}, sql_type = 'delete', sql_data = {'delete': 'dELETE FROM uc_demension WHERE `CODE_`="requestsAddDem";'}
update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/addDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 1, 'name': 'requests添加的维度'}, 期望数据:{'message': '添加维度成功'}, 服务器返回数据:{"state":true,"message":"添加维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-更新维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/updateDem-put-json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '更新维度成功' == '更新维度成功！'
E
E - 更新维度成功！
E ? -
E + 更新维度成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF15340>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '维度管理', api_name = '更新维度'
level = '中', title = '正向用例', url = 'http://36.139.193.99:8088/api/demension/v1/dem/updateDem', method = 'put', mime = 'json'
case_data = {'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}
expect_data = {'message': '更新维度成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/updateDem, 用例数据:{'code': 'requestsAddDem', 'description': 'requestsAddDem', 'isDefault': 0, 'name': 'requestsAddDem'}, 期望数据:{'message': '更新维度成功'}, 服务器返回数据:{"state":true,"message":"更新维度成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.05 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Rerun | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-添加组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/org/addOrg-POST-json-case_data2-expect_data2-delete|select-sql_data2-demId] | 0.04 |

self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '添加组织成功' == '添加组织成功！'
E
E - 添加组织成功！
E ? -
E + 添加组织成功
test_case\test_demo\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_demo.test_bpm.TestBPM object at 0x000001D80EF151F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80EF8D340>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80EFA5670>, module_name = '组织管理', api_name = '添加组织'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/api/org/v1/org/addOrg', method = 'POST', mime = 'json'
case_data = {'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', ...}, expect_data = {'message': '添加组织成功'}
sql_type = 'delete|select'
sql_data = {'delete': 'delete from uc_org where CODE_="testAddOrg";', 'select': 'select ID_ from uc_demension where CODE_="requestsAddDem"; '}
update_key = 'demId'
@allure.epic("BPM项目-Demo")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_demo\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/api/org/v1/org/addOrg, 用例数据:{'code': 'testAddOrg', 'demId': '1831581862851092480', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}, 期望数据:{'message': '添加组织成功'}, 服务器返回数据:{"state":true,"message":"添加组织成功！","value":"","code":200}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868723118080"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868723118080"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868869918720"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868723118080"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868869918720"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869033496576"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为空-http://36.139.193.99:8088/auth-POST-application/json-case_data1-expect_data1-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF880A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为空', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': ''}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868542763008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868723118080"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581868869918720"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869033496576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869176102912"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869603921920"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869603921920"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869754916864"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869603921920"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869754916864"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869893328896"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data2-expect_data2-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D3D0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username为特殊字符', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': '#!$!@#!@#'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869457121280"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869603921920"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869754916864"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581869893328896"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': '#!$!@#!@#', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870040129536"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870472142848"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870472142848"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870639915008"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870472142848"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870639915008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870811881472"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username过长-http://36.139.193.99:8088/auth-POST-application/json-case_data3-expect_data3-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D460>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username过长', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminadminadminadminadminadminadminadminadmin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870329536512"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870472142848"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870639915008"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870811881472"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminadminadminadminadminadminadminadminadmin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581870958682112"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871373918208"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871373918208"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871545884672"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 1.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871373918208"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871545884672"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581875899572224"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username短-http://36.139.193.99:8088/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D670>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'a'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871235506176"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871373918208"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581871545884672"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581875899572224"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'a', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876063150080"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876528717824"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876528717824"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876679712768"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876528717824"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876679712768"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876830707712"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-username错误-http://36.139.193.99:8088/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '账户错误或该租户未启用'
E
E - 账户错误或该租户未启用
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EF6D5E0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-username错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ=', 'username': 'adminxyz'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876373528576"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876528717824"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876679712768"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876830707712"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'adminxyz', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账户错误或该租户未启用","code":200,"logId":"1831581876985896960"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877606653952"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877606653952"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877740871680"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877606653952"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877740871680"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877879283712"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过长-http://36.139.193.99:8088/auth-post-application/json-case_data8-expect_data8-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA5280>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过长', url = 'http://36.139.193.99:8088/auth', method = 'post', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQraz...aEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877493407744"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877606653952"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877740871680"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581877879283712"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ' '}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878000918528"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878378405888"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878378405888"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878495846400"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878378405888"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878495846400"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878634258432"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password过短-http://36.139.193.99:8088/auth-POST-application/json-case_data9-expect_data9-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == '解密密码异常，请检查RSA公钥和私钥配置'
E
E - 解密密码异常，请检查RSA公钥和私钥配置
E + 账号或密码错误
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA51C0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password过短', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': '123456', 'username': 'admin'}, expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None
update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878260965376"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878378405888"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878495846400"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878634258432"}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '123456'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"解密密码异常，请检查RSA公钥和私钥配置","code":200,"logId":"1831581878781059072"}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.03 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F194740>('message')
E + where <built-in method get of dict object at 0x000001D80F194740> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F1EBDC0>('message')
E + where <built-in method get of dict object at 0x000001D80F1EBDC0> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F237980>('message')
E + where <built-in method get of dict object at 0x000001D80F237980> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F2AF180>('message')
E + where <built-in method get of dict object at 0x000001D80F2AF180> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password错误-http://36.139.193.99:8088/auth-POST-application/json-case_data10-expect_data10-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '账号或密码错误' == None
E + where None = <built-in method get of dict object at 0x000001D80F2B8E00>('message')
E + where <built-in method get of dict object at 0x000001D80F2B8E00> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA50A0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '登录系统'
level = '中', title = '反向用例-password错误', url = 'http://36.139.193.99:8088/auth', method = 'POST', mime = 'application/json'
case_data = {'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ', 'username': 'admin'}
expect_data = {'message': '账号或密码错误'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F2CCF40>('message')
E + where <built-in method get of dict object at 0x000001D80F2CCF40> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.02 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F2DDEC0>('message')
E + where <built-in method get of dict object at 0x000001D80F2DDEC0> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F2EA200>('message')
E + where <built-in method get of dict object at 0x000001D80F2EA200> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F23CEC0>('message')
E + where <built-in method get of dict object at 0x000001D80F23CEC0> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Rerun | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-刷新token-高-正向用例-http://36.139.193.99:8088/refresh-GET-None-None-expect_data11-None-None-None] | 0.01 |

self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新token成功' == None
E + where None = <built-in method get of dict object at 0x000001D80F109080>('message')
E + where <built-in method get of dict object at 0x000001D80F109080> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...}.get
E + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA', ...} = json()
E + where json = <Response [200]>.json
test_case\test_lao_zhang\test_bpm.py:61: AssertionError
During handling of the above exception, another exception occurred:
self = <apiAutoTest_v3.test_case.test_lao_zhang.test_bpm.TestBPM object at 0x000001D80EFA54F0>
fix_db = <apiAutoTest_v3.common.db.DB object at 0x000001D80F18C100>
fix_req = <apiAutoTest_v3.request_method.request_method.RequestMethod object at 0x000001D80F18C190>, module_name = '认证接口', api_name = '刷新token'
level = '高', title = '正向用例', url = 'http://36.139.193.99:8088/refresh', method = 'GET', mime = None, case_data = None
expect_data = {'message': '刷新token成功'}, sql_type = None, sql_data = None, update_key = None
@allure.epic("BPM项目-老张")
# @allure.feature("模块名称")
# @allure.story("接口名称")
# @allure.title("用例标题")
# @allure.severity("用例等级")
@pytest.mark.parametrize("module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key", excel.get_data())
def test_bpm(self, fix_db, fix_req, module_name, api_name, level, title, url, method, mime, case_data, expect_data, sql_type, sql_data, update_key):
allure.dynamic.feature(module_name)
allure.dynamic.story(api_name)
allure.dynamic.title(title)
allure.dynamic.severity(level)
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 判断sql语句的类型是否为select|delete 或者为 delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象调用delete方法执行删除的sql语句，DB类对象===fix_db自定义固件
fix_db.delete(sql_data['delete'])
# 使用DB类对象调用select方法执行查询的sql语句， 并获取查询结果，DB类对象===fix_db自定义固件
select_result = fix_db.select(sql_data['select'])
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestMethod类对象发送请求
res = fix_req.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)
# 断言
try:
for key in expect_data.keys():
assert expect_data[key] == res.json().get(key)
except AssertionError:
log.error(f"断言失败，接口url为:{url}, 用例数据:{case_data}, 期望数据:{expect_data}, 服务器返回数据:{res.text}")
> raise AssertionError("断言失败")
E AssertionError: 断言失败
test_case\test_lao_zhang\test_bpm.py:64: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjMsImlhdCI6MTcyNTUxODEyM30.OJcSOQ4XMFFq5bTK9Q2otBn_A3s3ZI1fdy0Jpty2-Nj8pT9BsuZKagFdWFwp-rjF26WrdCbSneKb0M6mjar-Ug","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
-------------------------------Captured log call--------------------------------
ERROR 张三:test_bpm.py:63 断言失败，接口url为:http://36.139.193.99:8088/refresh, 用例数据:None, 期望数据:{'message': '刷新token成功'}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjQsImlhdCI6MTcyNTUxODEyNH0.YNvXrTQC6dijoTQG31G0qlWhs9B30v7J0v1nXzMVjoqi3NBaqHU6r8o8Q6-DVOlKyETL8cA8ReiJBNEhZpM2EA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}

Passed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-用户加入组织-高-正向用例-http://36.139.193.99:8088/api/org/v1/orgUsers/addUsersForOrg-POST-query-case_data3-expect_data3-None-None-None] | 0.03 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/api/org/v1/orgUsers/addUsersForOrg, 用例数据:{'orgCode': 'testAddOrg', 'accounts': 'admin,guest'}, 期望数据:{'message': '加入成功'}, 服务器返回数据:{"state":true,"message":"加入成功","value":"","code":200}
Passed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-保存组织参数-中-正向用例-http://36.139.193.99:8088/api/org/v1/orgParam/saveOrgParams-POST-query|json-case_data4-expect_data4-None-None-None] | 0.02 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/api/org/v1/orgParam/saveOrgParams, 用例数据:{'query': {'orgCode': 'testAddOrg'}, 'body': [{'alias': 'hxxmts', 'value': '项目中没有关系户'}]}, 期望数据:{'message': '保存组织参数成功！'}, 服务器返回数据:{"state":true,"message":"保存组织参数成功！","value":"","code":200}
Passed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[组织管理-删除组织-中-正向用例-http://36.139.193.99:8088/api/org/v1/org/deleteOrg-POST-form-testAddOrg-expect_data5-None-None-None] | 0.03 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/api/org/v1/org/deleteOrg, 用例数据:testAddOrg, 期望数据:{'message': '删除组织成功！'}, 服务器返回数据:{"state":true,"message":"删除组织成功！","value":"","code":200}
Passed | test_case/test_demo/test_bpm.py::TestBPM::test_bpm[维度管理-根据维度编码删除维度-中-正向用例-http://36.139.193.99:8088/api/demension/v1/dem/deleteDemByIds-delete-query-case_data6-expect_data6-select-sql_data6-ids] | 0.02 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/api/demension/v1/dem/deleteDemByIds, 用例数据:{'ids': '1831581862851092480'}, 期望数据:{'message': '删除维度成功！'}, 服务器返回数据:{"state":true,"message":"删除维度成功！","value":"","code":200}
Passed | test_case/test_dependency/test_bpm_1_login.py::TestBPMLogin::test_login | 0.04 |
No log output captured.
Passed | test_case/test_dependency/test_bpm_2_dem.py::TestBPMDem::test_add_dem | 0.49 |
No log output captured.
Passed | test_case/test_dependency/test_bpm_3_org.py::TestBPMOrg::test_add_org | 0.03 |
No log output captured.
Passed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-高-登录的正向用例-http://36.139.193.99:8088/auth-POST-application/json-case_data0-expect_data0-None-None-None] | 0.10 |

-------------------------------Captured log call--------------------------------
INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': 'bF6N3L93cX8pV6x2yEqxNjwIIPaEOYw9bNI5GuIY4g9MeoFyPFPL5WteHaV0LcxQqmDJWlhuCRMXzAPvrFcxJrA8BgGjJpmB1WMrQrazIJPbWbCfmDit2s2jzn+DRerVlYIFojDM96y24drEniwWzHtaJKiWoc7LGL1csNmokvQ='}, 期望数据:{'username': '超级管理员', 'account': 'admin', 'userId': '1', 'expiration': 86400, 'loginStatus': True}, 服务器返回数据:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjU2MDQ1MjEsImlhdCI6MTcyNTUxODEyMX0.fvHipHd1jVRGtq__eL3TeaPDRHNyHotq_o5Myi28TWWTJ1BaWlAGh38YmXFnbgBA4WhWsC_36geE2QQHXDxQag","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Passed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password为空-http://36.139.193.99:8088/auth-POST-application/json-case_data6-expect_data6-None-None-None] | 0.02 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': ''}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账号或密码错误","code":200,"logId":"1831581877292081152"}
Passed | test_case/test_lao_zhang/test_bpm.py::TestBPM::test_bpm[认证接口-登录系统-中-反向用例-password为特殊字符-http://36.139.193.99:8088/auth-POST-application/json-case_data7-expect_data7-None-None-None] | 0.02 |
-------------------------------Captured log call-------------------------------- INFO 张三:test_bpm.py:66 断言成功，接口url为:http://36.139.193.99:8088/auth, 用例数据:{'username': 'admin', 'password': '#!$!@#!@#'}, 期望数据:{'message': '账号或密码错误'}, 服务器返回数据:{"state":false,"message":"账号或密码错误","code":200,"logId":"1831581877405327360"}