Commit 628eb1c1 by zyhmcbbs

version1.0

parent 9b05bd27
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: __init__.py
# Author: zhang
# Datetime: 2024/11/5 下午6:41
# Description:
#
# ---------------------------------------------------------------------------
import functools
import logging
import os
import time
def log():
logger = logging.getLogger()
logger.setLevel(logging.INFO)
report_path = os.path.join(os.path.dirname(__file__), "report")
log_path = os.path.join(report_path, "log")
log_name = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + ".log"
log_file_path = os.path.join(log_path, log_name)
handle = logging.FileHandler(filename=log_file_path, mode="a", encoding="utf-8")
formatter = logging.Formatter(
fmt="'%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s"
)
handle.setFormatter(formatter)
logger.addHandler(handle)
return logger
log = log()
def loger(func_name):
@functools.wraps(func_name) # 装饰器返回内部函数时,沿用被装饰者的名称
def inner(*args, **kwargs):
# __code__: 返回函数或方法的对象,可以获取函数或者方法的属性。
# __code__.co_filename:获取函数或方法所在的py文件
# __code__.co_firstlineno:获取函数或方法所在的py文件开始行号
log.info(
f"执行的功能为:{func_name.__name__}, 功能描述为:{func_name.__doc__}, 所在的py文件为:{func_name.__code__.co_filename}, 所在的行为:{func_name.__code__.co_firstlineno}行,形参的值为:{args}或{kwargs}")
try:
result = func_name(*args, **kwargs)
except Exception as e:
log.error(
f"执行的功能为:{func_name.__name__}, 功能描述为:{func_name.__doc__}, 所在的py文件为:{func_name.__code__.co_filename}, 所在的行为:{func_name.__code__.co_firstlineno}行,形参的值为:{args}或{kwargs}"
f"错误的类型为:{type(e)}, 错误的描述为:{e}")
raise e
else:
return result
return inner
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: __init__.py
# Author: zhang
# Datetime: 2024/11/5 下午6:41
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: db.py
# Author: zhang
# Datetime: 2024/11/5 下午7:39
# Description:
#
# ---------------------------------------------------------------------------
import pymysql
from APIAutoTest_v3_1.common.read_basic_ini import ReadBasicIni
from APIAutoTest_v3_1 import log
class DB:
def __init__(self):
"""链接数据库"""
ini = ReadBasicIni()
try:
self.conn = pymysql.connect(
host=ini.get_connect_sql_msg("host"),
port=int(ini.get_connect_sql_msg("port")),
user=ini.get_connect_sql_msg("user"),
password=ini.get_connect_sql_msg("pwd"),
database=ini.get_connect_sql_msg("database"),
charset="utf8"
)
self.cursor = self.conn.cursor()
except Exception as e:
log.error(f"链接数据库时出错,请求检查ini配置文件,发生的错误类型为:{type(e)}, 错误的描述为:{e}")
raise e
def delete(self, sql_sentence):
log.info(f"执行的方法为:delete,功能描述为:执行删除的sql语句,传入的参数为:{sql_sentence}")
if isinstance(sql_sentence, str) and sql_sentence.strip().lower().startswith("delete"):
try:
self.cursor.execute(sql_sentence)
self.conn.commit()
except Exception as e:
log.error(
f"执行的方法为:delete,功能描述为:执行删除的sql语句,传入的参数为:{sql_sentence}, 错误类型为:{type(e)}, 错误的描述为:{e}")
raise e
else:
log.error(f"执行的方法为:delete,功能描述为:执行删除的sql语句,传入的参数为:{sql_sentence}, 错误类型为:ValueError, 错误的描述为:sql语句错误")
raise ValueError("sql语句错误")
def select(self, sql_sentence):
log.info(f"执行的方法为:select,功能描述为:执行查询的sql语句,传入的参数为:{sql_sentence}")
if isinstance(sql_sentence, str) and sql_sentence.strip().lower().startswith("select"):
try:
self.cursor.execute(sql_sentence)
except Exception as e:
log.error(
f"执行的方法为:select,功能描述为:执行查询的sql语句,传入的参数为:{sql_sentence}, 错误类型为:{type(e)}, 错误的描述为:{e}")
raise e
else:
select_result = self.cursor.fetchall()
if select_result:
return select_result[0][0]
else:
log.error(f"执行的方法为:select,功能描述为:执行查询的sql语句,传入的参数为:{sql_sentence}, 错误类型为:ValueError, 错误的描述为:sql语句错误")
raise ValueError("sql语句错误")
\ No newline at end of file
import configparser
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: read_basic_ini.py
# Author: zhang
# Datetime: 2024/11/5 下午6:53
# Description:
#
# ---------------------------------------------------------------------------
import os
from APIAutoTest_v3_1 import loger
import configparser
class ReadBasicIni:
def __init__(self):
"""读取ini文件"""
self.data_config_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data_config')
basic_ini_path = os.path.join(self.data_config_path, 'basic_config.ini')
self.conf = configparser.ConfigParser()
self.conf.read(basic_ini_path, encoding='utf-8')
@loger
def get_host(self, key):
"""根据key获取host节点下被测系统的域名"""
try:
return self.conf.get("host", key)
except Exception as e:
raise e
@loger
def get_connect_sql_msg(self, key):
"""根据key获取sql节点下数据库的链接信息"""
try:
return self.conf.get("mysql", key)
except Exception as e:
raise e
if __name__ == '__main__':
read_basic_ini = ReadBasicIni()
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: read_excel.py
# Author: zhang
# Datetime: 2024/11/5 下午7:33
# Description:
#
# ---------------------------------------------------------------------------
import openpyxl
from APIAutoTest_v3_1 import log
from APIAutoTest_v3_1.common.read_json import read_json
from APIAutoTest_v3_1.common.read_basic_ini import ReadBasicIni
from APIAutoTest_v3_1.common.read_user_ini import ReadUserIni
class ReadExcel:
def __init__(self, user):
# 读取基础配置文件
self.ini = ReadUserIni(user)
# 读取json文件
case_data_path = self.ini.get_file_path("case")
expect_data_path = self.ini.get_file_path("expect")
sql_data_path = self.ini.get_file_path("sql")
self.case_data_dict = read_json(case_data_path)
self.expect_data_dict = read_json(expect_data_path)
self.sql_data_dict = read_json(sql_data_path)
# 读取excel文件路径和工作表名称
excel_path = self.ini.get_file_path("excel")
table_name = self.ini.get_table_name("name")
# 读取excel文件
try:
wb = openpyxl.load_workbook(excel_path)
self.ws = wb[table_name]
except Exception as e:
log.error(
f"获取excel的工作簿或工作表出错,excel的路径为:{excel_path},工作表名称为:{table_name},错误的类型为:{type(e)}, 错误的描述为:{e}")
raise e
def __get_cell_value(self, row, column):
# 获取指定单元格的数据,获取到之后去掉前后空格
log.info(f"开始获取第{row}行,{column}列的数据,使用的方法为__get_cell_value")
try:
cell_value = self.ws[column + str(row)].value
except Exception as e:
log.error(
f"获取单元格数据时错误,请检查excel文件或输入的行列数据,列为{column},行为{row},错误的类型为{type(e)},错误信息为{e}")
raise e
else:
# 判断单元格是否为空,非空为True
if cell_value is None:
return None
elif cell_value.strip():
return cell_value.strip()
def case_module_name(self, row):
# 获取b列模块名称
log.info(f"获取{row}行的模块名称,使用的方法为case_module_name")
return str(self.__get_cell_value(row, "b"))
def case_api_name(self, row):
# 获取c列接口名称
log.info(f"获取{row}行的接口名称,使用的方法为case_api_name")
return str(self.__get_cell_value(row, "c"))
def case_req_method(self, row):
# 获取f列的请求方法
log.info(f"获取{row}行的请求方法,使用的方法为case_req_method")
return self.__get_cell_value(row, "f")
def case_req_url(self, row):
# 获取g列的请求url
# 判断请求的url是否为url,为none返回none,不为none返回拼接的域名
log.info(f"获取{row}行的请求url,使用的方法为case_req_url")
path = self.__get_cell_value(row, "g")
if path:
return ReadBasicIni().get_host("bpm") + path
def case_req_mime(self, row):
# 获取h列的请求的媒体类型并转小写
log.info(f"获取{row}行的请求的媒体类型,使用的方法为case_req_mime")
mime_ = self.__get_cell_value(row, "h")
if mime_:
return mime_.lower()
def case_data_test(self, row):
# 获取i列的请求数据,如果模块名称、接口名称其中一个为none不提取用例数据
# 获取用例的key、模块名称、接口名称
log.info(f"获取{row}的请求数据,使用的方法为case_data_test")
data_key = self.__get_cell_value(row, "i")
module_name = self.case_module_name(row)
api_name = self.case_api_name(row)
if module_name and api_name and data_key:
# 提取用例数据并返回
return self.case_data_dict[module_name][api_name][data_key]
def except_data(self, row):
# 获取j列的期望数据
# 获取用例的key、模块名称、接口名称
log.info(f"获取{row}行的期望数据,使用的方法为except_data")
expect_data_key = self.__get_cell_value(row, "j")
module_name = self.case_module_name(row)
api_name = self.case_api_name(row)
if module_name and api_name and expect_data_key:
# 提取期望数据并返回
return self.expect_data_dict[module_name][api_name][expect_data_key]
def case_sql_data(self, row):
# 获取l列的sql语句
# 获取sql的key、模块名称、接口名称
log.info(f"获取{row}行的sql语句,使用的方法为case_sql_data")
sql_data = self.__get_cell_value(row, "l")
module_name = self.case_module_name(row)
api_name = self.case_api_name(row)
if module_name and api_name and sql_data:
# 提取sql数据并返回
return self.sql_data_dict[module_name][api_name][sql_data]
def case_sql_type(self, row):
# 获取m列的sql类型
log.info(f"获取{row}行的sql类型,使用的方法为case_sql_type")
sql_type = self.__get_cell_value(row, "k")
if sql_type:
return sql_type.lower()
def update_sql_key(self, rowq):
# 获取n列的sql更新key
log.info(f"获取{rowq}行的sql更新key,使用的方法为update_sql_key")
return self.__get_cell_value(rowq, "m")
def get_data(self):
# 获取excel中的所有数据
# 返回一个二维列表,列表中存放每行相关数据
log.info("获取excel中的所有用例数据,使用的方法为get_data")
# 定义一个空列表,存放所有数据
case_data = []
# 循环获取有数据的最大行
for row in range(2, self.ws.max_row + 1):
# 根据行号获取每行的测试数据
get_method = self.case_req_method(row)
get_url = self.case_req_url(row)
get_mime = self.case_req_mime(row)
get_case_data_test = self.case_data_test(row)
get_except_data = self.except_data(row)
get_sql_data = self.case_sql_data(row)
get_sql_type = self.case_sql_type(row)
get_update_sql_key = self.update_sql_key(row)
# 过滤空行,然后将数据插入之前的空列表中
if get_method and get_url and get_except_data:
case_data.append(
[
get_method,
get_url,
get_mime,
get_case_data_test,
get_except_data,
get_sql_data,
get_sql_type,
get_update_sql_key
]
)
else:
return case_data
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: read_json.py
# Author: zhang
# Datetime: 2024/11/5 下午7:20
# Description:
#
# ---------------------------------------------------------------------------
from APIAutoTest_v3_1 import log
import json
import os
def read_json(file_path):
"""读取json文件,将json文件的内容序列化为python对象在返回"""
log.info(f"执行Read_json函数,读取json文件,文件路径为{file_path}")
if isinstance(file_path, str) and os.path.isfile(file_path) and file_path.endswith(".json"):
with open(file_path, "r", encoding="utf-8") as f:
try:
return json.load(f)
except Exception as e:
log.error(f"执行Read_json函数,读取json文件失败,错误类型为{type(e)},错误信息为{e}")
else:
log.error(f"执行Read_json函数,读取json文件失败,文件路径不合法,文件路径为{file_path}")
raise FileNotFoundError(f"文件路径不合法,文件路径为{file_path}")
if __name__ == '__main__':
print(read_json(r"C:\Users\zyh\Desktop\test_case\APIAutoTest_v3_1\data_config\z1_data\case_data1.json"))
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test
# FileName: read_user_ini.py
# Author: zhang
# Datetime: 2024/11/5 下午7:05
# Description:
#
# ---------------------------------------------------------------------------
import os
from APIAutoTest_v3_1 import loger
import configparser
class ReadUserIni:
def __init__(self, user):
"""读取ini文件, 需要指明读取哪个用户的ini配置文件"""
self.data_config_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data_config')
self.user_path = os.path.join(self.data_config_path, user)
ini_path = os.path.join(self.user_path, "config.ini")
self.conf = configparser.ConfigParser()
self.conf.read(ini_path, encoding='utf-8')
@loger
def get_file_path(self, key):
"""根据key获取file节点下文件的路径"""
try:
file_name = self.conf.get('file', key)
except Exception as e:
raise e
else:
return os.path.join(self.user_path, file_name)
@loger
def get_table_name(self, key):
"""根据key获取table节点下工作表的名称"""
try:
return self.conf.get('table', key)
except Exception as e:
raise e
if __name__ == '__main__':
readuserini = ReadUserIni('z1_data')
print(readuserini.get_file_path('case'))
# 配置被测系统的域名
[host]
bpm=http://36.139.193.99:8088
# 数据库的链接信息
[mysql]
host=36.139.193.99
port=3306
user=root
pwd=Rhrc@2024
database=eip8
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: pythonProject
# FileName: setting.py
# Author: zhang
# Datetime: 2024/11/6 下午3:29
# Description:
#
# ---------------------------------------------------------------------------
NUMBER = 'A'
MODULE = "B"
API = "C"
TITLE = "D"
LEVEL = 'E'
METHOD = "F"
PATH = "G"
MIME = "H"
CASE = "I"
EXPECT = 'J'
SQLTYPE = "K"
SQL = "L"
UPDATEKEY = 'M'
# ===========ini配置文件内的数据================
EXCEL_NAME = "excel"
CASE_NAME = "case"
EXPECT_NAME = "expect"
SQL_NAME = 'sql'
TABLE_NAME = 'name'
HOST_NAME = 'bpm'
\ No newline at end of file
{
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"code": "test_add_dem1",
"description": "testDem",
"isDefault": 0,
"name": "测试添加的维度1"
}
},
"根据维度编码删除维度": {
"DleteDemSuccess": {
"ids": "需要更新"
},
"DeleteDemErrorIdIsNone": {
"ids": ""
}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"code": "test_add_org1",
"demId": "需要更新",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"name": "测试添加的组织1",
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
}
},
"删除组织": {
"DleteOrgSuccess": "test_add_org1"
},
"保存组织参数": {
"SaveOrgParamsSuccess": {
"query": {
"orgCode": "test_add_org1"
},
"body": [
{
"alias": "sz",
"value": 2
}
]
}
}
},
"用户管理": {
"添加用户": {
"AddUserSuccess": {
"id": "",
"account": "test_add_user1",
"address": "",
"email": "",
"fullname": "测试添加的用户1",
"mobile": "",
"password": "123456",
"photo": "",
"sex": "",
"status": 1
}
}
}
}
\ No newline at end of file
# 配置文件的名称
[file]
# 配置用例文件的路径
excel=APITest1.xlsx
case=case_data1.json
expect=expect_data1.json
# 配置sql语句信息
sql=sql_data1.json
# 配置excel文件工作表名称
[table]
name=维度和组织和用户接口测试
{
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"state": true,
"message": "添加维度成功!"
}
},
"根据维度编码删除维度": {
"DleteDemSuccess": {
"state": true,
"message": "删除维度成功!"
},
"DeleteDemErrorIdIsNone": {
"state": false,
"message": "维度id不能为空!"
}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"state": true,
"message": "添加组织成功!"
}
},
"删除组织": {
"DleteOrgSuccess": {
"state": true,
"message": "删除组织成功!"
}
},
"保存组织参数": {
"SaveOrgParamsSuccess": {
"state": true,
"message": "保存组织参数成功!"
}
}
},
"用户管理": {
"添加用户": {
"AddUserSuccess": {
"state": true,
"message": "用户添加成功!"
}
}
}
}
\ No newline at end of file
{
"维度管理": {
"添加维度": {
"AddDemSuccess": "delete from uc_demension where CODE_='test_add_dem1';"
},
"根据维度编码删除维度": {
"DleteDemSuccess": "select ID_ from uc_demension where CODE_='test_add_dem1';"
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"delete": "delete from uc_org where CODE_='test_add_org1';",
"select": "select ID_ from uc_demension where CODE_='test_add_dem1';"
}
}
},
"用户管理": {
"添加用户": {
"AddUserSuccess": "delete from uc_user where ACCOUNT_=\"test_add_user1\";"
}
}
}
\ No newline at end of file
{
"认证接口": {
"登录系统": {
"LoginSuccesss": {
"username": "admin",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
},
"LoginErrorPasswordIsError": {
"username": "admin",
"password": "VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3AmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDT"
},
"LoginErrorPasswordIsLong": {
"username": "admin",
"password": "VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg=VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg="
},
"LoginErrorPasswordIsShort": {
"username": "admin",
"password": "1"
},
"LoginErrorPasswordIsSpecial": {
"username": "admin",
"password": "✽✾✿❁❃❋❀⚘"
},
"LoginErrorPasswordIsnone": {
"username": "admin",
"password": ""
},
"LoginErrorUsernameIsError": {
"username": "a",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
},
"LoginErrorUsernameIsLong": {
"username": "adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadmin",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
},
"LoginErrorUsernameIsShort": {
"username": "ad",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
},
"LoginErrorUsernameIsSpecial": {
"username": "❋❀✾✿❁",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
},
"LoginErrorUsernameIsnone": {
"username": "",
"password": "TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s="
}
}
}
}
\ No newline at end of file
# 配置文件的名称
[file]
# 配置用例文件的路径
excel=APITest2.xlsx
case=case_data2.json
expect=expect_data2.json
# 配置sql语句信息
sql=sql_data2.json
# 配置excel文件工作表名称
[table]
name=认证接口测试
{
"认证接口": {
"登录系统": {
"LoginSuccesss": {
"username": "超级管理员",
"account": "admin"
},
"LoginErrorPasswordIsError": {
"state": false,
"message": "解密密码异常,请检查RSA公钥和私钥配置"
},
"LoginErrorPasswordIsLong": {
"state": false,
"message": "账号或密码错误"
},
"LoginErrorPasswordIsShort": {
"state": false,
"message": "账号或密码错误"
},
"LoginErrorPasswordIsSpecial": {
"state": false,
"message": "账号或密码错误"
},
"LoginErrorPasswordIsnone": {
"state": false,
"message": "账号或密码错误"
},
"LoginErrorUsernameIsError": {
"state": false,
"message": "账户错误或该租户未启用"
},
"LoginErrorUsernameIsLong": {
"state": false,
"message": "账户错误或该租户未启用"
},
"LoginErrorUsernameIsShort": {
"state": false,
"message": "账户错误或该租户未启用"
},
"LoginErrorUsernameIsSpecial": {
"state": false,
"message": "账户错误或该租户未启用"
},
"LoginErrorUsernameIsnone": {
"state": false,
"message": "账户错误或该租户未启用"
}
}
}
}
\ No newline at end of file
{"uuid": "96d1d715-ebdb-439a-b184-e1f8fd320a57", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547092, "stop": 1730876547092}], "start": 1730876547092, "stop": 1730876547116}
\ No newline at end of file
{"uuid": "f9c671cb-903c-4359-89e2-4757f6794fbd", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547249, "stop": 1730876547249}], "start": 1730876547249, "stop": 1730876547264}
\ No newline at end of file
{"uuid": "759fc03e-f929-4bd3-a923-aed7e5da2060", "befores": [{"name": "mime", "status": "passed", "start": 1730876546580, "stop": 1730876546581}], "start": 1730876546580, "stop": 1730876546630}
\ No newline at end of file
{"uuid": "a1aa67fd-cf48-44f1-bc73-92307e971487", "befores": [{"name": "url", "status": "passed", "start": 1730876547485, "stop": 1730876547485}], "start": 1730876547485, "stop": 1730876547522}
\ No newline at end of file
{"uuid": "d8f650aa-ffcf-4ab3-a964-2cba2655198f", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547579, "stop": 1730876547579}], "start": 1730876547579, "stop": 1730876547610}
\ No newline at end of file
{"uuid": "5b42983d-a70a-4af6-a065-e8a47f399319", "befores": [{"name": "case_data", "status": "passed", "start": 1730876547091, "stop": 1730876547091}], "start": 1730876547091, "stop": 1730876547118}
\ No newline at end of file
{"uuid": "cca6c75c-3f17-4220-bcbf-2fcf6ea0228b", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547444, "stop": 1730876547444}], "start": 1730876547444, "stop": 1730876547475}
\ No newline at end of file
{"uuid": "bb0e0102-3515-454c-b8a1-50a601780850", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547406, "stop": 1730876547406}], "start": 1730876547406, "stop": 1730876547437}
\ No newline at end of file
{"uuid": "50ba6607-c397-4d8c-8e49-d1e6b99344ba", "befores": [{"name": "mime", "status": "passed", "start": 1730876547526, "stop": 1730876547526}], "start": 1730876547526, "stop": 1730876547569}
\ No newline at end of file
{"uuid": "a550654a-8905-49a9-8aab-bbf69c5aef11", "befores": [{"name": "method", "status": "passed", "start": 1730876546635, "stop": 1730876546635}], "start": 1730876546635, "stop": 1730876546701}
\ No newline at end of file
{"uuid": "1d7d40b5-2c64-4eca-bb2e-b2da6cc559c9", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876547579, "stop": 1730876547579}], "start": 1730876547579, "stop": 1730876547609}
\ No newline at end of file
{"uuid": "0b40df5a-7296-45f7-8f53-311aa2382bc0", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547526, "stop": 1730876547526}], "start": 1730876547526, "stop": 1730876547565}
\ No newline at end of file
{"uuid": "abf57a8f-a8ce-4976-981c-c64e19a4a598", "befores": [{"name": "case_data", "status": "passed", "start": 1730876547444, "stop": 1730876547444}], "start": 1730876547444, "stop": 1730876547479}
\ No newline at end of file
{"uuid": "0342ab93-9d39-4a5b-92f5-a5640da1f274", "befores": [{"name": "url", "status": "passed", "start": 1730876547091, "stop": 1730876547091}], "start": 1730876547091, "stop": 1730876547119}
\ No newline at end of file
{"uuid": "3d9ef09c-e1d5-455d-a83f-bfafa3e40857", "befores": [{"name": "method", "status": "passed", "start": 1730876547274, "stop": 1730876547275}], "start": 1730876547274, "stop": 1730876547328}
\ No newline at end of file
{"uuid": "7dacbb49-7ec2-41bf-a373-8a5fd31eebf5", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547331, "stop": 1730876547331}], "start": 1730876547331, "stop": 1730876547356}
\ No newline at end of file
{"uuid": "c0010e24-da2a-43b8-bfa6-c678af6136d3", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547486, "stop": 1730876547486}], "start": 1730876547486, "stop": 1730876547518}
\ No newline at end of file
{"uuid": "c09009f2-7a47-482a-8832-6c3a8eae550b", "befores": [{"name": "mime", "status": "passed", "start": 1730876547275, "stop": 1730876547275}], "start": 1730876547275, "stop": 1730876547327}
\ No newline at end of file
{"uuid": "1cb40b6e-11ed-4f74-aced-a58a0e206927", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547526, "stop": 1730876547526}], "start": 1730876547526, "stop": 1730876547559}
\ No newline at end of file
{"uuid": "3a1c245e-e53d-4688-ba5e-1bad2b0bec7a", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876546809, "stop": 1730876546809}], "start": 1730876546809, "stop": 1730876546976}
\ No newline at end of file
{"uuid": "37cb9c8c-3fa7-498c-8bc8-574db4a1f95b", "befores": [{"name": "case_data", "status": "passed", "start": 1730876547485, "stop": 1730876547485}], "start": 1730876547485, "stop": 1730876547521}
\ No newline at end of file
{"uuid": "ce4f3587-6af7-476e-b2ad-a85a5f3c0f09", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547092, "stop": 1730876547092}], "start": 1730876547092, "stop": 1730876547114}
\ No newline at end of file
{"uuid": "8845676d-aa4e-45be-bf16-8006eeec8b18", "befores": [{"name": "case_data", "status": "passed", "start": 1730876546635, "stop": 1730876546635}], "start": 1730876546635, "stop": 1730876546699}
\ No newline at end of file
{"uuid": "fafdf3de-8df0-46ab-80fa-5feb916b0bf5", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876546581, "stop": 1730876546581}], "start": 1730876546581, "stop": 1730876546628}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/api/user/v1/user/addUser-json-case_data5-expect_data5-delete from uc_user where ACCOUNT_=\"test_add_user1\";-delete-None]", "status": "passed", "attachments": [{"name": "log", "source": "47593bae-7534-4f0f-a427-5519a9dc8090-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/api/user/v1/user/addUser'"}, {"name": "mime", "value": "'json'"}, {"name": "case_data", "value": "{'id': '', 'account': 'test_add_user1', 'address': '', 'email': '', 'fullname': '测试添加的用户1', 'mobile': '', 'password': '123456', 'photo': '', 'sex': '', 'status': 1}"}, {"name": "expect_data", "value": "{'state': True, 'message': '用户添加成功!'}"}, {"name": "sql_data", "value": "'delete from uc_user where ACCOUNT_=\"test_add_user1\";'"}, {"name": "sql_type", "value": "'delete'"}, {"name": "updata_key", "value": "None"}], "start": 1730876547035, "stop": 1730876547081, "uuid": "f941da6b-7991-4af1-b2dd-4052fd97ddff", "historyId": "4dfee95d6f1c765e67309c2fac89eab0", "testCaseId": "529c0aa78eaae214767e6feb4e97ba1f", "fullName": "test_case.test_z1.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z1"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z1.test_bpm"}]}
\ No newline at end of file
INFO  root:test_bpm.py:36 用例断言成功,返回结果为{'state': False, 'message': '账户错误或该租户未启用', 'code': 200, 'logId': '1854056017655603200'}
\ No newline at end of file
{"uuid": "3a81aff9-5eba-42d0-81e8-fc8373750251", "befores": [{"name": "mime", "status": "passed", "start": 1730876547206, "stop": 1730876547206}], "start": 1730876547206, "stop": 1730876547244}
\ No newline at end of file
{"uuid": "dce32f19-8d5f-4ebc-b071-327b42b156bb", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547578, "stop": 1730876547578}], "start": 1730876547578, "stop": 1730876547612}
\ No newline at end of file
{"uuid": "aebc7e25-eeae-41b6-9490-4df4703b02e4", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876547034, "stop": 1730876547034}], "start": 1730876547034, "stop": 1730876547082}
\ No newline at end of file
{"uuid": "05c62000-742e-411f-91f6-91c72cb1f582", "befores": [{"name": "url", "status": "passed", "start": 1730876546809, "stop": 1730876546809}], "start": 1730876546809, "stop": 1730876546981}
\ No newline at end of file
{"uuid": "1a8e3f80-faf9-4370-a8f4-290833587ee2", "befores": [{"name": "method", "status": "passed", "start": 1730876547405, "stop": 1730876547405}], "start": 1730876547405, "stop": 1730876547441}
\ No newline at end of file
{"uuid": "d3f6e722-bd9f-4ac1-8385-1f7e0f1369f2", "befores": [{"name": "url", "status": "passed", "start": 1730876546580, "stop": 1730876546580}], "start": 1730876546580, "stop": 1730876546631}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data5-expect_data5-None-None-None]", "status": "passed", "attachments": [{"name": "log", "source": "424ed50d-292f-40d0-ab47-7faff42be6ae-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'admin', 'password': ''}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547406, "stop": 1730876547436, "uuid": "fbc88b0d-b811-4838-887d-a3db77b6898b", "historyId": "ca40e9cfcc4754a55826d53d695e1929", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data4-expect_data4-None-None-None]", "status": "passed", "attachments": [{"name": "log", "source": "6e82f579-b287-4654-ac83-c5264b4e356d-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'admin', 'password': '✽✾✿❁❃❋❀⚘'}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547364, "stop": 1730876547395, "uuid": "93f37b39-a47a-4766-8a52-e8c566c21012", "historyId": "21b9a7673b965041a3472f9d7811013f", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
INFO  root:DB.py:48 执行的方法为:select,功能描述为:执行查询的sql语句,传入的参数为:select ID_ from uc_demension where CODE_='test_add_dem1';
INFO  root:test_bpm.py:36 用例断言成功,用例数据为{'ids': '1854056013708763136'},期望数据为{'state': True, 'message': '删除维度成功!'},服务器返回结果为删除维度成功!
\ No newline at end of file
{"uuid": "728d36bc-da19-4f33-aac8-182ff3a65ef4", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876546995, "stop": 1730876546995}], "start": 1730876546995, "stop": 1730876547027}
\ No newline at end of file
{"uuid": "4e45bec6-a797-431b-a4cf-2eded78685a5", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547034, "stop": 1730876547034}], "start": 1730876547034, "stop": 1730876547085}
\ No newline at end of file
{"uuid": "74e575f0-93af-49c6-a690-328154731a64", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876547363, "stop": 1730876547363}], "start": 1730876547363, "stop": 1730876547397}
\ No newline at end of file
{"uuid": "8e29030f-cd2b-46da-8212-ced5142f1dd8", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547406, "stop": 1730876547406}], "start": 1730876547406, "stop": 1730876547439}
\ No newline at end of file
{"uuid": "da21229c-5139-4abb-9311-506742805622", "befores": [{"name": "method", "status": "passed", "start": 1730876547578, "stop": 1730876547578}], "start": 1730876547578, "stop": 1730876547616}
\ No newline at end of file
{"uuid": "01fed45e-201f-493b-bac2-565af98360fa", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547249, "stop": 1730876547249}], "start": 1730876547249, "stop": 1730876547266}
\ No newline at end of file
{"uuid": "c765a9d6-528c-4147-a7b5-ee08173d693f", "befores": [{"name": "case_data", "status": "passed", "start": 1730876547526, "stop": 1730876547526}], "start": 1730876547526, "stop": 1730876547568}
\ No newline at end of file
{"uuid": "ecf5ff4b-c972-4079-a8cf-7e6e69a423c0", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547620, "stop": 1730876547620}], "start": 1730876547620, "stop": 1730876547742}
\ No newline at end of file
INFO  root:test_bpm.py:36 用例断言成功,返回结果为{'state': False, 'message': '解密密码异常,请检查RSA公钥和私钥配置', 'code': 200, 'logId': '1854056016435060736'}
\ No newline at end of file
{"uuid": "d5f428f8-2c36-4f84-bb19-a560c3ce5034", "befores": [{"name": "mime", "status": "passed", "start": 1730876547578, "stop": 1730876547578}], "start": 1730876547578, "stop": 1730876547614}
\ No newline at end of file
{"uuid": "8df04757-9011-4498-b707-84547b3eaea5", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876546635, "stop": 1730876546635}], "start": 1730876546635, "stop": 1730876546696}
\ No newline at end of file
{"uuid": "87621478-c900-4b36-8250-d57e93a8b672", "befores": [{"name": "case_data", "status": "passed", "start": 1730876547363, "stop": 1730876547363}], "start": 1730876547363, "stop": 1730876547399}
\ No newline at end of file
{"uuid": "00c3be86-5716-467c-a2f1-bf01c3fc04bb", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876546581, "stop": 1730876546581}], "start": 1730876546581, "stop": 1730876546626}
\ No newline at end of file
{"uuid": "1bf8956d-17ac-417e-a0e4-7bf070111833", "befores": [{"name": "url", "status": "passed", "start": 1730876547034, "stop": 1730876547034}], "start": 1730876547034, "stop": 1730876547087}
\ No newline at end of file
{"uuid": "0936b0fa-7082-4019-a3ab-eb22e0b75d82", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547275, "stop": 1730876547275}], "start": 1730876547275, "stop": 1730876547325}
\ No newline at end of file
{"uuid": "c1e66347-4e7d-4299-8874-495256ae9c54", "befores": [{"name": "method", "status": "passed", "start": 1730876547249, "stop": 1730876547249}], "start": 1730876547249, "stop": 1730876547271}
\ No newline at end of file
{"uuid": "401915cf-5c67-45ea-93f0-c021938c3084", "befores": [{"name": "mime", "status": "passed", "start": 1730876547034, "stop": 1730876547034}], "start": 1730876547034, "stop": 1730876547086}
\ No newline at end of file
INFO  root:test_bpm.py:36 用例断言成功,返回结果为{'state': False, 'message': '账号或密码错误', 'code': 200, 'logId': '1854056017152286720'}
\ No newline at end of file
{"uuid": "f098e733-c309-4edc-ba7a-1f4fd10ebd3b", "befores": [{"name": "mime", "status": "passed", "start": 1730876547331, "stop": 1730876547331}], "start": 1730876547331, "stop": 1730876547358}
\ No newline at end of file
{"name": "test_bpm[DELETE-http://36.139.193.99:8088/api/demension/v2/dem/deleteDemByIds-query-case_data6-expect_data6-None-None-None]", "status": "failed", "statusDetails": {"message": "AssertionError: assert '删除维度失败,维度ids必填' == '维度id不能为空!'\n \n - 维度id不能为空!\n + 删除维度失败,维度ids必填", "trace": "self = <APIAutoTest_v3_1.test_case.test_z1.test_bpm.TestBpm object at 0x000001C78ADF0740>, method = 'DELETE'\nurl = 'http://36.139.193.99:8088/api/demension/v2/dem/deleteDemByIds', mime = 'query', case_data = {'ids': ''}\nexpect_data = {'message': '维度id不能为空!', 'state': False}, sql_data = None, sql_type = None, updata_key = None\nreq_fix = <requests_study.homework.APIAutoTest_v3_1.requests_method.requests_method.RequestsMethod object at 0x000001C78B0F9970>\n\n @pytest.mark.parametrize(\"method,url,mime,case_data,expect_data,sql_data,sql_type,updata_key\",\n ReadExcel(USERNAME).get_data())\n def test_bpm(self, method, url, mime, case_data, expect_data, sql_data, sql_type, updata_key, req_fix):\n res = req_fix.request_all(\n method=method,\n url=url,\n mime=mime,\n case_data=case_data,\n sql_data=sql_data,\n sql_type=sql_type,\n updata_key=updata_key\n )\n try:\n for key in expect_data.keys():\n assert res.json().get(key) == expect_data[key]\n except Exception as e:\n log.error(f\"用例断言失败,用例数据为{case_data},期望数据为{expect_data},服务器返回结果为{res.json().get(key)}\")\n> raise e\n\ntest_case\\test_z1\\test_bpm.py:34: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <APIAutoTest_v3_1.test_case.test_z1.test_bpm.TestBpm object at 0x000001C78ADF0740>, method = 'DELETE'\nurl = 'http://36.139.193.99:8088/api/demension/v2/dem/deleteDemByIds', mime = 'query', case_data = {'ids': ''}\nexpect_data = {'message': '维度id不能为空!', 'state': False}, sql_data = None, sql_type = None, updata_key = None\nreq_fix = <requests_study.homework.APIAutoTest_v3_1.requests_method.requests_method.RequestsMethod object at 0x000001C78B0F9970>\n\n @pytest.mark.parametrize(\"method,url,mime,case_data,expect_data,sql_data,sql_type,updata_key\",\n ReadExcel(USERNAME).get_data())\n def test_bpm(self, method, url, mime, case_data, expect_data, sql_data, sql_type, updata_key, req_fix):\n res = req_fix.request_all(\n method=method,\n url=url,\n mime=mime,\n case_data=case_data,\n sql_data=sql_data,\n sql_type=sql_type,\n updata_key=updata_key\n )\n try:\n for key in expect_data.keys():\n> assert res.json().get(key) == expect_data[key]\nE AssertionError: assert '删除维度失败,维度ids必填' == '维度id不能为空!'\nE \nE - 维度id不能为空!\nE + 删除维度失败,维度ids必填\n\ntest_case\\test_z1\\test_bpm.py:31: AssertionError"}, "attachments": [{"name": "log", "source": "588fba68-4dcf-429f-a9e6-be39a702269b-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'DELETE'"}, {"name": "url", "value": "'http://36.139.193.99:8088/api/demension/v2/dem/deleteDemByIds'"}, {"name": "mime", "value": "'query'"}, {"name": "case_data", "value": "{'ids': ''}"}, {"name": "expect_data", "value": "{'state': False, 'message': '维度id不能为空!'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547092, "stop": 1730876547106, "uuid": "f930505e-cabe-4a65-9791-44b36d5cb990", "historyId": "8f200ca3b399202a3f0140a1768b3848", "testCaseId": "529c0aa78eaae214767e6feb4e97ba1f", "fullName": "test_case.test_z1.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z1"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z1.test_bpm"}]}
\ No newline at end of file
{"uuid": "e4e8ac7e-53c5-422a-96b5-80efd51e87ae", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547485, "stop": 1730876547485}], "start": 1730876547485, "stop": 1730876547519}
\ No newline at end of file
INFO  root:DB.py:34 执行的方法为:delete,功能描述为:执行删除的sql语句,传入的参数为:delete from uc_user where ACCOUNT_="test_add_user1";
INFO  root:test_bpm.py:36 用例断言成功,用例数据为{'id': '', 'account': 'test_add_user1', 'address': '', 'email': '', 'fullname': '测试添加的用户1', 'mobile': '', 'password': '123456', 'photo': '', 'sex': '', 'status': 1},期望数据为{'state': True, 'message': '用户添加成功!'},服务器返回结果为用户添加成功!
\ No newline at end of file
{"uuid": "50018b57-79ae-473f-acfb-7c48bc6e60df", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876547406, "stop": 1730876547406}], "start": 1730876547406, "stop": 1730876547436}
\ No newline at end of file
{"uuid": "a4a849d6-19d4-4ab7-abc7-778ffd949b4b", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876546809, "stop": 1730876546809}], "start": 1730876546809, "stop": 1730876546978}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data1-expect_data1-None-None-None]", "status": "passed", "attachments": [{"name": "log", "source": "364ecc2e-2910-4696-8d28-ffc524e3a996-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'admin', 'password': 'VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3AmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDT'}"}, {"name": "expect_data", "value": "{'state': False, 'message': '解密密码异常,请检查RSA公钥和私钥配置'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547250, "stop": 1730876547263, "uuid": "04954c0c-823f-4a1c-944c-b8e15fc4e0e8", "historyId": "bcdac871da97806e6fa8d8409123a6b4", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
{"uuid": "e89b1d70-f6f2-4f69-aeae-b599ca77ab4d", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876547444, "stop": 1730876547444}], "start": 1730876547444, "stop": 1730876547473}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data2-expect_data2-None-None-None]", "status": "failed", "statusDetails": {"message": "AssertionError: assert None == False\n + where None = <built-in method get of dict object at 0x000001C78B062000>('state')\n + where <built-in method get of dict object at 0x000001C78B062000> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...UsImlhdCI6MTczMDg3NjM3NX0.jGt7YJA4Iq1ce58boV3uz1El1fv5CIAM6-MI_7rhr__TqlLCoJEO6I9Ls6VQKpLRv-HSWFNyhY0bgbRrkbyDHQ', ...}.get\n + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...UsImlhdCI6MTczMDg3NjM3NX0.jGt7YJA4Iq1ce58boV3uz1El1fv5CIAM6-MI_7rhr__TqlLCoJEO6I9Ls6VQKpLRv-HSWFNyhY0bgbRrkbyDHQ', ...} = json()\n + where json = <Response [200]>.json", "trace": "self = <APIAutoTest_v3_1.test_case.test_z2.test_bpm.TestBpm object at 0x000001C78B0FBC80>, method = 'post'\nurl = 'http://36.139.193.99:8088/auth', mime = 'application/json'\ncase_data = {'password': 'VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzw...5wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg=', 'username': 'admin'}\nexpect_data = {'message': '账号或密码错误', 'state': False}, sql_data = None, sql_type = None, updata_key = None\nreq_fix = <requests_study.homework.APIAutoTest_v3_1.requests_method.requests_method.RequestsMethod object at 0x000001C78B0EAC90>\n\n @pytest.mark.parametrize(\"method,url,mime,case_data,expect_data,sql_data,sql_type,updata_key\",\n ReadExcel(USERNAME).get_data())\n def test_bpm(self, method, url, mime, case_data, expect_data, sql_data, sql_type, updata_key, req_fix):\n res = req_fix.request_all(\n method=method,\n url=url,\n mime=mime,\n case_data=case_data,\n sql_data=sql_data,\n sql_type=sql_type,\n updata_key=updata_key\n )\n try:\n for key in expect_data.keys():\n assert res.json().get(key) == expect_data[key]\n except Exception as e:\n log.error(f\"用例断言失败,错误信息为{e}\")\n> raise e\n\ntest_case\\test_z2\\test_bpm.py:34: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <APIAutoTest_v3_1.test_case.test_z2.test_bpm.TestBpm object at 0x000001C78B0FBC80>, method = 'post'\nurl = 'http://36.139.193.99:8088/auth', mime = 'application/json'\ncase_data = {'password': 'VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzw...5wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg=', 'username': 'admin'}\nexpect_data = {'message': '账号或密码错误', 'state': False}, sql_data = None, sql_type = None, updata_key = None\nreq_fix = <requests_study.homework.APIAutoTest_v3_1.requests_method.requests_method.RequestsMethod object at 0x000001C78B0EAC90>\n\n @pytest.mark.parametrize(\"method,url,mime,case_data,expect_data,sql_data,sql_type,updata_key\",\n ReadExcel(USERNAME).get_data())\n def test_bpm(self, method, url, mime, case_data, expect_data, sql_data, sql_type, updata_key, req_fix):\n res = req_fix.request_all(\n method=method,\n url=url,\n mime=mime,\n case_data=case_data,\n sql_data=sql_data,\n sql_type=sql_type,\n updata_key=updata_key\n )\n try:\n for key in expect_data.keys():\n> assert res.json().get(key) == expect_data[key]\nE AssertionError: assert None == False\nE + where None = <built-in method get of dict object at 0x000001C78B062000>('state')\nE + where <built-in method get of dict object at 0x000001C78B062000> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...UsImlhdCI6MTczMDg3NjM3NX0.jGt7YJA4Iq1ce58boV3uz1El1fv5CIAM6-MI_7rhr__TqlLCoJEO6I9Ls6VQKpLRv-HSWFNyhY0bgbRrkbyDHQ', ...}.get\nE + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...UsImlhdCI6MTczMDg3NjM3NX0.jGt7YJA4Iq1ce58boV3uz1El1fv5CIAM6-MI_7rhr__TqlLCoJEO6I9Ls6VQKpLRv-HSWFNyhY0bgbRrkbyDHQ', ...} = json()\nE + where json = <Response [200]>.json\n\ntest_case\\test_z2\\test_bpm.py:31: AssertionError"}, "attachments": [{"name": "log", "source": "7e257c4a-0185-46ec-9ad5-0ce266c0e8e5-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'admin', 'password': 'VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg=VsQ2gtK1fYOiCv1QU5qfMAKFlVXz7UBerKlrtStkhxo3W/T6NQCAmgklcIGUiwzcWi9gCRauKUn65wWlR7GZ39OXIuZ7uepazQ3MCTzwShuesIgM2ull8n9kMBYtiiio2/WCpXfjDJfcl2r9L/z8TH35AFZGf1D/lgC5PWPnDTg='}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547276, "stop": 1730876547315, "uuid": "31e02d0b-b2f1-4166-8e55-c7fba8d5397a", "historyId": "82f85d7dc53a0d8ecc0cff6807a349c9", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
{"uuid": "c6d0a4c9-7a20-4931-8153-f6802a6a2466", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876546581, "stop": 1730876546581}], "start": 1730876546581, "stop": 1730876546629}
\ No newline at end of file
{"uuid": "784413d2-e3e4-4a64-b506-0dda5fa0ece6", "befores": [{"name": "sql_type", "status": "passed", "start": 1730876546995, "stop": 1730876546995}], "start": 1730876546995, "stop": 1730876547027}
\ No newline at end of file
{"uuid": "69b10c10-adc4-4b13-886a-484ec6fd4faa", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876546705, "stop": 1730876546705}], "start": 1730876546705, "stop": 1730876546742}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data3-expect_data3-None-None-None]", "status": "passed", "attachments": [{"name": "log", "source": "e3bace53-5954-4756-8c53-020221612d54-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'admin', 'password': '1'}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547332, "stop": 1730876547353, "uuid": "77348f04-43f5-4b78-ba82-e86527886645", "historyId": "a9a2db5af6a631f249bab114446a589f", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
{"uuid": "2dabba46-2cd8-4495-8f20-0ef57632b6e0", "befores": [{"name": "method", "status": "passed", "start": 1730876547526, "stop": 1730876547526}], "start": 1730876547526, "stop": 1730876547572}
\ No newline at end of file
{"uuid": "98d28a60-5ab0-4adf-9d2d-66e2d9ded316", "befores": [{"name": "updata_key", "status": "passed", "start": 1730876547621, "stop": 1730876547621}], "start": 1730876547620, "stop": 1730876547650}
\ No newline at end of file
INFO  root:test_bpm.py:36 用例断言成功,返回结果为{'state': False, 'message': '账户错误或该租户未启用', 'code': 200, 'logId': '1854056017311670272'}
\ No newline at end of file
{"uuid": "29177118-c484-48c5-8eb7-0a2493172b46", "befores": [{"name": "mime", "status": "passed", "start": 1730876547405, "stop": 1730876547406}], "start": 1730876547405, "stop": 1730876547440}
\ No newline at end of file
{"uuid": "8f3fd228-def2-44e3-99f7-17472730a533", "befores": [{"name": "expect_data", "status": "passed", "start": 1730876547620, "stop": 1730876547620}], "start": 1730876547620, "stop": 1730876547743}
\ No newline at end of file
{"name": "test_bpm[post-http://36.139.193.99:8088/auth-application/json-case_data6-expect_data6-None-None-None]", "status": "passed", "attachments": [{"name": "log", "source": "5432acea-1bf3-4982-9012-1cc14b367bf4-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "method", "value": "'post'"}, {"name": "url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'a', 'password': 'TVxOIhZuEEK7mYDtN4hvwrl7gm/AzvX416cuwQ8iDKhgJ+6znIbvpuL+NvwOS8QnjANFFHCHMT3rNuToyde2Ftw0XUiNbcdCf88Wm61ppsvnTgaBAtwrPZsJ4cCjuBQZzEqHbh7/ylFUCYL5oVdgG445Ao1XRbX95gTgOykun3s='}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账户错误或该租户未启用'}"}, {"name": "sql_data", "value": "None"}, {"name": "sql_type", "value": "None"}, {"name": "updata_key", "value": "None"}], "start": 1730876547445, "stop": 1730876547473, "uuid": "07109e65-91b9-4b1f-9596-914b3fb302b4", "historyId": "efef61af5e3190b506eb2f69f48c26da", "testCaseId": "e7b6679a40124586762ee51d79eb00c4", "fullName": "test_case.test_z2.test_bpm.TestBpm#test_bpm", "labels": [{"name": "parentSuite", "value": "test_case.test_z2"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "DESKTOP-2NSIU9K"}, {"name": "thread", "value": "13552-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_z2.test_bpm"}]}
\ No newline at end of file
{"uuid": "84a4889c-8964-4697-8906-856c2afccaa2", "befores": [{"name": "sql_data", "status": "passed", "start": 1730876547444, "stop": 1730876547444}], "start": 1730876547444, "stop": 1730876547476}
\ No newline at end of file
ERROR  root:test_bpm.py:33 用例断言失败,用例数据为{'ids': ''},期望数据为{'state': False, 'message': '维度id不能为空!'},服务器返回结果为删除维度失败,维度ids必填
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment