Commit 7cc41d8d by dwj

接口自动化框架

parent b3a9b776
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/4 9:39
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/4 9:39
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
from InterfaceAutoTest_2.common.log import write_log
log = write_log()
\ No newline at end of file
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: db.py
# Author: xxxxxxx
# Datetime: 2023/11/4 14:06
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import pymysql
from InterfaceAutoTest_2.common import log
from InterfaceAutoTest_2.common.read_ini import ReadIni
class DB:
def __init__(self):
"""连接数据库,获取连接对象和游标对象"""
read_ini = ReadIni()
try:
self.conn = pymysql.connect(
host=read_ini.get_sql_message("host"),
port=read_ini.get_sql_message("port"),
user=read_ini.get_sql_message("user"),
password=read_ini.get_sql_message("pwd"),
database=read_ini.get_sql_message("database"),
charset="utf-8"
)
self.cursor = self.conn.cursor()
except:
log.error("连接数据库错误或获取游标对象失败")
raise pymysql.MySQLError("连接数据库错误或获取游标对象失败")
def close(self):
self.cursor.close()
self.conn.close()
def delete(self, sql):
"""执行删除的sql语句"""
try:
self.cursor.execute(sql)
self.conn.commit()
except:
log.error("执行删除的sql语句错误,请查看对应的sql语句")
raise ValueError("执行删除的sql语句错误,请查看对应的sql语句")
def select(self, sql, num=None):
"""执行查询的sql语句"""
try:
self.cursor.execute(sql)
select_result = self.cursor.fetchall()
if select_result:
return select_result[0][0]
elif select_result and num == 2:
return select_result[0][0], select_result[0][1]
elif select_result and num > 3:
return select_result
except:
log.error("执行查询的sql语句错误,请查看对应的sql语句")
raise ValueError("执行查询的sql语句错误,请查看对应的sql语句")
\ No newline at end of file
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: log.py
# Author: xxxxxxx
# Datetime: 2023/11/4 9:43
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import logging
import os
def write_log():
"""创建写入日志对象"""
logger = logging.getLogger(name="test")
# 获取日志目录
log_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "report/log/InterfaceAutoTest.log")
# 文件的操作模式
handler = logging.FileHandler(log_path, mode="a", encoding="utf-8")
# 显示的格式
format = logging.Formatter('%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s - %(name)s')
handler.setFormatter(format)
logger.addHandler(handler)
return logger
\ No newline at end of file
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: read_excel.py
# Author: xxxxxxx
# Datetime: 2023/11/4 14:04
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import openpyxl
from InterfaceAutoTest_2.common import log
from InterfaceAutoTest_2.common.read_ini import ReadIni
from InterfaceAutoTest_2.common.read_json import read_json
class ReadExcel:
def __init__(self):
"""获取数据配置层中,除了ini文件以外的所有文件的路径,再获取excel的工作表,再读取所有的json文件"""
self.read_ini = ReadIni()
excel_path = self.read_ini.get_file_path("excel")
case_data_path = self.read_ini.get_file_path("case")
except_data_path = self.read_ini.get_file_path("expect")
sql_data_path = self.read_ini.get_file_path("sql")
# 获取工作表名称
table_name = self.read_ini.get_table_name("table_name")
wb = openpyxl.load_workbook(excel_path)
try:
self.ws = wb[table_name]
except:
log.error("获取工作表失败,请查看工作表名称是否配置正确")
raise KeyError("获取工作表失败,请查看工作表名称是否配置正确")
self.case_data_dict = read_json(case_data_path)
self.except_data_dict = read_json(except_data_path)
self.sql_data_dict = read_json(sql_data_path)
def __get_cell_value(self, column, row):
try:
value = self.ws[column + str(row)].value
if value is None:
return None
elif value.strip():
return value.strip()
except:
log.error("获取指定单元格数据失败,请查看输入的列号和行号是否正确")
raise KeyError("获取指定单元格数据失败,请查看输入的列号和行号是否正确")
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_url(self, row):
"""根据行号获取请求的url"""
return self.read_ini.get_host("host") + self.__get_cell_value("f", row)
def case_method(self, row):
"""根据行号获取请求的方法"""
return self.__get_cell_value("g", row)
def case_mime(self, row):
"""根据行号,获取媒体类型"""
mime = self.__get_cell_value("h", row)
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)
try:
return self.case_data_dict[module_name][api_name][case_data_key]
except:
log.error("请查看是否配置了用例数据")
raise KeyError("请查看是否配置了用例数据")
def except_data(self, row):
"""根据行号,获取期望数据"""
except_data_key = self.__get_cell_value("j", row)
module_name = self.module_name(row)
api_name = self.api_name(row)
try:
return self.except_data_dict[module_name][api_name][except_data_key]
except:
log.error("请查看是否配置了期望数据")
raise KeyError("请查看是否配置了期望数据")
def sql_type(self, row):
"""根据行号,获取sql语句类型"""
sql_type_value = self.__get_cell_value("k", row)
if sql_type_value:
return sql_type_value.lower()
def sql_data(self, row):
"""根据行号,获取sql语句"""
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)
try:
return self.sql_data_dict[module_name][api_name][sql_data_key]
except:
log.error("请查看是否配置了sql语句")
raise KeyError("请查看是否配置了sql语句")
def update_key(self, key):
"""根据行号,获取更新的key"""
return self.__get_cell_value("m", key)
def get_data(self):
"""将测试数据存放再一个二维列表中"""
list_data = []
for row in range(2, self.ws.max_row + 1):
# url
case_url = self.case_url(row)
# method
case_method = self.case_method(row)
# mime
case_mime = self.case_mime(row)
# case_data
case_data = self.case_data(row)
# expect_data
expect_data = self.except_data(row)
# sql_type
sql_type = self.sql_type(row)
# sql_data
sql_data = self.sql_data(row)
# update_key
update_key = self.update_key(row)
list_data.append([case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key])
else:
return list_data
if __name__ == '__main__':
excel = ReadExcel()
print(excel.get_data())
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: read_ini.py
# Author: xxxxxxx
# Datetime: 2023/11/4 9:56
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import configparser
import os
from InterfaceAutoTest_2.common import log
class ReadIni:
def __init__(self):
"""读取ini文件"""
self.data_config_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data_config")
ini_path = os.path.join(self.data_config_path, "config.ini")
self.conf = configparser.ConfigParser()
self.conf.read(ini_path, encoding="utf_8")
def get_file_path(self, key):
"""根据key,获取file节点下文件的路径"""
try:
file_name = self.conf.get("file", key)
except:
log.error("输入file节点下的key值错误,请查看配置文件")
raise KeyError("输入file节点下的key值错误,请查看配置文件")
file_path = os.path.join(self.data_config_path, file_name)
if os.path.isfile(file_path):
return file_path
else:
log.error("获取file节点下的文件的路径错误,查看配置文件")
raise FileNotFoundError("获取file节点下的文件的路径错误,查看配置文件")
def get_host(self, key):
"""根据key,获取域名"""
try:
return self.conf.get("host", key)
except:
log.error("输入host节点下的key值错误,请查看配置文件")
raise KeyError("输入host节点下的key值错误,请查看配置文件")
def get_table_name(self, key):
"""根据key,获取工作表名"""
try:
return self.conf.get("table", key)
except:
log.error("输入table节点下的key值错误,请查看配置文件")
raise KeyError("输入table节点下的key值错误,请查看配置文件")
def get_sql_message(self, key):
"""根据key,获取数据库的连接信息"""
try:
return self.conf.get("sql", key)
except:
log.error("输入sql节点下的key值错误,请查看配置文件")
raise KeyError("输入sql节点下的key值错误,请查看配置文件")
if __name__ == '__main__':
ini = ReadIni()
print(ini.get_table_name("table_name"))
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: 框架
# FileName: read_json.py
# Author: xxxxxxx
# Datetime: 2023/11/4 10:57
# Description:
# 命名规范:文件名全小写+下划线,类名大驼峰,方法和变量小写+下划线连接,
# 常量大写,变量和常量用名词,方法用动词
# ---------------------------------------------------------------------------
import json
import logging
import os
from InterfaceAutoTest_2.common import log
def read_json(filename):
"""读取json文件,将json文件的内容转成python对象,并返回"""
if os.path.isfile(filename) and filename.endswith(".json"):
try:
with open(filename, mode="r", encoding="utf-8") as f:
return json.loads(f.read())
except:
log.error("打开json文件获取json文件打的内容序列化为python对象失败,请查看json文件是否有错误")
raise FileExistsError("打开json文件获取json文件打的内容序列化为python对象失败,请查看json文件是否有错误")
else:
log.error("json文件的路径不合法")
raise FileExistsError("json文件的路径不合法")
{
"认证接口":{
"登录系统":{
"LoginSuccess": {"password": "MTIzNDU2","username": "admin"},
"LoginErrorUsernameLong":{"password": "MTIzNDU2","username": "adminadminadminadminadminadmin"},
"LoginErrorUsernameShort":{"password": "MTIzNDU2","username": "a"},
"LoginErrorUsernameNone":{"password": "MTIzNDU2","username": ""},
"LoginErrorUsernameSpecial":{"password": "MTIzNDU2","username": "@#!@#!@"},
"LoginErrorPwdLong":{"password": "MTIzNDU2MTIzNDU2MTIzNDU2MTIzNDU2MTIzNDU2","username": "admin"},
"LoginErrorPwdShort":{"password": "m","username": "admin"},
"LoginErrorPwdNone":{"password": "","username": "admin"},
"LoginErrorPwdSpecial":{"password": "@#!@#!@","username": "admin"},
"LoginErrorPwdError":{"password": "MTIzNDU222","username": "admin"}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {
"code": "dem_test57_abc",
"description": "测试维度57",
"isDefault": 0,
"name": "测试57期的维度"
}
},
"根据维度编码获取维度信息": {
"GetDemMessageSuccess": {"code": "dem_test57_abc"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"ids": "不知道"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"code": "test_org_57",
"demId": "不知道",
"exceedLimitNum": 0,
"grade": "",
"limitNum": 0,
"name": "测试组织",
"nowNum": 0,
"orderNo": 0,
"parentId": "0"
}
},
"添加组织参数": {
"AddOrgParamsSuccess": {"query": {"orgCode": "test_org_57"}, "body": [{"alias":"sz","value":9000}]}
},
"删除组织": {
"DelOrgSuccess": "test_org_57"
}
}
}
[file]
;case为用例数据文件
case=case_data.json
;expect为期望数据文件
expect=expect_data.json
;excel为用例管理文件
excel=APIAutoTest.xlsx
;sql语句的json文件
sql=sql_data.json
[host]
;host为被测系统的域名
host=http://120.46.172.186:8080
[table]
;table_name为excel的工作表名称
table_name=BPM
[sql]
;链接数据库的配置
host=120.46.172.186
port=3306
user=root
pwd=root@2023
database=eipsaas
\ No newline at end of file
{
"认证接口":{
"登录系统":{
"LoginSuccess": {"username": "超级管理","account": "admin", "loginStatus": true},
"LoginErrorUsernameLong":{"state": false, "message":"账号或密码错误"},
"LoginErrorUsernameShort":{"state": false, "message":"账号或密码错误"},
"LoginErrorUsernameNone":{"state": false, "message":"账号或密码错误"},
"LoginErrorUsernameSpecial":{"state": false, "message":"账号或密码错误"},
"LoginErrorPwdLong":{"state": false, "message":"账号或密码错误"},
"LoginErrorPwdShort":{"state": false, "message":"账号或密码错误"},
"LoginErrorPwdNone":{"state": false, "message":"账号或密码错误"},
"LoginErrorPwdSpecial":{"state": false, "message":"账号或密码错误"},
"LoginErrorPwdError":{"state": false, "message":"账号或密码错误"}
},
"刷新token": {
"RefreshSuccess": {"message": "刷新成功"}
}
},
"维度管理": {
"添加维度": {
"AddDemSuccess": {"state": true, "message": "添加维度成功!"}
},
"根据维度编码获取维度信息": {
"GetDemMessageSuccess": {"demCode": "dem_test57_abc", "name": "测试57期的维度"}
},
"根据维度编码删除维度": {
"DeleteDemSuccess": {"state": true, "message": "删除维度成功"}
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {"state": true, "message": "添加组织成功!"}
},
"添加组织参数": {
"AddOrgParamsSuccess": {"state":true,"message":"保存组织参数成功!"}
},
"删除组织": {
"DelOrgSuccess": {"state":true,"message":"删除组织成功!"}
}
}
}
\ No newline at end of file
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: settings.py
# Author: xxxxxxx
# Datetime: 2023/11/3 17:03
# Description:
#
# ---------------------------------------------------------------------------
# file节点名称====================
FILE = "file"
# file节点名称=key的名称===================
CASE = "case"
EXPECT = "expect"
EXCEL = "excel"
SQL = "sql"
# table节点名称========================
TABLE = "table"
# table节点名称=key的名称=======================
TABLE_NAME = "table_name"
# host节点名称=================
URL_HOST = "host"
# host节点名称=key的名称================
URL_HOST_CUSTOM = "host"
# sql节点名称==========================
CONN_SQL = "sql"
# sql节点名称=key的名称=========================
HOST = "host"
PORT = "port"
USER = "user"
PWD = "pwd"
DATABASE = "database"
# excel文件中的列号
NUMBER = "A"
MODULE = "B"
API = "C"
TITLE = "D"
LEVEL = "E"
URL = "G"
METHOD = "F"
MIME = "H"
CASE_DATA = "I"
EXPECT_DATA = "J"
SQL_TYPE = "K"
SQL_DATA = "L"
UPDATE_KEY = "M"
{
"维度管理": {
"添加维度": {
"AddDemSuccess": "DELETE FROM uc_demension WHERE `CODE_`=\"dem_test57_abc\";"
},
"根据维度编码删除维度": {
"DeleteDemSuccess": "SELECT ID_ from uc_demension WHERE `CODE_`=\"dem_test57_abc\";"
}
},
"组织管理": {
"添加组织": {
"AddOrgSuccess": {
"select": "SELECT ID_ from uc_demension WHERE `CODE_`=\"dem_test57_abc\";",
"delete": "DELETE FROM uc_org WHERE `CODE_`=\"test_org_57\";"
}
}
}
}
\ No newline at end of file
{"uuid": "422cdfed-1010-4c46-9cb2-c07c210edb6b", "befores": [{"name": "case_method", "status": "passed", "start": 1699242128421, "stop": 1699242128421}], "start": 1699242128421, "stop": 1699242128484}
\ No newline at end of file
{"uuid": "c2d032fb-ad5c-4609-93e3-260d3f77d5db", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242127017, "stop": 1699242127017}], "start": 1699242127017, "stop": 1699242127079}
\ No newline at end of file
{"uuid": "5dd2cfef-c943-4989-ab1e-9bdcb1d8b36b", "befores": [{"name": "case_url", "status": "passed", "start": 1699242126283, "stop": 1699242126283}], "start": 1699242126283, "stop": 1699242126394}
\ No newline at end of file
{"uuid": "a552f43c-c26e-4bcc-9de9-070df3c46bf5", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242125612, "stop": 1699242125612}], "start": 1699242125612, "stop": 1699242125737}
\ No newline at end of file
{"uuid": "de2275be-d38d-477f-82f8-c70051a5bcfb", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242127087, "stop": 1699242127087}], "start": 1699242127087, "stop": 1699242127185}
\ No newline at end of file
{"uuid": "62d35d6a-5fa0-4d9e-b338-0d31b83f7c6d", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242127606, "stop": 1699242127606}], "start": 1699242127606, "stop": 1699242127700}
\ No newline at end of file
{"uuid": "0bc7a835-8255-40cf-8078-76137da78018", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242124893, "stop": 1699242124893}], "start": 1699242124893, "stop": 1699242124988}
\ No newline at end of file
{"uuid": "e7910ec4-606b-45ca-b32b-0e273898f1ca", "befores": [{"name": "update_key", "status": "passed", "start": 1699242128488, "stop": 1699242128488}], "start": 1699242128488, "stop": 1699242128546}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/api/org/v1/org/deleteOrg-POST-x-www-form-urlencoded-test_org_57-expect_data15-None-None-None]", "status": "passed", "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/api/org/v1/org/deleteOrg'"}, {"name": "case_method", "value": "'POST'"}, {"name": "case_mime", "value": "'x-www-form-urlencoded'"}, {"name": "case_data", "value": "'test_org_57'"}, {"name": "expect_data", "value": "{'state': True, 'message': '删除组织成功!'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242126217, "stop": 1699242126275, "uuid": "3ff376ad-1df1-4adc-b289-6f1061f1d476", "historyId": "5b3e17d638e7d2e8ed6e5ba865241766", "testCaseId": "317585064e361b6d13052050b1dc8a9e", "fullName": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_laohuang"}, {"name": "suite", "value": "test_bpm_laohuang"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang"}]}
\ No newline at end of file
{"uuid": "a0d7bb77-a6c1-46ac-b888-2628bb6b2bfb", "befores": [{"name": "case_method", "status": "passed", "start": 1699242125611, "stop": 1699242125611}], "start": 1699242125611, "stop": 1699242125738}
\ No newline at end of file
{"uuid": "44c2de69-ad71-4fd4-9888-6f9c9c3b3540", "befores": [{"name": "case_url", "status": "passed", "start": 1699242128015, "stop": 1699242128015}], "start": 1699242128015, "stop": 1699242128168}
\ No newline at end of file
{"uuid": "3d432f51-71d8-41f7-a447-3cdbc3f798a4", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242125098, "stop": 1699242125098}], "start": 1699242125098, "stop": 1699242125196}
\ No newline at end of file
{"uuid": "fa6bee44-54a5-455c-9b04-25629f8c585b", "befores": [{"name": "case_method", "status": "passed", "start": 1699242128015, "stop": 1699242128015}], "start": 1699242128015, "stop": 1699242128168}
\ No newline at end of file
{"uuid": "d65465d3-de3a-4e02-a99f-152e6fd3ed9a", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242126283, "stop": 1699242126283}], "start": 1699242126283, "stop": 1699242126392}
\ No newline at end of file
{"uuid": "29d9d569-c3c6-4e4c-a6b9-6933853b5703", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242126152, "stop": 1699242126152}], "start": 1699242126152, "stop": 1699242126210}
\ No newline at end of file
{"uuid": "fa5c80da-a18c-4465-9c35-3dfcb97c5fab", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242127806, "stop": 1699242127806}], "start": 1699242127805, "stop": 1699242127896}
\ No newline at end of file
{"uuid": "8258d0cf-dd13-4c1e-9f43-3b364b9aadd6", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242125098, "stop": 1699242125098}], "start": 1699242125098, "stop": 1699242125197}
\ No newline at end of file
{"uuid": "7e3931ab-8a7e-419b-ba57-142c629e3de4", "children": ["a6d31e89-bfb3-485d-a735-d4c466005cca", "2f00605c-54f5-4f15-840d-a847b1da8335", "2e909a78-7ede-4af0-944c-cf4a8d7f4388", "785aabf1-771a-4bad-b81f-19e59cf47722", "fc82b399-6c00-4a71-835d-75162cd1cfba", "f36a9425-9193-4099-95d2-2f63857dfbf0", "df94057c-bd47-47d7-b0e6-55052a18ff45", "d9079439-d469-4050-a736-e78f185b4de5", "13a48860-0cea-4f0e-a0ba-5b8825ccfe22", "bf299d4f-fd7a-49b5-b26a-139e000f6fcc", "18bba92e-2c50-49ab-9edc-96f00e1e564b", "38ab2039-2fb0-43eb-9d98-ec4d5629a251", "4496d4f0-4c17-40c3-ac9e-7678c2e254bb", "eb31edcf-b76a-4459-a307-4739aa773a88", "0e813ea2-aa48-45b8-a97e-8fe72f2646a2", "d6a465e7-8539-45d1-9cd5-15e849a9b052", "3f15ba40-a451-47c7-92f9-65067fa04182"], "befores": [{"name": "req_fix", "status": "passed", "start": 1699242126817, "stop": 1699242126933}], "afters": [{"name": "req_fix::0", "status": "passed", "start": 1699242128668, "stop": 1699242128668}], "start": 1699242126817, "stop": 1699242128668}
\ No newline at end of file
{"uuid": "a5002220-e4c3-47b4-b595-751e6406dd4e", "befores": [{"name": "case_data", "status": "passed", "start": 1699242126152, "stop": 1699242126152}], "start": 1699242126152, "stop": 1699242126212}
\ No newline at end of file
{"uuid": "2f484c1f-3fd1-476e-8548-683c913e5ddc", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242127805, "stop": 1699242127805}], "start": 1699242127805, "stop": 1699242127898}
\ No newline at end of file
用例1
{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjg1MjYsImlhdCI6MTY5OTI0MjEyNn0.5CpJBi19CiIHgaiaMyN6wZJOIuZjFWrZouKnWZ7UzmlRfkp9SIWRcBTJPOUiioMc9-dl_Fya7-U9F8av4DmQOw","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}
{"uuid": "d9c0745e-5108-41fe-904e-db1ef909e122", "befores": [{"name": "case_data", "status": "passed", "start": 1699242125097, "stop": 1699242125097}], "start": 1699242125097, "stop": 1699242125198}
\ No newline at end of file
{"uuid": "1dde04d1-2000-41d0-a121-c8fd59ea5c7b", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242127087, "stop": 1699242127087}], "start": 1699242127087, "stop": 1699242127184}
\ No newline at end of file
{"uuid": "3f99ef06-097f-4e70-a656-7983459ddc44", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242128553, "stop": 1699242128553}], "start": 1699242128553, "stop": 1699242128666}
\ No newline at end of file
{"uuid": "7689695f-ab84-45d7-aa37-ccf84f73d2ab", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242126216, "stop": 1699242126216}], "start": 1699242126216, "stop": 1699242126278}
\ No newline at end of file
{"uuid": "595f9525-7d8d-4fb0-b550-feae41170597", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242128171, "stop": 1699242128172}], "start": 1699242128171, "stop": 1699242128221}
\ No newline at end of file
{"uuid": "3b7584ca-6d45-41fd-9ef3-409c9139fe1d", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242127287, "stop": 1699242127287}], "start": 1699242127287, "stop": 1699242127380}
\ No newline at end of file
{"uuid": "d730ea0a-2b33-4af6-9b45-9dc1e6935e16", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242128422, "stop": 1699242128422}], "start": 1699242128422, "stop": 1699242128480}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/addDem-post-json-case_data11-expect_data11-delete-DELETE FROM uc_demension WHERE `CODE_`=\"dem_test57_abc\";-None]", "status": "passed", "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/api/demension/v1/dem/addDem'"}, {"name": "case_method", "value": "'post'"}, {"name": "case_mime", "value": "'json'"}, {"name": "case_data", "value": "{'code': 'dem_test57_abc', 'description': '测试维度57', 'isDefault': 0, 'name': '测试57期的维度'}"}, {"name": "expect_data", "value": "{'state': True, 'message': '添加维度成功!'}"}, {"name": "sql_type", "value": "'delete'"}, {"name": "sql_data", "value": "'DELETE FROM uc_demension WHERE `CODE_`=\"dem_test57_abc\";'"}, {"name": "update_key", "value": "None"}], "start": 1699242125744, "stop": 1699242125887, "uuid": "944391c4-f1ac-4c01-a049-0da757083ff2", "historyId": "41c661511a95dc746322d218f80e5343", "testCaseId": "317585064e361b6d13052050b1dc8a9e", "fullName": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_laohuang"}, {"name": "suite", "value": "test_bpm_laohuang"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang"}]}
\ No newline at end of file
{"uuid": "3f81d1f2-a636-4fe1-8224-06ffeb220022", "befores": [{"name": "case_method", "status": "passed", "start": 1699242126152, "stop": 1699242126152}], "start": 1699242126152, "stop": 1699242126213}
\ No newline at end of file
{"uuid": "244c6324-5296-4d9c-b2d0-e0411c5b72d1", "befores": [{"name": "case_url", "status": "passed", "start": 1699242128487, "stop": 1699242128487}], "start": 1699242128487, "stop": 1699242128550}
\ No newline at end of file
{"uuid": "96ec8b8d-038f-4cd8-b6ba-dafe36565f02", "children": ["526c60ec-a3dd-4f93-a0b2-ac05caac874d", "62b32c4f-e1ed-42a4-a6df-ea3f333ffa8b", "1299b43f-53eb-4d94-a618-0b77d39e36ad", "5ea1b796-4f43-41ed-b57c-0510d0fb6a11", "9103af0f-ab67-473a-af61-5f84bade1aea", "e0ce9eb7-6ac0-449a-885b-caaa61800f2f", "f084ed43-c929-47bb-8a02-05cea9add22d", "2c42a5aa-1c3e-475c-9aa9-6c6bd708d88a", "6e78a222-1600-462a-9266-9127d3f7b0ad", "335e212a-47b5-4027-b0fc-aab540732e19", "ee9a79c9-7117-47f2-827d-a5ec1c39883e", "944391c4-f1ac-4c01-a049-0da757083ff2", "91bbcfa5-5549-4e6c-8c17-6e47f8ed5b77", "f6b9a8dc-6e71-440b-b90f-a7c99ee39ee0", "9bda1df2-30ff-4d6b-8186-57020ae25dde", "3ff376ad-1df1-4adc-b289-6f1061f1d476", "7d0e0737-d4fe-432e-aa89-f89d3fa4ddad"], "befores": [{"name": "db_fix", "status": "passed", "start": 1699242124196, "stop": 1699242124420}], "afters": [{"name": "db_fix::0", "status": "passed", "start": 1699242128673, "stop": 1699242128673}], "start": 1699242124196, "stop": 1699242128673}
\ No newline at end of file
{"uuid": "86f30093-577b-41d9-8b83-533357258ed4", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242125413, "stop": 1699242125413}], "start": 1699242125413, "stop": 1699242125509}
\ No newline at end of file
{"uuid": "c9e3ef6c-f7cd-4e04-8870-deacefef2d53", "befores": [{"name": "case_url", "status": "passed", "start": 1699242127707, "stop": 1699242127707}], "start": 1699242127707, "stop": 1699242127802}
\ No newline at end of file
{"uuid": "75536ff0-31c3-4742-adc8-93508b51269c", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242127017, "stop": 1699242127017}], "start": 1699242127017, "stop": 1699242127080}
\ No newline at end of file
{"uuid": "87937609-95b9-4ca2-931b-6b2bc49b9506", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242125514, "stop": 1699242125514}], "start": 1699242125514, "stop": 1699242125604}
\ No newline at end of file
{"uuid": "807e9191-e07a-414a-a326-22d302a99791", "befores": [{"name": "case_url", "status": "passed", "start": 1699242127190, "stop": 1699242127190}], "start": 1699242127190, "stop": 1699242127284}
\ No newline at end of file
{"uuid": "fa769f6a-6b0f-4889-af5a-425a24d5effe", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242128488, "stop": 1699242128488}], "start": 1699242128488, "stop": 1699242128548}
\ No newline at end of file
{"uuid": "eb7a5bc2-7ab7-401f-a482-aef9ef6323df", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242127902, "stop": 1699242127902}], "start": 1699242127902, "stop": 1699242128011}
\ No newline at end of file
{"uuid": "6e3d1c5f-744e-4b4c-8702-b1e80b128226", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242128016, "stop": 1699242128016}], "start": 1699242128015, "stop": 1699242128168}
\ No newline at end of file
{"uuid": "d0f77dbe-04b1-4554-b957-24517155503a", "befores": [{"name": "case_data", "status": "passed", "start": 1699242127707, "stop": 1699242127707}], "start": 1699242127707, "stop": 1699242127800}
\ No newline at end of file
{"uuid": "5d8b7928-baeb-4264-b2b8-c3578b9cbaee", "befores": [{"name": "case_method", "status": "passed", "start": 1699242127086, "stop": 1699242127086}], "start": 1699242127086, "stop": 1699242127187}
\ No newline at end of file
{"name": "test1", "status": "passed", "attachments": [{"name": "stdout", "source": "125fa72b-3f8a-4525-b1d5-39de29b9988b-attachment.txt", "type": "text/plain"}], "start": 1699242126496, "stop": 1699242126550, "uuid": "9effb113-0b86-4db4-ba47-ebf86f7b6c18", "historyId": "31302f189f4197c0ef53e34b7296010a", "testCaseId": "31302f189f4197c0ef53e34b7296010a", "fullName": "InterfaceAutoTest_2.test_case.test_order.test_pytest_func.Test01#test1", "labels": [{"name": "tag", "value": "dependency"}, {"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_order"}, {"name": "suite", "value": "test_pytest_func"}, {"name": "subSuite", "value": "Test01"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_order.test_pytest_func"}]}
\ No newline at end of file
{"uuid": "ba46c137-29f0-4661-b91b-6694b10439dd", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242127707, "stop": 1699242127707}], "start": 1699242127707, "stop": 1699242127800}
\ No newline at end of file
{"uuid": "798f5330-8ab4-4f3b-b59a-6f5f493fcce0", "children": ["526c60ec-a3dd-4f93-a0b2-ac05caac874d", "62b32c4f-e1ed-42a4-a6df-ea3f333ffa8b", "1299b43f-53eb-4d94-a618-0b77d39e36ad", "5ea1b796-4f43-41ed-b57c-0510d0fb6a11", "9103af0f-ab67-473a-af61-5f84bade1aea", "e0ce9eb7-6ac0-449a-885b-caaa61800f2f", "f084ed43-c929-47bb-8a02-05cea9add22d", "2c42a5aa-1c3e-475c-9aa9-6c6bd708d88a", "6e78a222-1600-462a-9266-9127d3f7b0ad", "335e212a-47b5-4027-b0fc-aab540732e19", "ee9a79c9-7117-47f2-827d-a5ec1c39883e", "944391c4-f1ac-4c01-a049-0da757083ff2", "91bbcfa5-5549-4e6c-8c17-6e47f8ed5b77", "f6b9a8dc-6e71-440b-b90f-a7c99ee39ee0", "9bda1df2-30ff-4d6b-8186-57020ae25dde", "3ff376ad-1df1-4adc-b289-6f1061f1d476", "7d0e0737-d4fe-432e-aa89-f89d3fa4ddad", "9effb113-0b86-4db4-ba47-ebf86f7b6c18", "3c123d23-0011-40ee-8862-8c906aab45ad", "5adf36a9-1cf4-40e7-a818-63cc01a1db73", "a6d31e89-bfb3-485d-a735-d4c466005cca", "2f00605c-54f5-4f15-840d-a847b1da8335", "2e909a78-7ede-4af0-944c-cf4a8d7f4388", "785aabf1-771a-4bad-b81f-19e59cf47722", "fc82b399-6c00-4a71-835d-75162cd1cfba", "f36a9425-9193-4099-95d2-2f63857dfbf0", "df94057c-bd47-47d7-b0e6-55052a18ff45", "d9079439-d469-4050-a736-e78f185b4de5", "13a48860-0cea-4f0e-a0ba-5b8825ccfe22", "bf299d4f-fd7a-49b5-b26a-139e000f6fcc", "18bba92e-2c50-49ab-9edc-96f00e1e564b", "38ab2039-2fb0-43eb-9d98-ec4d5629a251", "4496d4f0-4c17-40c3-ac9e-7678c2e254bb", "eb31edcf-b76a-4459-a307-4739aa773a88", "0e813ea2-aa48-45b8-a97e-8fe72f2646a2", "d6a465e7-8539-45d1-9cd5-15e849a9b052", "3f15ba40-a451-47c7-92f9-65067fa04182"], "befores": [{"name": "_session_faker", "status": "passed", "start": 1699242124035, "stop": 1699242124196}], "start": 1699242124035, "stop": 1699242128670}
\ No newline at end of file
{"uuid": "2d2852a2-0e6f-4ffe-b74a-340a2cb7554e", "befores": [{"name": "case_method", "status": "passed", "start": 1699242125513, "stop": 1699242125513}], "start": 1699242125513, "stop": 1699242125607}
\ No newline at end of file
{"uuid": "fa5ff65e-fee3-4222-9e7c-5cc1d3b3c220", "befores": [{"name": "case_method", "status": "passed", "start": 1699242128553, "stop": 1699242128553}], "start": 1699242128553, "stop": 1699242128667}
\ No newline at end of file
{"uuid": "0aa366b4-bc4c-46ab-a130-abfdd2c4e340", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242125743, "stop": 1699242125743}], "start": 1699242125743, "stop": 1699242125889}
\ No newline at end of file
{"uuid": "d436f9ce-e3a5-4d86-88ca-3149a079aa8a", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242127902, "stop": 1699242127902}], "start": 1699242127902, "stop": 1699242128009}
\ No newline at end of file
{"uuid": "14dd0568-0288-418d-8084-7a84f3129b75", "befores": [{"name": "update_key", "status": "passed", "start": 1699242127087, "stop": 1699242127087}], "start": 1699242127087, "stop": 1699242127183}
\ No newline at end of file
{"uuid": "5636f77f-ba6d-45c8-87ae-037b5af47ee5", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242124893, "stop": 1699242124893}], "start": 1699242124893, "stop": 1699242124988}
\ No newline at end of file
{"uuid": "b819d426-ad41-470a-be50-d49fccc7dfa5", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242127287, "stop": 1699242127287}], "start": 1699242127287, "stop": 1699242127381}
\ No newline at end of file
{"uuid": "18d4c5b1-a734-41a7-93df-33de5b2cd23c", "befores": [{"name": "update_key", "status": "passed", "start": 1699242127190, "stop": 1699242127191}], "start": 1699242127190, "stop": 1699242127280}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/getDem-GET-query-case_data12-expect_data12-None-None-None]", "status": "passed", "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/api/demension/v1/dem/getDem'"}, {"name": "case_method", "value": "'GET'"}, {"name": "case_mime", "value": "'query'"}, {"name": "case_data", "value": "{'code': 'dem_test57_abc'}"}, {"name": "expect_data", "value": "{'demCode': 'dem_test57_abc', 'name': '测试57期的维度'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242128172, "stop": 1699242128219, "uuid": "4496d4f0-4c17-40c3-ac9e-7678c2e254bb", "historyId": "4d106789ce18e6bb7970b97b17c32e82", "testCaseId": "fddf80969464aadbd498677a3a3dd380", "fullName": "InterfaceAutoTest_2.test_case.test_zhangsan.test_bpm.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_zhangsan"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_zhangsan.test_bpm"}]}
\ No newline at end of file
{"uuid": "d953dac0-39a8-4709-bce4-568469fb2dda", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242126152, "stop": 1699242126152}], "start": 1699242126152, "stop": 1699242126209}
\ No newline at end of file
{"uuid": "52f3ba05-e6d4-468d-be06-5001e3b9deac", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242128488, "stop": 1699242128488}], "start": 1699242128488, "stop": 1699242128547}
\ No newline at end of file
{"uuid": "d2b6c657-e3f1-4eac-8d01-c44e4551e1a2", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242125953, "stop": 1699242125953}], "start": 1699242125953, "stop": 1699242126148}
\ No newline at end of file
{"uuid": "23f50094-d621-4f7e-a10c-c0e3f7c4ed1a", "befores": [{"name": "case_method", "status": "passed", "start": 1699242127190, "stop": 1699242127190}], "start": 1699242127190, "stop": 1699242127284}
\ No newline at end of file
{"uuid": "88811c2b-972e-4bca-8d49-19c6bd055001", "befores": [{"name": "update_key", "status": "passed", "start": 1699242127287, "stop": 1699242127287}], "start": 1699242127287, "stop": 1699242127379}
\ No newline at end of file
{"uuid": "273e16cd-f351-4731-8ade-604fcffb1c10", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242124724, "stop": 1699242124724}], "start": 1699242124724, "stop": 1699242124782}
\ No newline at end of file
{"uuid": "688767ec-b8f9-4efd-880c-011680bb132b", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242128554, "stop": 1699242128554}], "start": 1699242128554, "stop": 1699242128665}
\ No newline at end of file
{"uuid": "679ad91b-7ec8-4110-874c-ef28cf51c4a5", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242128016, "stop": 1699242128016}], "start": 1699242128016, "stop": 1699242128165}
\ No newline at end of file
{"uuid": "50c82e86-a205-4143-b1da-df88aca92cb0", "befores": [{"name": "case_url", "status": "passed", "start": 1699242126933, "stop": 1699242126933}], "start": 1699242126933, "stop": 1699242127014}
\ No newline at end of file
{"uuid": "ff832e32-5f9f-4d8a-a439-4c7db3f24b54", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242126934, "stop": 1699242126934}], "start": 1699242126934, "stop": 1699242127011}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data1-expect_data1-None-None-None]", "status": "passed", "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/auth'"}, {"name": "case_method", "value": "'POST'"}, {"name": "case_mime", "value": "'json'"}, {"name": "case_data", "value": "{'password': 'MTIzNDU2', 'username': 'adminadminadminadminadminadmin'}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242124725, "stop": 1699242124777, "uuid": "62b32c4f-e1ed-42a4-a6df-ea3f333ffa8b", "historyId": "3db2dbb08845117ec2de66609935964c", "testCaseId": "317585064e361b6d13052050b1dc8a9e", "fullName": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_laohuang"}, {"name": "suite", "value": "test_bpm_laohuang"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang"}]}
\ No newline at end of file
{"uuid": "543987ff-048d-4bee-8c66-6975ab0e3813", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242128488, "stop": 1699242128488}], "start": 1699242128488, "stop": 1699242128549}
\ No newline at end of file
{"uuid": "6f03fb44-e03a-4b7e-abaa-f6af446f00df", "befores": [{"name": "case_method", "status": "passed", "start": 1699242125307, "stop": 1699242125307}], "start": 1699242125307, "stop": 1699242125410}
\ No newline at end of file
ERROR  黄总:test_bpm.py:53 断言失败,用例数据为:{'ids': '1721372365440434176'},期望数据为:{'state': True, 'message': '删除维度成功'},服务器返回的数据为:{"state":true,"message":"删除维度成功!","value":""}
\ No newline at end of file
{"uuid": "0640a536-f7ba-4b76-89df-e5f9040e85f4", "befores": [{"name": "case_method", "status": "passed", "start": 1699242127387, "stop": 1699242127387}], "start": 1699242127387, "stop": 1699242127484}
\ No newline at end of file
{"uuid": "ba405edf-49ad-4a3f-9ceb-12a56a43c044", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242126934, "stop": 1699242126935}], "start": 1699242126934, "stop": 1699242127010}
\ No newline at end of file
{"uuid": "69834995-d4e2-42d6-8b88-87d9e3599a3a", "befores": [{"name": "case_method", "status": "passed", "start": 1699242125895, "stop": 1699242125895}], "start": 1699242125895, "stop": 1699242125950}
\ No newline at end of file
{"uuid": "87b31682-6a58-4423-9dd7-896d1c9fb3cc", "befores": [{"name": "case_url", "status": "passed", "start": 1699242125611, "stop": 1699242125611}], "start": 1699242125611, "stop": 1699242125739}
\ No newline at end of file
{"uuid": "80ade866-cea2-4594-b373-4386d84eb4a1", "befores": [{"name": "update_key", "status": "passed", "start": 1699242127806, "stop": 1699242127806}], "start": 1699242127806, "stop": 1699242127895}
\ No newline at end of file
{"uuid": "a20cd3a6-44c4-4a9c-958d-656730447eba", "befores": [{"name": "case_data", "status": "passed", "start": 1699242124994, "stop": 1699242124994}], "start": 1699242124994, "stop": 1699242125092}
\ No newline at end of file
{"uuid": "002b230d-ff50-4e44-a330-ce93ddfaf4c3", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242128227, "stop": 1699242128227}], "start": 1699242128227, "stop": 1699242128409}
\ No newline at end of file
{"uuid": "ad416605-4f81-43c0-bb23-b572a593b6d9", "befores": [{"name": "expect_data", "status": "passed", "start": 1699242127605, "stop": 1699242127605}], "start": 1699242127605, "stop": 1699242127701}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data4-expect_data4-None-None-None]", "status": "passed", "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/auth'"}, {"name": "case_method", "value": "'POST'"}, {"name": "case_mime", "value": "'json'"}, {"name": "case_data", "value": "{'password': 'MTIzNDU2', 'username': '@#!@#!@'}"}, {"name": "expect_data", "value": "{'state': False, 'message': '账号或密码错误'}"}, {"name": "sql_type", "value": "None"}, {"name": "sql_data", "value": "None"}, {"name": "update_key", "value": "None"}], "start": 1699242127288, "stop": 1699242127378, "uuid": "fc82b399-6c00-4a71-835d-75162cd1cfba", "historyId": "7c81daf796c88d8be6affeae5094a638", "testCaseId": "fddf80969464aadbd498677a3a3dd380", "fullName": "InterfaceAutoTest_2.test_case.test_zhangsan.test_bpm.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_zhangsan"}, {"name": "suite", "value": "test_bpm"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_zhangsan.test_bpm"}]}
\ No newline at end of file
{"uuid": "6bfdfd00-d1b3-4417-b860-3d5c847e4e67", "befores": [{"name": "case_data", "status": "passed", "start": 1699242124535, "stop": 1699242124535}], "start": 1699242124535, "stop": 1699242124719}
\ No newline at end of file
{"uuid": "8d8eb17d-825f-4c8d-9953-34a5467ba623", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242128016, "stop": 1699242128016}], "start": 1699242128016, "stop": 1699242128166}
\ No newline at end of file
{"uuid": "808df71c-19b3-472f-a96e-59e0a35da383", "befores": [{"name": "case_mime", "status": "passed", "start": 1699242126283, "stop": 1699242126283}], "start": 1699242126283, "stop": 1699242126393}
\ No newline at end of file
{"uuid": "aacdb708-1a5e-425a-a711-f0621a66c9d2", "befores": [{"name": "case_method", "status": "passed", "start": 1699242127805, "stop": 1699242127805}], "start": 1699242127805, "stop": 1699242127899}
\ No newline at end of file
{"name": "test_bpm[http://120.46.172.186:8080/refresh-GET-None-None-expect_data10-None-None-None]", "status": "failed", "statusDetails": {"message": "AssertionError: 断言失败", "trace": "self = <InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x12AFBA90>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x12B93C10>\nreq_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x12AF3630>, case_url = 'http://120.46.172.186:8080/refresh'\ncase_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None\n\n @pytest.mark.parametrize(\"case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key\", ReadExcel(\"BPM-laohuang\").get_data())\n def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):\n # 判断sql语句的类型是否为delete\n if sql_type == \"delete\":\n # 使用DB类对象执行删除的sql语句\n db_fix.delete(sql_data)\n # 使用RequestsMethod类对象发送请求--pass\n # 判断sql语句类型是否为select\n elif sql_type == \"select\":\n # 使用DB类对象执行查询的sql语句,并接收查询的结果\n select_result = db_fix.select(sql_data)\n # 将查询结果更新到用例数据中\n case_data[update_key] = select_result\n # 使用RequestsMethod类对象发送请求--pass\n \n # 判断sql语句的类型是否为select|delete或者为delete|select\n elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n # 使用DB类对象执行删除的sql语句\n db_fix.delete(sql_data.get(\"delete\"))\n # 使用DB类对象执行查询的sql语句,并接收查询的结果\n select_result = db_fix.select(sql_data.get(\"select\"))\n # 将查询结果更新到用例数据中\n case_data[update_key] = select_result\n \n # 使用RequestsMethod类对象发送请求\n res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)\n \n \n # 断言\n try:\n for key in expect_data:\n> assert expect_data[key] == res.json().get(key)\nE AssertionError: assert '刷新成功' == None\nE + where None = <built-in method get of dict object at 0x12AD6300>('message')\nE + where <built-in method get of dict object at 0x12AD6300> = {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOj...0MjEyNX0.Oaqtv0ZEBeM6jwEapNM913EPBdyJzege659szhLr2viOQDvcEhggCGAr0NUm6To4eoFXaGT79C6s3YJw9usA7Q', 'userAttrs': {}, ...}.get\nE + where {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOj...0MjEyNX0.Oaqtv0ZEBeM6jwEapNM913EPBdyJzege659szhLr2viOQDvcEhggCGAr0NUm6To4eoFXaGT79C6s3YJw9usA7Q', 'userAttrs': {}, ...} = <bound method Response.json of <Response [200]>>()\nE + where <bound method Response.json of <Response [200]>> = <Response [200]>.json\n\nInterfaceAutoTest_2\\test_case\\test_laohuang\\test_bpm_laohuang.py:48: AssertionError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x12AFBA90>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x12B93C10>\nreq_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x12AF3630>, case_url = 'http://120.46.172.186:8080/refresh'\ncase_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None\n\n @pytest.mark.parametrize(\"case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key\", ReadExcel(\"BPM-laohuang\").get_data())\n def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):\n # 判断sql语句的类型是否为delete\n if sql_type == \"delete\":\n # 使用DB类对象执行删除的sql语句\n db_fix.delete(sql_data)\n # 使用RequestsMethod类对象发送请求--pass\n # 判断sql语句类型是否为select\n elif sql_type == \"select\":\n # 使用DB类对象执行查询的sql语句,并接收查询的结果\n select_result = db_fix.select(sql_data)\n # 将查询结果更新到用例数据中\n case_data[update_key] = select_result\n # 使用RequestsMethod类对象发送请求--pass\n \n # 判断sql语句的类型是否为select|delete或者为delete|select\n elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n # 使用DB类对象执行删除的sql语句\n db_fix.delete(sql_data.get(\"delete\"))\n # 使用DB类对象执行查询的sql语句,并接收查询的结果\n select_result = db_fix.select(sql_data.get(\"select\"))\n # 将查询结果更新到用例数据中\n case_data[update_key] = select_result\n \n # 使用RequestsMethod类对象发送请求\n res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)\n \n \n # 断言\n try:\n for key in expect_data:\n assert expect_data[key] == res.json().get(key)\n except:\n log.error(\"断言失败\"+\",用例数据为:\"+str(case_data)+\",期望数据为:\"+str(expect_data)+\",服务器返回的数据为:\"+res.text)\n> raise AssertionError(\"断言失败\")\nE AssertionError: 断言失败\n\nInterfaceAutoTest_2\\test_case\\test_laohuang\\test_bpm_laohuang.py:51: AssertionError"}, "attachments": [{"name": "log", "source": "62d79d46-483c-4870-87a8-b04ede133c3b-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "case_url", "value": "'http://120.46.172.186:8080/refresh'"}, {"name": "case_method", "value": "'GET'"}, {"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": 1699242125613, "stop": 1699242125721, "uuid": "ee9a79c9-7117-47f2-827d-a5ec1c39883e", "historyId": "b99da36f8ce00850ab8e778090aec6f5", "testCaseId": "317585064e361b6d13052050b1dc8a9e", "fullName": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang.TestBPM#test_bpm", "labels": [{"name": "parentSuite", "value": "InterfaceAutoTest_2.test_case.test_laohuang"}, {"name": "suite", "value": "test_bpm_laohuang"}, {"name": "subSuite", "value": "TestBPM"}, {"name": "host", "value": "LAPTOP-TAHSRL94"}, {"name": "thread", "value": "24068-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "InterfaceAutoTest_2.test_case.test_laohuang.test_bpm_laohuang"}]}
\ No newline at end of file
{"uuid": "52b821d0-51d0-4ba8-a08f-e299eff81c76", "befores": [{"name": "case_data", "status": "passed", "start": 1699242128016, "stop": 1699242128016}], "start": 1699242128016, "stop": 1699242128167}
\ No newline at end of file
{"uuid": "7c8c0fd5-7786-49d6-a835-c97ffacf4898", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242125203, "stop": 1699242125203}], "start": 1699242125203, "stop": 1699242125297}
\ No newline at end of file
{"uuid": "0bb8f267-0d98-4686-af02-11636d222fd0", "befores": [{"name": "sql_data", "status": "passed", "start": 1699242127490, "stop": 1699242127490}], "start": 1699242127490, "stop": 1699242127598}
\ No newline at end of file
{"uuid": "046d82c2-2926-4807-bc2f-c452839053df", "befores": [{"name": "sql_type", "status": "passed", "start": 1699242124994, "stop": 1699242124994}], "start": 1699242124994, "stop": 1699242125091}
\ No newline at end of file
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