Commit 56a549ca by Rikka

ApiAutoTest-v1

parent 9760875e
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: __init__.py
# Author: Rikka
# Datetime: 2024/7/13 14:19
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
from APIAutoTest_v3_1_multi_user.common.log import get_log
log = get_log()
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: db.py
# Author: Rikka
# Datetime: 2024/7/13 10:20
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import pymysql
from APIAutoTest_v3_1_multi_user.common.read_basic_ini import ReadBasicIni
class DB:
def __init__(self):
"""链接数据库,获取链接对象,再获取游标对象"""
ini = ReadBasicIni()
self.conn = pymysql.connect(
host=ini.sql_connect_msg("host"),
port=int(ini.sql_connect_msg("port")),
user=ini.sql_connect_msg("user"),
password=ini.sql_connect_msg("pwd"),
database=ini.sql_connect_msg("database"),
charset="utf8"
)
self.cursor = self.conn.cursor()
def close(self):
self.cursor.close()
self.conn.close()
def delete(self, sql_sentence):
try:
self.cursor.execute(sql_sentence)
except Exception as e:
raise e
else:
self.conn.commit()
def select(self, sql_sentence):
try:
self.cursor.execute(sql_sentence)
except Exception as e:
raise e
else:
select_result = self.cursor.fetchall()
if select_result:
return select_result[0][0]
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: log.py
# Author: Rikka
# Datetime: 2024/7/13 14:17
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import logging
import os
import time
from APIAutoTest_v3_1_multi_user.common.read_basic_ini import ReadBasicIni
def get_log():
# 将日志写入到文件中---流程
# 创建logger
logger = logging.getLogger()
# 设置日志文件中写入的级别
logger.setLevel(level=logging.DEBUG)
# 需要设置日志的名称
log_name = time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime(time.time())) + ".log"
# 获取日志的目录
log_dir = ReadBasicIni().get_log("log")
# 日志路径拼接
log_path = os.path.join(log_dir, log_name)
# 设置日志文件
file_handler = logging.FileHandler(log_path, mode="a", encoding="utf-8")
# 设置日志在文件中显示的格式
log_format = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
# 将日志设置格式添加到日志文件中
file_handler.setFormatter(log_format)
# 将日志文件的handler添加到logger对象中
logger.addHandler(file_handler)
return logger
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: read_basic_ini.py
# Author: Rikka
# Datetime: 2024/7/13 11:29
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import configparser
import os.path
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")
def get_url(self, key):
try:
return self.conf.get("host", key)
except Exception as e:
raise e
def sql_connect_msg(self, key):
try:
return self.conf.get("sql", key)
except Exception as e:
raise e
def get_log(self, key):
try:
# 获取日志存放的目录名称
dir_name = self.conf.get("report", key)
except Exception as e:
raise e
else:
# 获取report目录路径
report_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report")
# 拼接日志文件的目录路径,再返回
return os.path.join(report_path, dir_name)
\ No newline at end of file
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: read_excel.py
# Author: Rikka
# Datetime: 2024/7/13 10:32
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import openpyxl
from APIAutoTest_v3_1_multi_user import log
from APIAutoTest_v3_1_multi_user.common.read_basic_ini import ReadBasicIni
from APIAutoTest_v3_1_multi_user.common.read_ini import ReadIni
from APIAutoTest_v3_1_multi_user.common.read_json import read_json
class ReadExcel:
def __init__(self, username):
"""
1:加载excel的工作簿,再获取工作表
2: 获取所有json文件的路径,并读取所有的json文件,将json文件的数据赋值给一个变量。
"""
self.ini = ReadIni(username)
self.basic_ini = ReadBasicIni()
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")
excel_path = self.ini.get_file_path("excel")
table_name = self.ini.get_table_name("table")
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)
try:
wb = openpyxl.load_workbook(excel_path)
self.ws = wb[table_name]
except Exception as e:
log.error(f"获取excel工作簿或工作表时报错,错误为:{e}")
raise e
def __get_cell_value(self, column:str ,row:int) -> str:
"""
获取指定单元格数据
:param column: 列号
:param row: 行号
:return: str|None
"""
try:
cell_value = self.ws[column+str(row)].value
except Exception as e:
log.error(f"获取单元格数据时报错,错误为:{e}")
raise e
else:
# 判断单元格数据是否为None,如果是返回None
if cell_value is None:
return None
# 判断单元格数据去掉前后空格之后是否为空的字符串,如果是空的字符串,返回None,如果不是空的字符串返回去掉前后空格的数据
elif cell_value.strip():
return cell_value.strip()
def module_name(self, row):
"""根据行号,获取模块名称"""
return self.__get_cell_value("b", row)
def api_name(self, row):
"""根据行号获取接口名称"""
return self.__get_cell_value("c", row)
def case_title(self, row):
"""根据行号,获取用例标题"""
return self.__get_cell_value("d", row)
def case_level(self, row):
"""根据行号,获取用例等级"""
return self.__get_cell_value("e", row)
def req_method(self, row):
"""根据行号,获取用例的请求方法"""
return self.__get_cell_value("f", row)
def req_url(self, row):
"""根据行号,获取用例请求的url"""
host = self.basic_ini.get_url("test_host")
path = self.__get_cell_value("g", row)
# 判断用例的请求路径是否为None,如果为None返回None,如果不为None,进行url的拼接
if path:
return host + path
def case_mime(self, row):
"""根据行号,获取用例的媒体类型"""
mime = self.__get_cell_value("h", row)
# 判断用例的媒体类型的值是否为None,如果为None,返回None,如果不为None,将媒体类型的值转小写,再返回
if mime:
return mime.lower()
def case_data(self, row):
"""根据行号,获取用例数据"""
case_data_key = self.__get_cell_value("i", row)
if case_data_key:
module_name = self.module_name(row)
api_name = self.api_name(row)
return self.case_data_dict[module_name][api_name][case_data_key]
def expect_data(self, row):
"""根据行号,获取期望数据"""
expect_data_key = self.__get_cell_value("j", row)
if expect_data_key:
module_name = self.module_name(row)
api_name = self.api_name(row)
return self.expect_data_dict[module_name][api_name][expect_data_key]
def sql_type(self, row):
"""根据行号获取sql语句的类型"""
sql_type = self.__get_cell_value("k", row)
if sql_type:
return sql_type.lower()
def sql_data(self, row):
"""根据行号,获取期望数据"""
sql_data_key = self.__get_cell_value("l", row)
if sql_data_key:
module_name = self.module_name(row)
api_name = self.api_name(row)
return self.sql_data_dict[module_name][api_name][sql_data_key]
def update_key(self, row):
"""根据行号,获取用例更新的key"""
return self.__get_cell_value("m", row)
def get_data(self):
data_list = []
for row in range(2, self.ws.max_row + 1):
module_name = self.module_name(row)
api_name = self.api_name(row)
case_title = self.case_title(row)
case_level = self.case_level(row)
case_method = self.req_method(row)
case_url = self.req_url(row)
case_mime = self.case_mime(row)
case_data = self.case_data(row)
expect_data = self.expect_data(row)
sql_type = self.sql_type(row)
sql_data = self.sql_data(row)
update_key = self.update_key(row)
# 过滤空行--如果请求方法或请求的路径为None就是空行
if case_method is not None and case_url is not None:
data_list.append([module_name, api_name, case_title, case_level, case_method, case_url, case_mime, case_data, expect_data, sql_type, sql_data, update_key])
else:
return data_list
if __name__ == '__main__':
excel = ReadExcel("六花")
print(excel.get_data())
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: read_ini.py
# Author: Rikka
# Datetime: 2024/7/13 10:10
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import configparser
import os.path
from APIAutoTest_v3_1_multi_user import log
class ReadIni:
def __init__(self, username):
self.data_config_path_user = os.path.join(os.path.join(os.path.dirname(os.path.dirname(__file__)), "data_config"), username)
ini_path = os.path.join(self.data_config_path_user, "config.ini")
self.conf = configparser.ConfigParser()
self.conf.read(ini_path, encoding="utf-8")
def get_file_path(self, key):
try:
file_name = self.conf.get("file", key)
except Exception as e:
log.error(f"获取测试数据路径时报错,错误为:{e}")
raise e
else:
return os.path.join(self.data_config_path_user, file_name)
def get_table_name(self, key):
try:
return self.conf.get("table_name", key)
except Exception as e:
log.error(f"获取工作表名称时报错,错误为:{e}")
raise e
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: Software_Testing
# FileName: read_json.py
# Author: Rikka
# Datetime: 2024/7/13 10:17
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import json
import os.path
from APIAutoTest_v3_1_multi_user import log
def read_json(file_path):
if os.path.isfile(file_path) and file_path.endswith(".json"):
try:
with open(file_path, mode="r", encoding="utf_8") as f:
return json.load(f)
except Exception as e:
log.error(f"读取json文件时报错,错误为:{e}")
raise e
else:
raise FileNotFoundError("文件路径错误")
{
"认证接口":{
"登录系统":{
"LoginSuccess":{"username":"admin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsNone":{"username":"","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsShort":{"username":"a","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsLong":{"username":"adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadmin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsSpecial":{"username":"♡♣♤♥♦♧♨♩ε","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailPwdIsNone":{"username":"admin","password":""},
"LoginFailPwdIsShort":{"username":"admin","password":"1"},
"LoginFailPwdIsLong":{"username":"admin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8=F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"code": "test_dem_xyz_123","description": "测试维度","isDefault": 0, "name": "xyz测试维度"}
},
"设置默认维度": {
"SetDefaultDemSuccess": {"code": "test_dem_xyz_123"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"ids": "需要更新"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"code": "test_org",
"demId": "需要更新",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"name": "测试组织",
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
}
},
"保存组织参数": {
"SaveOrgParamSuccess": {
"query": {"orgCode": "test_org"},
"body": [{"alias":"sr","value":"dog"}]
}
},
"删除组织": {
"DeleteOrgSuccess": "test_org"
}
}
}
\ No newline at end of file
[节点名称]
键=值
# 配置数据层中文件的节点
[file]
# 用例管理文件
excel=APIAutoTest_六花.xlsx
# 用例数据文件
case=case_data.json
# 期望数据文件
expect=expect.json
# sql语句文件
sql=sql_data.json
# 配置excel中工作表的名称
[table_name]
table=BPM
{
"认证接口":{
"登录系统":{
"LoginSuccess": {"username":"超级管理员","account":"admin","userId":"1","expiration":86400},
"LoginFailUsernameIsNone":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsShort":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsLong":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsSpecial":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsNone":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsShort":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsLong":{"state":false,"message":"账户错误或该租户未启用"}
},
"刷新token": {
"RefreshSuccess": {"message": "刷新成功"}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"message": "添加维度成功!"}
},
"设置默认维度": {
"SetDefaultDemSuccess": {"message": "设置默认维度成功!"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"message": "删除维度成功!"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {"message": "添加组织成功!"}
},
"保存组织参数": {
"SaveOrgParamSuccess": {"state":true,"message":"保存组织参数成功!"}
},
"删除组织": {
"DeleteOrgSuccess": {"state":true,"message":"删除组织成功!"}
}
}
}
\ No newline at end of file
{
"维度管理": {
"添加维度": {
"AddDemSuccess": "DELETE FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";"
},
"根据维度编码删除维度": {
"DeleteDemSuccess": "SELECT ID_ FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";"
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"select": "SELECT ID_ FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";",
"delete": "delete from uc_org where CODE_=\"test_org\";"
}
}
}
}
{
"认证接口":{
"登录系统":{
"LoginSuccess":{"username":"admin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsNone":{"username":"","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsShort":{"username":"a","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsLong":{"username":"adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadmin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailUsernameIsSpecial":{"username":"♡♣♤♥♦♧♨♩ε","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="},
"LoginFailPwdIsNone":{"username":"admin","password":""},
"LoginFailPwdIsShort":{"username":"admin","password":"1"},
"LoginFailPwdIsLong":{"username":"admin","password":"F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8=F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8="}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"code": "test_dem_xyz_123","description": "测试维度","isDefault": 0, "name": "xyz测试维度"}
},
"设置默认维度": {
"SetDefaultDemSuccess": {"code": "test_dem_xyz_123"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"ids": "需要更新"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"code": "test_org",
"demId": "需要更新",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"name": "测试组织",
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
}
},
"保存组织参数": {
"SaveOrgParamSuccess": {
"query": {"orgCode": "test_org"},
"body": [{"alias":"sr","value":"dog"}]
}
},
"删除组织": {
"DeleteOrgSuccess": "test_org"
}
}
}
\ No newline at end of file
[节点名称]
键=值
# 配置数据层中文件的节点
[file]
# 用例管理文件
excel=APIAutoTest_十花.xlsx
# 用例数据文件
case=case_data.json
# 期望数据文件
expect=expect.json
# sql语句文件
sql=sql_data.json
# 配置excel中工作表的名称
[table_name]
table=BPM
{
"认证接口":{
"登录系统":{
"LoginSuccess": {"username":"超级管理员","account":"admin","userId":"1","expiration":86400},
"LoginFailUsernameIsNone":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsShort":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsLong":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailUsernameIsSpecial":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsNone":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsShort":{"state":false,"message":"账户错误或该租户未启用"},
"LoginFailPwdIsLong":{"state":false,"message":"账户错误或该租户未启用"}
},
"刷新token": {
"RefreshSuccess": {"message": "刷新成功"}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"message": "添加维度成功!"}
},
"设置默认维度": {
"SetDefaultDemSuccess": {"message": "设置默认维度成功!"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"message": "删除维度成功!"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {"message": "添加组织成功!"}
},
"保存组织参数": {
"SaveOrgParamSuccess": {"state":true,"message":"保存组织参数成功!"}
},
"删除组织": {
"DeleteOrgSuccess": {"state":true,"message":"删除组织成功!"}
}
}
}
\ No newline at end of file
{
"维度管理": {
"添加维度": {
"AddDemSuccess": "DELETE FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";"
},
"根据维度编码删除维度": {
"DeleteDemSuccess": "SELECT ID_ FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";"
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"select": "SELECT ID_ FROM uc_demension WHERE `CODE_`=\"test_dem_xyz_123\";",
"delete": "delete from uc_org where CODE_=\"test_org\";"
}
}
}
}
# 配置被测系统的域名
[host]
test_host=http://36.139.193.99:8088
[sql]
host=36.139.193.99
port=3306
user=root
pwd=Rhrc@2024
database=eip8
[report]
log = result_log
\ No newline at end of file
{"uuid": "78062bbb-dfcc-4e7b-b20d-704453dd40f7", "befores": [{"name": "module_name", "status": "passed", "start": 1721036134739, "stop": 1721036134739}], "start": 1721036134739, "stop": 1721036134777}
\ No newline at end of file
{"uuid": "0ade65d4-7a04-4f87-86f5-2a814f82a832", "befores": [{"name": "case_title", "status": "passed", "start": 1721036135510, "stop": 1721036135510}], "start": 1721036135510, "stop": 1721036135553}
\ No newline at end of file
{"uuid": "83686caf-637b-4362-b206-d7d8021901c6", "befores": [{"name": "case_title", "status": "passed", "start": 1721036135837, "stop": 1721036135837}], "start": 1721036135837, "stop": 1721036135872}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "POST /api/org/v1/org/addOrg HTTP/11" 200 None
\ No newline at end of file
{"uuid": "1dba113b-ef4f-4f9b-a7c4-4dd47322090a", "befores": [{"name": "sql_type", "status": "passed", "start": 1721036135164, "stop": 1721036135164}], "start": 1721036135164, "stop": 1721036135218}
\ No newline at end of file
{"uuid": "624fb8b1-b931-4de0-8a79-3bae619c91d8", "befores": [{"name": "sql_data", "status": "passed", "start": 1721036135837, "stop": 1721036135837}], "start": 1721036135837, "stop": 1721036135866}
\ No newline at end of file
{"name": "反向用例-用户名过短-密码正确", "status": "passed", "attachments": [{"name": "log", "source": "0f20b2fe-ba1c-4a84-b45d-e90863e022ef-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "fa53fec8-6eda-41a2-b37d-ce7ae0c39089-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'认证接口'"}, {"name": "api_name", "value": "'登录系统'"}, {"name": "case_title", "value": "'反向用例-用户名过短-密码正确'"}, {"name": "case_level", "value": "'中'"}, {"name": "case_method", "value": "'POST'"}, {"name": "case_url", "value": "'http://36.139.193.99:8088/auth'"}, {"name": "case_mime", "value": "'application/json'"}, {"name": "case_data", "value": "{'username': 'a', 'password': 'F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8='}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账户错误或该租户未启用'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1721036134699, "stop": 1721036134725, "uuid": "02c16c95-350a-4c6e-8143-ad6557e5693f", "historyId": "6b2bcaa38d1ec30a3a16b8ff54cb64ec", "testCaseId": "cf44f8fd2d1cae3c5e3a386f65315e58", "fullName": "test_case.test_rikka.test_case.TestBpm#test_bpm", "labels": [{"name": "feature", "value": "认证接口"}, {"name": "story", "value": "登录系统"}, {"name": "severity", "value": "中"}, {"name": "epic", "value": "BPM-Rikka"}, {"name": "parentSuite", "value": "test_case.test_rikka"}, {"name": "suite", "value": "test_case"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_rikka.test_case"}]}
\ No newline at end of file
{"uuid": "28164cf5-e8b7-4537-82e8-49d881225d1b", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135279, "stop": 1721036135279}], "start": 1721036135279, "stop": 1721036135351}
\ No newline at end of file
{"uuid": "f30dd72b-b91e-423e-8f89-05304ac58877", "befores": [{"name": "sql_data", "status": "passed", "start": 1721036135773, "stop": 1721036135773}], "start": 1721036135773, "stop": 1721036135824}
\ No newline at end of file
{"uuid": "83abdf17-050d-4680-bc8c-61512a779829", "befores": [{"name": "expect_data", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134829, "stop": 1721036135091}
\ No newline at end of file
{"uuid": "e0d6fd93-0051-4942-a8bc-302eca272537", "befores": [{"name": "module_name", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134827, "stop": 1721036135097}
\ No newline at end of file
{"uuid": "b53c2724-65e9-4211-8117-c3a3ee904a04", "befores": [{"name": "case_url", "status": "passed", "start": 1721036134660, "stop": 1721036134660}], "start": 1721036134660, "stop": 1721036134691}
\ No newline at end of file
{"uuid": "54279584-b6d4-4aaf-b00b-fe2fb2aa97b5", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135465, "stop": 1721036135465}], "start": 1721036135465, "stop": 1721036135503}
\ No newline at end of file
{"uuid": "06dd84af-4a20-490a-8636-acb9c263bb88", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036134739, "stop": 1721036134739}], "start": 1721036134739, "stop": 1721036134772}
\ No newline at end of file
{"uuid": "2526b6ad-df7b-4673-9e44-17860f70a6c2", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135396, "stop": 1721036135396}], "start": 1721036135396, "stop": 1721036135459}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "log", "source": "e0da026b-ae0e-4ba6-9734-5bbfe8eb8c65-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "6b117cc0-0ce0-439d-a294-699d6634c51b-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'维度管理'"}, {"name": "api_name", "value": "'设置默认维度'"}, {"name": "case_title", "value": "'正向用例'"}, {"name": "case_level", "value": "'中'"}, {"name": "case_method", "value": "'PUT'"}, {"name": "case_url", "value": "'http://36.139.193.99:8088/api/demension/v1/dem/setDefaultDem'"}, {"name": "case_mime", "value": "'query'"}, {"name": "case_data", "value": "{'code': 'test_dem_xyz_123'}"}, {"name": "expect_data", "value": "{'message': '设置默认维度成功!'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1721036135359, "stop": 1721036135382, "uuid": "91e4cbfd-ea65-448c-ba6d-3be6cf3e27dd", "historyId": "175f2053d1e8f2009027eb0d33dbcb47", "testCaseId": "cf44f8fd2d1cae3c5e3a386f65315e58", "fullName": "test_case.test_rikka.test_case.TestBpm#test_bpm", "labels": [{"name": "feature", "value": "维度管理"}, {"name": "story", "value": "设置默认维度"}, {"name": "severity", "value": "中"}, {"name": "epic", "value": "BPM-Rikka"}, {"name": "parentSuite", "value": "test_case.test_rikka"}, {"name": "suite", "value": "test_case"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_rikka.test_case"}]}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:291 Resetting dropped connection: 36.139.193.99
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "POST /auth HTTP/11" 500 None
\ No newline at end of file
{"uuid": "d325c57c-2c8e-4f67-8139-c56193a7fe96", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135359, "stop": 1721036135359}], "start": 1721036135359, "stop": 1721036135389}
\ No newline at end of file
{"uuid": "14085e0d-2c0b-4260-b1d8-2d9f408438fa", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135396, "stop": 1721036135396}], "start": 1721036135396, "stop": 1721036135457}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "DELETE /api/demension/v1/dem/deleteDemByIds?ids=1812782816866967552 HTTP/11" 200 None
\ No newline at end of file
{"uuid": "d05cabd0-dfbd-4200-9930-637203f5883a", "befores": [{"name": "title", "status": "passed", "start": 1721036134517, "stop": 1721036134517}], "start": 1721036134517, "stop": 1721036134536}
\ No newline at end of file
{"uuid": "3399e9a5-6ec3-4b82-a433-7ec635516874", "befores": [{"name": "case_title", "status": "passed", "start": 1721036135465, "stop": 1721036135465}], "start": 1721036135465, "stop": 1721036135505}
\ No newline at end of file
{"uuid": "4465273c-9a0d-47f6-adbc-be9d688671b2", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036134660, "stop": 1721036134660}], "start": 1721036134660, "stop": 1721036134690}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:291 Resetting dropped connection: 36.139.193.99
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "POST /auth HTTP/11" 500 None
ERROR  root:test_case.py:50 断言失败, 用例数据为:{'username': 'admin', 'password': '1'}, 期望数据为:{'state': False, 'message': '账户错误或该租户未启用'}, 服务器返回的数据为:{"state":false,"message":"账号或密码错误","code":200,"logId":"1812782814446854144"}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "log", "source": "d86bf89e-e495-487a-b4a4-f4cf3dd99d78-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "8e90f0d5-b49a-4051-9100-c053fe6bfdcd-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'组织管理'"}, {"name": "api_name", "value": "'保存组织参数'"}, {"name": "case_title", "value": "'正向用例'"}, {"name": "case_level", "value": "'中'"}, {"name": "case_method", "value": "'post'"}, {"name": "case_url", "value": "'http://36.139.193.99:8088/api/org/v1/orgParam/saveOrgParams'"}, {"name": "case_mime", "value": "'query|json'"}, {"name": "case_data", "value": "{'query': {'orgCode': 'test_org'}, 'body': [{'alias': 'sr', 'value': 'dog'}]}"}, {"name": "expect_data", "value": "{'state': True, 'message': '保存组织参数成功!'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1721036135466, "stop": 1721036135497, "uuid": "0bd53f7d-413c-44a7-9e4d-53fe9d069229", "historyId": "eab8ea8c95af2b5dc1c14b7af056d7b3", "testCaseId": "cf44f8fd2d1cae3c5e3a386f65315e58", "fullName": "test_case.test_rikka.test_case.TestBpm#test_bpm", "labels": [{"name": "feature", "value": "组织管理"}, {"name": "story", "value": "保存组织参数"}, {"name": "severity", "value": "中"}, {"name": "epic", "value": "BPM-Rikka"}, {"name": "parentSuite", "value": "test_case.test_rikka"}, {"name": "suite", "value": "test_case"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_rikka.test_case"}]}
\ No newline at end of file
{"uuid": "dc109e38-9ddc-4d7b-ac84-47153095a52f", "befores": [{"name": "api_name", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134829, "stop": 1721036135097}
\ No newline at end of file
{"uuid": "237a5324-f7cf-475d-ae68-053fcd6f7ba8", "befores": [{"name": "api_name", "status": "passed", "start": 1721036134615, "stop": 1721036134615}], "start": 1721036134615, "stop": 1721036134655}
\ No newline at end of file
{"uuid": "04f8f47a-5112-4ed8-a84a-5499a02a99e9", "befores": [{"name": "module_name", "status": "passed", "start": 1721036135465, "stop": 1721036135465}], "start": 1721036135465, "stop": 1721036135506}
\ No newline at end of file
{"uuid": "a76e582d-a7b0-4097-8676-4368af621b29", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036135359, "stop": 1721036135359}], "start": 1721036135359, "stop": 1721036135388}
\ No newline at end of file
{"uuid": "459e2894-c944-431f-8f88-b800190ece24", "befores": [{"name": "case_data", "status": "passed", "start": 1721036134739, "stop": 1721036134739}], "start": 1721036134739, "stop": 1721036134771}
\ No newline at end of file
{"uuid": "da7c0cba-4379-4e10-bf28-3d325f95a087", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135878, "stop": 1721036135878}], "start": 1721036135878, "stop": 1721036135923}
\ No newline at end of file
{"uuid": "7c3f4b7e-4946-41c4-8ff2-24b7918b2708", "children": ["40080ba1-68e2-4a9c-bce2-fd09f0ba2220", "593f0e94-4a41-4646-97dd-12986ae5429c", "da810da1-034a-4ea4-8418-d34ba144cc23", "b0d96ede-f649-4d41-be03-b74419a1c67b", "e0e717a4-4fee-4627-8b69-f782445defcf", "64241a35-2bdb-4894-b2f5-d069d76c0248", "447ace8c-80ad-4d2b-b207-02439b5c5131", "66e731f6-431b-4e98-b8b2-5d70b8226eb7", "02c16c95-350a-4c6e-8143-ad6557e5693f", "d5fc2292-1719-4b83-9598-cabb30dd2634", "efe3cec0-b768-4ad4-8238-95439027a7c1", "0e4a0322-2246-4b01-8f55-bc31f6e94e00", "4dec2d77-db63-44a6-9be3-0363039b8ec4", "e9f799b6-fb3d-4f29-9636-3c7cb8c78366", "7efe6a4f-7504-4e4c-b1aa-eb1684fe72d3", "5c8e2732-029e-4c2a-b558-3215496917c8", "91e4cbfd-ea65-448c-ba6d-3be6cf3e27dd", "afdb7a9f-3aca-4674-8f84-628d6dde75e3", "0bd53f7d-413c-44a7-9e4d-53fe9d069229", "490f4f46-aa35-49f2-b171-567cdd6db0fa", "72b16493-e7ef-471e-83e1-68a85b9ec6f8", "7c0b1f13-1d91-440e-a2a6-14afd4938ac3", "49df474d-c8e3-47aa-bb0f-53d1811e4257", "a3bc50df-5473-4d8d-914d-1008d296e6bc", "de535e9d-e6ec-4f3e-a1e0-d958efbd6d90", "aac2ccbe-5cc3-4879-a4de-517221eb5e67", "2fccf89a-781b-4498-8e9c-e435bc5795b3"], "befores": [{"name": "_session_faker", "status": "passed", "start": 1721036134219, "stop": 1721036134361}], "start": 1721036134219, "stop": 1721036135979}
\ No newline at end of file
{"uuid": "43220748-fb9e-45c1-8fd3-e78e58d4e7ff", "befores": [{"name": "module_name", "status": "passed", "start": 1721036135558, "stop": 1721036135558}], "start": 1721036135558, "stop": 1721036135600}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "GET /refresh HTTP/11" 200 None
ERROR  root:test_case.py:50 断言失败, 用例数据为:None, 期望数据为:{'message': '刷新成功'}, 服务器返回的数据为:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjExMjI0NzcsImlhdCI6MTcyMTAzNjA3N30.ZxVEKJLgXE7rRoS4snnhr3EM86dD4t4P6s98Lwzi9LajpOk057SxMrq7AgoqOm5mDPnnZ7yR6gyfJken5Ft3vA","username":"admin","account":"admin","userId":"","expiration":86400,"loginStatus":true}
\ No newline at end of file
{"uuid": "3f66d628-ff12-4f29-a855-afb8a1b8d520", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036135559, "stop": 1721036135559}], "start": 1721036135559, "stop": 1721036135594}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "log", "source": "a0240d08-639d-482f-8a1c-8a69bac8063c-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "2e4492c3-16af-4baf-9b20-e686165dfc40-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'组织管理'"}, {"name": "api_name", "value": "'删除组织'"}, {"name": "case_title", "value": "'正向用例'"}, {"name": "case_level", "value": "'中'"}, {"name": "case_method", "value": "'post'"}, {"name": "case_url", "value": "'http://36.139.193.99:8088/api/org/v1/org/deleteOrg'"}, {"name": "case_mime", "value": "'form'"}, {"name": "case_data", "value": "'test_org'"}, {"name": "expect_data", "value": "{'state': True, 'message': '删除组织成功!'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1721036135511, "stop": 1721036135546, "uuid": "490f4f46-aa35-49f2-b171-567cdd6db0fa", "historyId": "2d55773b2b88fb5681ddf1780f521d60", "testCaseId": "cf44f8fd2d1cae3c5e3a386f65315e58", "fullName": "test_case.test_rikka.test_case.TestBpm#test_bpm", "labels": [{"name": "feature", "value": "组织管理"}, {"name": "story", "value": "删除组织"}, {"name": "severity", "value": "中"}, {"name": "epic", "value": "BPM-Rikka"}, {"name": "parentSuite", "value": "test_case.test_rikka"}, {"name": "suite", "value": "test_case"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_rikka.test_case"}]}
\ No newline at end of file
{"uuid": "62fc1151-764b-4838-9b7b-d801782292fa", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135465, "stop": 1721036135465}], "start": 1721036135465, "stop": 1721036135503}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "POST /api/org/v1/orgParam/saveOrgParams?orgCode=test_org HTTP/11" 200 None
\ No newline at end of file
{"uuid": "8db5f165-096c-4aa5-83de-a35f767e4707", "befores": [{"name": "sql_type", "status": "passed", "start": 1721036134660, "stop": 1721036134660}], "start": 1721036134660, "stop": 1721036134688}
\ No newline at end of file
{"uuid": "cbe29375-f152-4d93-9cac-05d4bf2c3df4", "befores": [{"name": "expect_data", "status": "passed", "start": 1721036134660, "stop": 1721036134660}], "start": 1721036134660, "stop": 1721036134689}
\ No newline at end of file
{"uuid": "8d94c9ca-7bdf-48cd-baa8-c2095d0a8852", "befores": [{"name": "sql_data", "status": "passed", "start": 1721036135731, "stop": 1721036135731}], "start": 1721036135731, "stop": 1721036135759}
\ No newline at end of file
{"uuid": "424034b1-8b66-469b-8838-5bd456234b94", "befores": [{"name": "case_data", "status": "passed", "start": 1721036135396, "stop": 1721036135396}], "start": 1721036135396, "stop": 1721036135455}
\ No newline at end of file
{"uuid": "c86a4bf5-78af-4c52-bed3-4b0bddbfaa4f", "befores": [{"name": "update_key", "status": "passed", "start": 1721036135773, "stop": 1721036135773}], "start": 1721036135773, "stop": 1721036135823}
\ No newline at end of file
{"uuid": "59be875e-c603-42a5-8b50-1b4d084e355c", "befores": [{"name": "case_data", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134829, "stop": 1721036135092}
\ No newline at end of file
{"uuid": "22596582-7d44-411f-a55e-790346ded8d6", "befores": [{"name": "sql_type", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134829, "stop": 1721036135090}
\ No newline at end of file
{"name": "正向用例", "status": "passed", "attachments": [{"name": "log", "source": "a691954e-c5a6-477b-806f-4e4abd3edfb3-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "0762f176-2b7f-46f7-95d2-69d5d397175e-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "case_data", "value": "{'code': '需要更新'}"}, {"name": "expect_data", "value": "{'isDelete': '0'}"}, {"name": "title", "value": "'正向用例'"}], "start": 1721036134462, "stop": 1721036134484, "uuid": "da810da1-034a-4ea4-8418-d34ba144cc23", "historyId": "ea81cd847ca75dc163699495f9c9200c", "testCaseId": "2d43949fe9fc94a14d91b8791ac4ed5c", "fullName": "test_case.test_bpm_dependency.test_pytest_decorator.TestBPM#test_get_dem_msg", "labels": [{"name": "epic", "value": "bpm-场景测试"}, {"name": "feature", "value": "维度管理"}, {"name": "story", "value": "根据维度编码获取维度信息"}, {"name": "tag", "value": "dependency(depends=['TestBPM::test_add_dem'])"}, {"name": "parentSuite", "value": "test_case.test_bpm_dependency"}, {"name": "suite", "value": "test_pytest_decorator"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_bpm_dependency.test_pytest_decorator"}]}
\ No newline at end of file
{"uuid": "6b22f69e-e1cc-421e-8442-b9ec7f552a60", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135358, "stop": 1721036135358}], "start": 1721036135358, "stop": 1721036135390}
\ No newline at end of file
{"uuid": "1a50e6b5-a720-480b-8c21-54fc1f9106a8", "befores": [{"name": "case_url", "status": "passed", "start": 1721036135674, "stop": 1721036135674}], "start": 1721036135674, "stop": 1721036135722}
\ No newline at end of file
{"uuid": "84a2a593-6190-4245-9926-195e05a107a9", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036134781, "stop": 1721036134781}], "start": 1721036134781, "stop": 1721036134818}
\ No newline at end of file
{"uuid": "4dd6a4e4-e180-408c-b0d8-d5c771c104b3", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036135101, "stop": 1721036135101}], "start": 1721036135101, "stop": 1721036135150}
\ No newline at end of file
{"uuid": "edd9a50a-f325-4bf9-acd6-1af8322ff99e", "befores": [{"name": "sql_data", "status": "passed", "start": 1721036134782, "stop": 1721036134782}], "start": 1721036134782, "stop": 1721036134816}
\ No newline at end of file
{"name": "bpm-场景测试-添加维度-正向", "status": "passed", "attachments": [{"name": "log", "source": "4fdff8eb-e724-49c5-8cb6-b2a176562d8e-attachment.txt", "type": "text/plain"}], "start": 1721036134422, "stop": 1721036134456, "uuid": "593f0e94-4a41-4646-97dd-12986ae5429c", "historyId": "128da70acc78e495205cae38c86a3095", "testCaseId": "128da70acc78e495205cae38c86a3095", "fullName": "test_case.test_bpm_dependency.test_pytest_decorator.TestBPM#test_add_dem", "labels": [{"name": "story", "value": "添加维度"}, {"name": "feature", "value": "维度管理"}, {"name": "epic", "value": "bpm-场景测试"}, {"name": "tag", "value": "dependency(depends=['TestBPM::test_login'])"}, {"name": "parentSuite", "value": "test_case.test_bpm_dependency"}, {"name": "suite", "value": "test_pytest_decorator"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_bpm_dependency.test_pytest_decorator"}]}
\ No newline at end of file
{"uuid": "c6effaae-bf50-473e-b143-b20a0ad30efa", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135837, "stop": 1721036135837}], "start": 1721036135837, "stop": 1721036135870}
\ No newline at end of file
{"uuid": "a9177f50-2b0d-4490-8d49-3fc92dc30327", "befores": [{"name": "update_key", "status": "passed", "start": 1721036135878, "stop": 1721036135878}], "start": 1721036135878, "stop": 1721036135914}
\ No newline at end of file
{"uuid": "13351b91-d6f7-43c8-85ed-7e0976d0f475", "befores": [{"name": "sql_type", "status": "passed", "start": 1721036135397, "stop": 1721036135397}], "start": 1721036135397, "stop": 1721036135454}
\ No newline at end of file
{"uuid": "b0174cba-8431-4358-94ae-7282261a24f6", "befores": [{"name": "api_name", "status": "passed", "start": 1721036135101, "stop": 1721036135101}], "start": 1721036135101, "stop": 1721036135157}
\ No newline at end of file
{"uuid": "654a14e1-2624-43c7-b5e1-3a94d8187e07", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135101, "stop": 1721036135101}], "start": 1721036135101, "stop": 1721036135153}
\ No newline at end of file
{"uuid": "4ed05520-43fe-48a8-9ce7-fa92652078d4", "befores": [{"name": "update_key", "status": "passed", "start": 1721036134660, "stop": 1721036134660}], "start": 1721036134660, "stop": 1721036134686}
\ No newline at end of file
{"uuid": "f603c5da-949b-437a-a052-7eeb362227bb", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135730, "stop": 1721036135730}], "start": 1721036135730, "stop": 1721036135766}
\ No newline at end of file
{"uuid": "728d2e64-6034-40e8-8828-c7d42432c64f", "befores": [{"name": "sql_data", "status": "passed", "start": 1721036135359, "stop": 1721036135359}], "start": 1721036135359, "stop": 1721036135385}
\ No newline at end of file
{"uuid": "f1fa2ee7-b2e3-4e05-a2ce-c90068162a94", "befores": [{"name": "case_title", "status": "passed", "start": 1721036135730, "stop": 1721036135730}], "start": 1721036135730, "stop": 1721036135767}
\ No newline at end of file
{"uuid": "758cbf84-11af-4fb1-86dd-15f326465770", "befores": [{"name": "case_data", "status": "passed", "start": 1721036135163, "stop": 1721036135163}], "start": 1721036135163, "stop": 1721036135220}
\ No newline at end of file
{"uuid": "9c524de7-7b33-4617-8091-5ebfc996bf63", "befores": [{"name": "api_name", "status": "passed", "start": 1721036134739, "stop": 1721036134739}], "start": 1721036134739, "stop": 1721036134776}
\ No newline at end of file
{"uuid": "ad0582b2-d882-4039-8e6f-b0852e855d02", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036134829, "stop": 1721036134829}], "start": 1721036134829, "stop": 1721036135093}
\ No newline at end of file
{"name": "正向用例", "status": "failed", "statusDetails": {"message": "AssertionError: 断言失败", "trace": "self = <APIAutoTest_v3_1_multi_user.test_case.test_rikka.test_case.TestBpm object at 0x00000240646DB2F0>, req_fix = <APIAutoTest_v3_1_multi_user.request_method.request_method.RequestMethod object at 0x0000024064D6E510>\ndb_fix = <APIAutoTest_v3_1_multi_user.common.db.DB object at 0x0000024064D3FE90>, module_name = '认证接口', api_name = '刷新token', case_title = '正向用例', case_level = '高', case_method = 'GET'\ncase_url = 'http://36.139.193.99:8088/refresh', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None\n\n @allure.epic(\"BPM-Rikka\")\n \n @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, case_method, case_url, case_mime, case_data, expect_data, sql_type, sql_data, update_key\", ReadExcel(USERNAME).get_data())\n def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, case_method, case_url, case_mime, case_data, expect_data, sql_type, sql_data, update_key):\n \n allure.dynamic.feature(module_name)\n allure.dynamic.story(api_name)\n allure.dynamic.title(case_title)\n allure.dynamic.severity(case_level)\n \n if sql_type == \"delete\":\n db_fix.delete(sql_data)\n \n elif sql_type == \"select\":\n select_result = db_fix.select(sql_data)\n case_data[update_key] = select_result\n \n elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n db_fix.delete(sql_data[\"delete\"])\n \n select_result = db_fix.select(sql_data[\"select\"])\n case_data[update_key] = select_result\n \n req_result = req_fix.request_public(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)\n \n try:\n for key in expect_data:\n> assert expect_data[key] == req_result.json().get(key)\nE AssertionError: assert '刷新成功' == None\nE + where None = <built-in method get of dict object at 0x0000024064DD4580>('message')\nE + where <built-in method get of dict object at 0x0000024064DD4580> = {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...csImlhdCI6MTcyMTAzNjA3N30.ZxVEKJLgXE7rRoS4snnhr3EM86dD4t4P6s98Lwzi9LajpOk057SxMrq7AgoqOm5mDPnnZ7yR6gyfJken5Ft3vA', ...}.get\nE + where {'account': 'admin', 'expiration': 86400, 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRl...csImlhdCI6MTcyMTAzNjA3N30.ZxVEKJLgXE7rRoS4snnhr3EM86dD4t4P6s98Lwzi9LajpOk057SxMrq7AgoqOm5mDPnnZ7yR6gyfJken5Ft3vA', ...} = <bound method Response.json of <Response [200]>>()\nE + where <bound method Response.json of <Response [200]>> = <Response [200]>.json\n\ntest_case\\test_rikka\\test_case.py:48: AssertionError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <APIAutoTest_v3_1_multi_user.test_case.test_rikka.test_case.TestBpm object at 0x00000240646DB2F0>, req_fix = <APIAutoTest_v3_1_multi_user.request_method.request_method.RequestMethod object at 0x0000024064D6E510>\ndb_fix = <APIAutoTest_v3_1_multi_user.common.db.DB object at 0x0000024064D3FE90>, module_name = '认证接口', api_name = '刷新token', case_title = '正向用例', case_level = '高', case_method = 'GET'\ncase_url = 'http://36.139.193.99:8088/refresh', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None\n\n @allure.epic(\"BPM-Rikka\")\n \n @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, case_method, case_url, case_mime, case_data, expect_data, sql_type, sql_data, update_key\", ReadExcel(USERNAME).get_data())\n def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, case_method, case_url, case_mime, case_data, expect_data, sql_type, sql_data, update_key):\n \n allure.dynamic.feature(module_name)\n allure.dynamic.story(api_name)\n allure.dynamic.title(case_title)\n allure.dynamic.severity(case_level)\n \n if sql_type == \"delete\":\n db_fix.delete(sql_data)\n \n elif sql_type == \"select\":\n select_result = db_fix.select(sql_data)\n case_data[update_key] = select_result\n \n elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n db_fix.delete(sql_data[\"delete\"])\n \n select_result = db_fix.select(sql_data[\"select\"])\n case_data[update_key] = select_result\n \n req_result = req_fix.request_public(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)\n \n try:\n for key in expect_data:\n assert expect_data[key] == req_result.json().get(key)\n except AssertionError:\n log.error(f\"断言失败, 用例数据为:{case_data}, 期望数据为:{expect_data}, 服务器返回的数据为:{req_result.text}\")\n> raise AssertionError(\"断言失败\")\nE AssertionError: 断言失败\n\ntest_case\\test_rikka\\test_case.py:51: AssertionError"}, "attachments": [{"name": "log", "source": "1fa9650a-3119-4d6c-9d31-4b6d6eb30440-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "module_name", "value": "'认证接口'"}, {"name": "api_name", "value": "'刷新token'"}, {"name": "case_title", "value": "'正向用例'"}, {"name": "case_level", "value": "'高'"}, {"name": "case_method", "value": "'GET'"}, {"name": "case_url", "value": "'http://36.139.193.99:8088/refresh'"}, {"name": "case_mime", "value": "None"}, {"name": "case_data", "value": "None"}, {"name": "expect_data", "value": "{'message': '刷新成功'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1721036135232, "stop": 1721036135257, "uuid": "7efe6a4f-7504-4e4c-b1aa-eb1684fe72d3", "historyId": "bf605e88b090f2193607132588309647", "testCaseId": "cf44f8fd2d1cae3c5e3a386f65315e58", "fullName": "test_case.test_rikka.test_case.TestBpm#test_bpm", "labels": [{"name": "feature", "value": "认证接口"}, {"name": "story", "value": "刷新token"}, {"name": "severity", "value": "高"}, {"name": "epic", "value": "BPM-Rikka"}, {"name": "parentSuite", "value": "test_case.test_rikka"}, {"name": "suite", "value": "test_case"}, {"name": "subSuite", "value": "TestBpm"}, {"name": "host", "value": "Aze"}, {"name": "thread", "value": "21136-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_case.test_rikka.test_case"}]}
\ No newline at end of file
{"uuid": "8e30adc1-716e-49ed-ba35-797cac46e346", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036134699, "stop": 1721036134699}], "start": 1721036134699, "stop": 1721036134729}
\ No newline at end of file
{"uuid": "b91b32fc-d724-4bda-b319-059657c8b717", "befores": [{"name": "case_method", "status": "passed", "start": 1721036135772, "stop": 1721036135772}], "start": 1721036135772, "stop": 1721036135829}
\ No newline at end of file
{"uuid": "c3b0461d-11c6-4cfa-b62d-043ee49d0409", "befores": [{"name": "expect_data", "status": "passed", "start": 1721036134617, "stop": 1721036134617}], "start": 1721036134617, "stop": 1721036134650}
\ No newline at end of file
{"uuid": "3e45632e-09de-4a1c-86fc-015ff2d729bc", "children": ["40080ba1-68e2-4a9c-bce2-fd09f0ba2220", "593f0e94-4a41-4646-97dd-12986ae5429c", "da810da1-034a-4ea4-8418-d34ba144cc23", "b0d96ede-f649-4d41-be03-b74419a1c67b", "e0e717a4-4fee-4627-8b69-f782445defcf"], "befores": [{"name": "set_depends_value", "status": "passed", "start": 1721036134361, "stop": 1721036134361}], "afters": [{"name": "set_depends_value::0", "status": "passed", "start": 1721036135978, "stop": 1721036135978}], "start": 1721036134361, "stop": 1721036135978}
\ No newline at end of file
{"uuid": "97db471d-8b62-43d6-a9c8-14dc6a11b538", "befores": [{"name": "case_mime", "status": "passed", "start": 1721036135674, "stop": 1721036135674}], "start": 1721036135674, "stop": 1721036135721}
\ No newline at end of file
{"uuid": "8851e236-f22b-4799-b844-95f563b5d12f", "befores": [{"name": "case_data", "status": "passed", "start": 1721036135465, "stop": 1721036135465}], "start": 1721036135465, "stop": 1721036135501}
\ No newline at end of file
{"uuid": "212ca0f5-696d-433c-b54d-9667ac61f6c3", "children": ["447ace8c-80ad-4d2b-b207-02439b5c5131", "66e731f6-431b-4e98-b8b2-5d70b8226eb7", "02c16c95-350a-4c6e-8143-ad6557e5693f", "d5fc2292-1719-4b83-9598-cabb30dd2634", "efe3cec0-b768-4ad4-8238-95439027a7c1", "0e4a0322-2246-4b01-8f55-bc31f6e94e00", "4dec2d77-db63-44a6-9be3-0363039b8ec4", "e9f799b6-fb3d-4f29-9636-3c7cb8c78366", "7efe6a4f-7504-4e4c-b1aa-eb1684fe72d3", "5c8e2732-029e-4c2a-b558-3215496917c8", "91e4cbfd-ea65-448c-ba6d-3be6cf3e27dd", "afdb7a9f-3aca-4674-8f84-628d6dde75e3", "0bd53f7d-413c-44a7-9e4d-53fe9d069229", "490f4f46-aa35-49f2-b171-567cdd6db0fa", "72b16493-e7ef-471e-83e1-68a85b9ec6f8"], "befores": [{"name": "req_fix", "status": "passed", "start": 1721036134548, "stop": 1721036134587}], "afters": [{"name": "req_fix::0", "status": "passed", "start": 1721036135976, "stop": 1721036135976}], "start": 1721036134548, "stop": 1721036135976}
\ No newline at end of file
{"uuid": "46d4170e-cee0-46fb-8314-c107e5d2c990", "befores": [{"name": "case_data", "status": "passed", "start": 1721036135674, "stop": 1721036135674}], "start": 1721036135674, "stop": 1721036135720}
\ No newline at end of file
{"uuid": "130a48d0-9d36-4d9a-91c0-ede71a259534", "befores": [{"name": "case_data", "status": "passed", "start": 1721036134699, "stop": 1721036134699}], "start": 1721036134699, "stop": 1721036134729}
\ No newline at end of file
{"uuid": "78c36fbf-603d-4ec7-b119-465731e7cc92", "befores": [{"name": "expect_data", "status": "passed", "start": 1721036135731, "stop": 1721036135731}], "start": 1721036135731, "stop": 1721036135761}
\ No newline at end of file
{"uuid": "43db10ce-927d-4ecf-91f1-9f99d064f328", "befores": [{"name": "api_name", "status": "passed", "start": 1721036135396, "stop": 1721036135396}], "start": 1721036135396, "stop": 1721036135460}
\ No newline at end of file
DEBUG  urllib3.connectionpool:connectionpool.py:291 Resetting dropped connection: 36.139.193.99
DEBUG  urllib3.connectionpool:connectionpool.py:546 http://36.139.193.99:8088 "POST /auth HTTP/11" 200 None
ERROR  root:test_case.py:50 断言失败, 用例数据为:{'username': 'admin', 'password': 'F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8=F4/DVgPS/NEruLxVVRqHktsb1R2fVpw81t5VuGfFjwp0G7U4k6spHPr/ejPlw8XxIVilJ+SyIH0G5FbQStFEd/94mmI7+2Dw2c7MXXIERYKjd3XNe4gZR4ANJclCJHNGfE+mtnX5voprYwEo9m6ponCdmmXTMx9cWVEJ4K/nbR8='}, 期望数据为:{'state': False, 'message': '账户错误或该租户未启用'}, 服务器返回的数据为:{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE3MjExMjI0NzcsImlhdCI6MTcyMTAzNjA3N30.ZxVEKJLgXE7rRoS4snnhr3EM86dD4t4P6s98Lwzi9LajpOk057SxMrq7AgoqOm5mDPnnZ7yR6gyfJken5Ft3vA","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
\ No newline at end of file
{"uuid": "d84ca2ae-8262-4f33-ad4b-23ede106efe1", "befores": [{"name": "case_level", "status": "passed", "start": 1721036135163, "stop": 1721036135163}], "start": 1721036135163, "stop": 1721036135223}
\ 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.
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