requests+pytest+allure+jsonpath接口自动化测试框架

This commit is contained in:
zy7y 2020-08-03 16:15:03 +08:00
parent 5385439326
commit 0eb15e5348
113 changed files with 2645 additions and 61 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

121
.gitignore vendored Normal file
View File

@ -0,0 +1,121 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pycahrm
.idea
# pytest
.pytest_cache

View File

@ -1,36 +0,0 @@
# apiAutoTest
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,39 +1,42 @@
# apiAutoTest
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
学习pythton接口自动化框架的第一阶段成果
#### 软件架构
软件架构说明
| 名称 | 版本 | 作用 |
| -------- | -------- | ---- |
| python | 3.7.8 | |
| pytest | 6.0.1 | 底层单元测试框架,用来实现参数化,自动执行用例 |
| allure-pytest | 2.8.17 | allure与pytest的插件可以生成allure的测试报告 |
| jsonpath | 0.82 | 用来进行响应断言操作 |
| loguru | 0.54 | 记录日志 |
| PyYAML | 5.3.1 | 读取yml/yaml格式的配置文件 |
| Allure | 2.13.5 | 要生成allure测试报告必须要在本机安装allure并配置环境变量 |
| xlrd | 1.2.0 | 用来读取excel中用例数据 |
| xlutils | 2.0.0 | 用来向excel中写入实际的响应结果 |
| yagmail | 0.11.224 | 测试完成后发送邮件 |
| requests| 2.24.0 | 发送请求 |
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
1. git clone https://gitee.com/zy7y/apiAutoTest.git
2. 使用pycharm打开项目使用Terminal 输入 python3 -m venv venv 新建虚拟环境
3. 执行pip install -r requirements.txt 安装依赖库
4. 修改config.ymal文件中email文件配置收件人邮箱授权码发件人邮箱
5. 运行/test/test_api.py 文件
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
1. 本项目直接使用的requests.Session理论上实现了cookie请求的管理不用单独提取cookie
2. 项目中token操作中为写时请务必保证是能正常获得响应并且返回了token字段
3. 本项目用例书写格式请务必遵循sheet页用例说明中有一部分
4. 该项目找的是b站上的一个前后端分离应用域名使用的是b站朋友提供的请大家谨慎操作学习
5. 该项目并没有考虑到url中传path参数的形式users/:id
6. 本项目所要投入生产请执行检查配置用例数据config.yaml
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 博客园首发
https://www.cnblogs.com/zy7y/p/13426816.html
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

9
api/__init__.py Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: zy7y
@file: __init__.py.py
@ide: PyCharm
@time: 2020/7/31
"""

43
api/base_requests.py Normal file
View File

@ -0,0 +1,43 @@
#!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: zy7y
@file: base_requests.py
@ide: PyCharm
@time: 2020/7/31
"""
from loguru import logger
import requests
class BaseRequest(object):
def __init__(self):
pass
# 请求
def base_requests(self, method, url, data=None, file_var=None, file_path=None, header=None):
"""
:param method: 请求方法
:param url: 接口path
:param data: 数据,请传入dict样式的字符串
:param file_path: 上传的文件路径
:param file_var: 接口中接收文件对象的参数名
:param header: 请求头
:return: 完整的响应对象
"""
session = requests.Session()
if (file_var in [None, '']) and (file_path in [None, '']):
files = None
else:
# 文件不为空的操作
files = {file_var: open(file_path, 'rb')}
# get 请求参数传递形式 params
if method == 'get':
res = session.request(method=method, url=url, params=data, headers=header)
else:
res = session.request(method=method, url=url, data=data, files=files, headers=header)
logger.info(f'请求方法:{method},请求路径:{url}, 请求参数:{data}, 请求文件:{files}, 请求头:{header})')
return res.json()

31
config/config.yaml Normal file
View File

@ -0,0 +1,31 @@
server:
test: http://127.0.0.1:8888/api/private/v1/
dev: http://47.115.124.102:8888/api/private/v1/
response_reg:
# 提取token的表达式
token: $.data.token
# 提取响应的断言数据
response: $.meta
file_path:
case_data: ../data/case_data.xlsx
report_data: ../report/data/
report_generate: ../report/html/
report_zip: ../report/html/apiAutoTestReport.zip
log_path: ../log/运行日志{time}.log
email:
# 发件人邮箱
user: 123456.com
# 发件人邮箱授权码
password: ASGCSFSGS
# 邮箱host
host: smtp.163.com
contents: 解压apiAutoReport.zip(接口测试报告)后请使用已安装Live Server 插件的VsCode打开解压目录下的index.html查看报告
# 收件人邮箱
addressees: ["收件人邮箱1","收件人邮箱2","收件人邮箱3"]
title: 接口自动化测试报告(见附件)
# 附件地址
enclosures: ["../report/html/apiAutoTestReport.zip",]

BIN
data/.DS_Store vendored Normal file

Binary file not shown.

BIN
data/case_data.xlsx Normal file

Binary file not shown.

2
pytest.ini Normal file
View File

@ -0,0 +1,2 @@
[pytest]
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True

View File

@ -0,0 +1 @@
{"uuid": "3cc1ab93-82e5-49e0-9a84-c8baec9f1442", "befores": [{"name": "expect", "status": "passed", "start": 1596442208773, "stop": 1596442208773}], "start": 1596442208773, "stop": 1596442208956}

View File

@ -0,0 +1 @@
{"uuid": "b355df85-5200-4aca-a77e-40f2a3643dca", "befores": [{"name": "file_var", "status": "passed", "start": 1596442208442, "stop": 1596442208442}], "start": 1596442208442, "stop": 1596442208557}

View File

@ -0,0 +1 @@
{"uuid": "1be071f3-8886-43d6-a59b-01189dae4d2e", "befores": [{"name": "actual", "status": "passed", "start": 1596442208443, "stop": 1596442208443}], "start": 1596442208443, "stop": 1596442208555}

View File

@ -0,0 +1 @@
{"uuid": "9e233be5-b435-4178-8e73-cc335b55a858", "befores": [{"name": "file_var", "status": "passed", "start": 1596442208772, "stop": 1596442208772}], "start": 1596442208772, "stop": 1596442208958}

View File

@ -0,0 +1 @@
{"uuid": "2e0f1923-aa69-4ba6-86ab-42b742448e8f", "befores": [{"name": "method", "status": "passed", "start": 1596442208442, "stop": 1596442208442}], "start": 1596442208442, "stop": 1596442208558}

View File

@ -0,0 +1 @@
{"uuid": "7907d709-aa11-46e0-821a-61d5537ec19c", "befores": [{"name": "actual", "status": "passed", "start": 1596442208965, "stop": 1596442208965}], "start": 1596442208965, "stop": 1596442209184}

View File

@ -0,0 +1 @@
{"uuid": "a93caa2c-cf2e-488a-84eb-a6024b730741", "befores": [{"name": "method", "status": "passed", "start": 1596442208563, "stop": 1596442208563}], "start": 1596442208562, "stop": 1596442208766}

View File

@ -0,0 +1 @@
{"uuid": "c4975971-83df-49de-8d4a-88ff6ed5ce4a", "befores": [{"name": "actual", "status": "passed", "start": 1596442208564, "stop": 1596442208564}], "start": 1596442208564, "stop": 1596442208763}

View File

@ -0,0 +1 @@
{"uuid": "c07b1d9c-04eb-46d3-bd19-c49dab9542e4", "befores": [{"name": "file_var", "status": "passed", "start": 1596442208964, "stop": 1596442208964}], "start": 1596442208964, "stop": 1596442209186}

View File

@ -0,0 +1 @@
{"uuid": "539bf780-4f07-4381-aba8-1a5dac9ea70d", "befores": [{"name": "case_number", "status": "passed", "start": 1596442208562, "stop": 1596442208562}], "start": 1596442208562, "stop": 1596442208768}

View File

@ -0,0 +1 @@
{"uuid": "3c7daedf-6626-4f43-b880-7060ab0c2f99", "befores": [{"name": "case_number", "status": "passed", "start": 1596442208963, "stop": 1596442208963}], "start": 1596442208963, "stop": 1596442209188}

View File

@ -0,0 +1 @@
{"uuid": "38956d76-b9f2-43a0-9e3d-c9c252b896bb", "befores": [{"name": "is_token", "status": "passed", "start": 1596442208771, "stop": 1596442208771}], "start": 1596442208771, "stop": 1596442208959}

View File

@ -0,0 +1 @@
{"uuid": "95dab294-6c51-4d67-8beb-050d8361f6ac", "befores": [{"name": "path", "status": "passed", "start": 1596442208441, "stop": 1596442208441}], "start": 1596442208441, "stop": 1596442208559}

View File

@ -0,0 +1 @@
{"uuid": "f946f66f-0997-4096-bdaa-581392ada5f1", "befores": [{"name": "dependent", "status": "passed", "start": 1596442208563, "stop": 1596442208563}], "start": 1596442208563, "stop": 1596442208765}

View File

@ -0,0 +1 @@
{"uuid": "48fba118-1f8d-4c6e-99ab-790a9fb9fb5c", "befores": [{"name": "path", "status": "passed", "start": 1596442208963, "stop": 1596442208963}], "start": 1596442208963, "stop": 1596442209187}

View File

@ -0,0 +1,7 @@
2020-08-03 16:10:08.965 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"pagenum": 1, "pagesize": "12"}
2020-08-03 16:10:08.966 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'pagenum': 1, 'pagesize': '12'}
2020-08-03 16:10:09.051 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/users, 请求参数:{'pagenum': 1, 'pagesize': '12'}, 请求文件:None, 请求头:{})
2020-08-03 16:10:09.056 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:09.060 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 5, 列号: 11, 写入值: {"data": null, "meta": {"msg": "无效token", "status": 400}}
2020-08-03 16:10:09.061 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}

View File

@ -0,0 +1 @@
{"uuid": "e86c77f2-de49-44a0-b1f1-be41cc67e6c8", "befores": [{"name": "method", "status": "passed", "start": 1596442208772, "stop": 1596442208772}], "start": 1596442208772, "stop": 1596442208958}

View File

@ -0,0 +1 @@
{"uuid": "4a5ccd91-f34c-472c-926c-75480ba8a828", "befores": [{"name": "file_path", "status": "passed", "start": 1596442208563, "stop": 1596442208563}], "start": 1596442208563, "stop": 1596442208765}

View File

@ -0,0 +1 @@
{"uuid": "f7ac17af-d0e1-40db-9077-4b0fe43b7308", "befores": [{"name": "expect", "status": "passed", "start": 1596442208965, "stop": 1596442208965}], "start": 1596442208965, "stop": 1596442209184}

View File

@ -0,0 +1 @@
{"uuid": "5f9ed7f7-10d7-46e8-94ef-e69c7b4ef5df", "befores": [{"name": "dependent", "status": "passed", "start": 1596442208964, "stop": 1596442208964}], "start": 1596442208964, "stop": 1596442209185}

View File

@ -0,0 +1 @@
{"uuid": "b7aee513-0c74-4544-9591-4e8730eaf746", "befores": [{"name": "case_number", "status": "passed", "start": 1596442208441, "stop": 1596442208441}], "start": 1596442208441, "stop": 1596442208559}

View File

@ -0,0 +1 @@
{"uuid": "e6268c15-d060-4eb8-bd01-e77f53746517", "befores": [{"name": "file_path", "status": "passed", "start": 1596442208442, "stop": 1596442208442}], "start": 1596442208442, "stop": 1596442208557}

View File

@ -0,0 +1 @@
{"uuid": "2c8ea1ce-7f6f-4c64-943d-898f357fb9a3", "befores": [{"name": "dependent", "status": "passed", "start": 1596442208772, "stop": 1596442208772}], "start": 1596442208772, "stop": 1596442208957}

View File

@ -0,0 +1 @@
{"uuid": "117646ec-ff06-4af8-b8bc-17c840fca8c4", "befores": [{"name": "is_token", "status": "passed", "start": 1596442208963, "stop": 1596442208963}], "start": 1596442208963, "stop": 1596442209187}

View File

@ -0,0 +1,11 @@
2020-08-03 16:10:08.564 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"username": "admin", "password": "123456"}
2020-08-03 16:10:08.564 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'username': 'admin', 'password': '123456'}
2020-08-03 16:10:08.750 | INFO  | api.base_requests:base_requests:41 - 请求方法:post请求路径:http://47.115.124.102:8888/api/private/v1/login, 请求参数:{'username': 'admin', 'password': '123456'}, 请求文件:None, 请求头:{})
2020-08-03 16:10:08.755 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.761 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 3, 列号: 11, 写入值: {"data": {"id": 500, "rid": 0, "username": "admin", "mobile": "18487984889", "email": "18401782588@qq.com", "token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM"}, "meta": {"msg": "登录成功", "status": 200}}
2020-08-03 16:10:08.761 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}
2020-08-03 16:10:08.762 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': {'id': 500, 'rid': 0, 'username': 'admin', 'mobile': '18487984889', 'email': '18401782588@qq.com', 'token': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'}, 'meta': {'msg': '登录成功', 'status': 200}}
需要校验的数据字典: {'msg': '登录成功', 'status': 200}
预期校验的数据字典: {'msg': '登录成功', 'status': 200}
测试结果: True

View File

@ -0,0 +1 @@
{"uuid": "4e42afda-7abc-4d77-ab42-31c82fe307b7", "befores": [{"name": "case_number", "status": "passed", "start": 1596442208771, "stop": 1596442208771}], "start": 1596442208771, "stop": 1596442208960}

View File

@ -0,0 +1,11 @@
2020-08-03 16:10:08.443 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"username": "admin", "password": ""}
2020-08-03 16:10:08.444 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'username': 'admin', 'password': ''}
2020-08-03 16:10:08.539 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/login, 请求参数:{'username': 'admin', 'password': ''}, 请求文件:None, 请求头:{})
2020-08-03 16:10:08.544 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.551 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 2, 列号: 11, 写入值: {"data": null, "meta": {"msg": "参数错误", "status": 400}}
2020-08-03 16:10:08.551 | INFO  | test.test_api:test_main:98 - token_header: {},
no_token_header: {}
2020-08-03 16:10:08.553 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
需要校验的数据字典: {'msg': '参数错误', 'status': 400}
预期校验的数据字典: {'msg': '参数错误', 'status': 400}
测试结果: True

View File

@ -0,0 +1 @@
{"uuid": "bc2389d7-9f71-465a-8bc1-3a5f7b141b39", "befores": [{"name": "data", "status": "passed", "start": 1596442208442, "stop": 1596442208442}], "start": 1596442208442, "stop": 1596442208556}

View File

@ -0,0 +1 @@
{"uuid": "a23101c6-9ab2-482e-85bc-aa1fa5edc024", "befores": [{"name": "data", "status": "passed", "start": 1596442208772, "stop": 1596442208772}], "start": 1596442208772, "stop": 1596442208956}

View File

@ -0,0 +1 @@
{"uuid": "dfd149a1-bb1f-4884-ad49-4ef44ed141fc", "befores": [{"name": "dependent", "status": "passed", "start": 1596442208442, "stop": 1596442208442}], "start": 1596442208442, "stop": 1596442208556}

View File

@ -0,0 +1 @@
{"uuid": "b5dcbc00-01d8-40dd-a1b3-7d4f5f2045d5", "befores": [{"name": "expect", "status": "passed", "start": 1596442208442, "stop": 1596442208443}], "start": 1596442208442, "stop": 1596442208555}

View File

@ -0,0 +1 @@
{"uuid": "afc2bb59-833f-47b8-adc7-60dc68b33998", "befores": [{"name": "file_path", "status": "passed", "start": 1596442208964, "stop": 1596442208964}], "start": 1596442208964, "stop": 1596442209186}

View File

@ -0,0 +1 @@
{"uuid": "159a53b0-0797-4a2c-a94b-f19082aeeee0", "befores": [{"name": "method", "status": "passed", "start": 1596442208964, "stop": 1596442208964}], "start": 1596442208964, "stop": 1596442209186}

View File

@ -0,0 +1 @@
{"uuid": "a576c36f-a650-49e5-85a9-b4c23b19d264", "befores": [{"name": "path", "status": "passed", "start": 1596442208771, "stop": 1596442208771}], "start": 1596442208771, "stop": 1596442208959}

View File

@ -0,0 +1 @@
{"uuid": "bf187d00-d44a-4e58-8afb-dab2a9136bf6", "befores": [{"name": "is_token", "status": "passed", "start": 1596442208441, "stop": 1596442208441}], "start": 1596442208441, "stop": 1596442208558}

View File

@ -0,0 +1 @@
{"uuid": "68b137d7-a15a-4985-8c21-1cef89d65bc5", "befores": [{"name": "data", "status": "passed", "start": 1596442208964, "stop": 1596442208964}], "start": 1596442208964, "stop": 1596442209185}

View File

@ -0,0 +1 @@
{"uuid": "7154252b-04d1-4c15-843f-fe77b3553a07", "befores": [{"name": "path", "status": "passed", "start": 1596442208562, "stop": 1596442208562}], "start": 1596442208562, "stop": 1596442208767}

View File

@ -0,0 +1 @@
{"name": "test_main[get请求查询用户数据列表0]", "status": "passed", "steps": [{"name": "处理相关数据依赖header", "status": "passed", "start": 1596442208774, "stop": 1596442208782}, {"name": "发送请求取得响应结果的json串", "status": "passed", "start": 1596442208782, "stop": 1596442208934}, {"name": "将响应结果的内容写入用例中的实际结果栏", "status": "passed", "start": 1596442208934, "stop": 1596442208945}, {"name": "根据配置文件的提取响应规则提取实际数据", "status": "passed", "start": 1596442208945, "stop": 1596442208945}, {"name": "处理读取出来的预期结果响应", "status": "passed", "start": 1596442208945, "stop": 1596442208945}, {"name": "预期结果与实际响应进行断言操作", "status": "passed", "start": 1596442208945, "stop": 1596442208946}], "attachments": [{"name": "stderr", "source": "dc545864-c7fd-4683-898d-72f39c3b961b-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "case_number", "value": "'case_003'"}, {"name": "path", "value": "'users'"}, {"name": "is_token", "value": "'读'"}, {"name": "method", "value": "'get'"}, {"name": "file_var", "value": "''"}, {"name": "file_path", "value": "''"}, {"name": "dependent", "value": "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'"}, {"name": "data", "value": "'{\"pagenum\": 1, \"pagesize\": \"12\"}'"}, {"name": "expect", "value": "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'"}, {"name": "actual", "value": "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'"}], "start": 1596442208773, "stop": 1596442208946, "uuid": "c267f4d3-029d-447c-bb34-e369e71806b5", "historyId": "0a0b8ae05f47f96cf01c48778be171e9", "testCaseId": "c2b13641bbced8035cf0282bfb1839e4", "fullName": "test.test_api.TestApiAuto#test_main", "labels": [{"name": "parentSuite", "value": "test"}, {"name": "suite", "value": "test_api"}, {"name": "subSuite", "value": "TestApiAuto"}, {"name": "host", "value": "bogon"}, {"name": "thread", "value": "4035-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test.test_api"}]}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"name": "test_main[post请求实现登录]", "status": "passed", "steps": [{"name": "处理相关数据依赖header", "status": "passed", "start": 1596442208564, "stop": 1596442208565}, {"name": "发送请求取得响应结果的json串", "status": "passed", "start": 1596442208565, "stop": 1596442208751}, {"name": "将响应结果的内容写入用例中的实际结果栏", "status": "passed", "steps": [{"name": "从登录后的响应中提取token到header中", "status": "passed", "start": 1596442208762, "stop": 1596442208762}], "start": 1596442208751, "stop": 1596442208762}, {"name": "根据配置文件的提取响应规则提取实际数据", "status": "passed", "start": 1596442208762, "stop": 1596442208762}, {"name": "处理读取出来的预期结果响应", "status": "passed", "start": 1596442208762, "stop": 1596442208762}, {"name": "预期结果与实际响应进行断言操作", "status": "passed", "start": 1596442208762, "stop": 1596442208763}], "attachments": [{"name": "stderr", "source": "795e38ee-c626-4d79-ab8e-68f1eb96b9dc-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "case_number", "value": "'case_002'"}, {"name": "path", "value": "'login'"}, {"name": "is_token", "value": "'写'"}, {"name": "method", "value": "'post'"}, {"name": "file_var", "value": "''"}, {"name": "file_path", "value": "''"}, {"name": "dependent", "value": "''"}, {"name": "data", "value": "'{\"username\": \"admin\", \"password\": \"123456\"}'"}, {"name": "expect", "value": "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'"}, {"name": "actual", "value": "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'"}], "start": 1596442208564, "stop": 1596442208763, "uuid": "9eca533d-e041-42e7-80c5-cd6b779683b3", "historyId": "919b7d04f88d30572b93beb38f794577", "testCaseId": "c2b13641bbced8035cf0282bfb1839e4", "fullName": "test.test_api.TestApiAuto#test_main", "labels": [{"name": "parentSuite", "value": "test"}, {"name": "suite", "value": "test_api"}, {"name": "subSuite", "value": "TestApiAuto"}, {"name": "host", "value": "bogon"}, {"name": "thread", "value": "4035-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test.test_api"}]}

View File

@ -0,0 +1 @@
{"name": "test_main[get请求实现登录]", "status": "passed", "steps": [{"name": "处理相关数据依赖header", "status": "passed", "start": 1596442208444, "stop": 1596442208445}, {"name": "发送请求取得响应结果的json串", "status": "passed", "start": 1596442208445, "stop": 1596442208540}, {"name": "将响应结果的内容写入用例中的实际结果栏", "status": "passed", "start": 1596442208540, "stop": 1596442208552}, {"name": "根据配置文件的提取响应规则提取实际数据", "status": "passed", "start": 1596442208552, "stop": 1596442208553}, {"name": "处理读取出来的预期结果响应", "status": "passed", "start": 1596442208553, "stop": 1596442208553}, {"name": "预期结果与实际响应进行断言操作", "status": "passed", "start": 1596442208554, "stop": 1596442208554}], "attachments": [{"name": "stderr", "source": "834e6a53-c380-4a12-826a-6e44ddb05ce2-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "case_number", "value": "'case_001'"}, {"name": "path", "value": "'login'"}, {"name": "is_token", "value": "''"}, {"name": "method", "value": "'get'"}, {"name": "file_var", "value": "''"}, {"name": "file_path", "value": "''"}, {"name": "dependent", "value": "''"}, {"name": "data", "value": "'{\"username\": \"admin\", \"password\": \"\"}'"}, {"name": "expect", "value": "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'"}, {"name": "actual", "value": "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'"}], "start": 1596442208444, "stop": 1596442208554, "uuid": "b9c2a40c-21a4-43d0-8bff-fc8d2acf28c4", "historyId": "5012049d63ad8ce5a26120338c8702c7", "testCaseId": "c2b13641bbced8035cf0282bfb1839e4", "fullName": "test.test_api.TestApiAuto#test_main", "labels": [{"name": "parentSuite", "value": "test"}, {"name": "suite", "value": "test_api"}, {"name": "subSuite", "value": "TestApiAuto"}, {"name": "host", "value": "bogon"}, {"name": "thread", "value": "4035-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test.test_api"}]}

View File

@ -0,0 +1 @@
{"uuid": "30ab8695-7182-4fd7-b070-feb87165ad1e", "befores": [{"name": "expect", "status": "passed", "start": 1596442208563, "stop": 1596442208564}], "start": 1596442208563, "stop": 1596442208764}

View File

@ -0,0 +1,18 @@
2020-08-03 16:10:08.773 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"pagenum": 1, "pagesize": "12"}
2020-08-03 16:10:08.778 | INFO  | tools.read_data:read_actual:94 - i $.data.id, v ['$.data.id'], actual {'data': {'id': 500, 'rid': 0, 'username': 'admin', 'mobile': '18487984889', 'email': '18401782588@qq.com', 'token': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'}, 'meta': {'msg': '登录成功', 'status': 200}}
<class 'dict'>
2020-08-03 16:10:08.780 | INFO  | tools.read_data:read_actual:94 - i $.meta.msg, v ['$.meta.msg', '$.meta.status'], actual {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
<class 'dict'>
2020-08-03 16:10:08.781 | INFO  | tools.read_data:read_actual:94 - i $.meta.status, v ['$.meta.msg', '$.meta.status'], actual {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
<class 'dict'>
2020-08-03 16:10:08.781 | DEBUG  | test.test_api:treating_data:62 - 依赖数据解析获得的字典{'id': 500, 'msg': '参数错误', 'status': 400}
2020-08-03 16:10:08.781 | DEBUG  | test.test_api:treating_data:67 - data有数据依赖有数据时 {'id': 500, 'msg': '参数错误', 'status': 400, 'pagenum': 1, 'pagesize': '12'}
2020-08-03 16:10:08.933 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/users, 请求参数:{'id': 500, 'msg': '参数错误', 'status': 400, 'pagenum': 1, 'pagesize': '12'}, 请求文件:None, 请求头:{'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'})
2020-08-03 16:10:08.938 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.944 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 4, 列号: 11, 写入值: {"data": {"total": 29, "pagenum": 1, "users": [{"id": 500, "role_name": "超级管理员", "username": "admin", "create_time": 1486720211, "mobile": "18487984889", "email": "18401782588@qq.com", "mg_state": true}, {"id": 929, "role_name": "超级管理员", "username": "asff", "create_time": 1595626624, "mobile": "13888888888", "email": "fiji@qq.com", "mg_state": true}, {"id": 933, "role_name": "超级管理员", "username": "1111", "create_time": 1595844905, "mobile": "13871112234", "email": "1111@qq.com", "mg_state": true}, {"id": 934, "role_name": "超级管理员", "username": "111", "create_time": 1595846015, "mobile": "13871112256", "email": "111@qq.com", "mg_state": true}, {"id": 935, "role_name": "超级管理员", "username": "ces", "create_time": 1595908009, "mobile": "13478945612", "email": "123456@qq.com", "mg_state": true}, {"id": 936, "role_name": "超级管理员", "username": "ssc", "create_time": 1595908072, "mobile": "18370081345", "email": "12@qq.com", "mg_state": true}, {"id": 937, "role_name": "超级管理员", "username": "8888", "create_time": 1595943977, "mobile": "17399999999", "email": "123@qq.com", "mg_state": false}, {"id": 938, "role_name": "超级管理员", "username": "sam", "create_time": 1596180213, "mobile": "18959688888", "email": "ss@sss.aa", "mg_state": true}, {"id": 939, "role_name": "超级管理员", "username": "333", "create_time": 1596206055, "mobile": "18822222222", "email": "33333@qq.com", "mg_state": false}, {"id": 940, "role_name": "超级管理员", "username": "sds", "create_time": 1596206150, "mobile": "18822222222", "email": "ssss@qq.com", "mg_state": false}, {"id": 942, "role_name": "超级管理员", "username": "33344", "create_time": 1596206379, "mobile": "18866666666", "email": "dddd@qq.com", "mg_state": false}, {"id": 943, "role_name": "超级管理员", "username": "1231", "create_time": 1596206608, "mobile": "", "email": "", "mg_state": false}]}, "meta": {"msg": "获取管理员列表成功", "status": 200}}
2020-08-03 16:10:08.944 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}
2020-08-03 16:10:08.945 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': {'total': 29, 'pagenum': 1, 'users': [{'id': 500, 'role_name': '超级管理员', 'username': 'admin', 'create_time': 1486720211, 'mobile': '18487984889', 'email': '18401782588@qq.com', 'mg_state': True}, {'id': 929, 'role_name': '超级管理员', 'username': 'asff', 'create_time': 1595626624, 'mobile': '13888888888', 'email': 'fiji@qq.com', 'mg_state': True}, {'id': 933, 'role_name': '超级管理员', 'username': '1111', 'create_time': 1595844905, 'mobile': '13871112234', 'email': '1111@qq.com', 'mg_state': True}, {'id': 934, 'role_name': '超级管理员', 'username': '111', 'create_time': 1595846015, 'mobile': '13871112256', 'email': '111@qq.com', 'mg_state': True}, {'id': 935, 'role_name': '超级管理员', 'username': 'ces', 'create_time': 1595908009, 'mobile': '13478945612', 'email': '123456@qq.com', 'mg_state': True}, {'id': 936, 'role_name': '超级管理员', 'username': 'ssc', 'create_time': 1595908072, 'mobile': '18370081345', 'email': '12@qq.com', 'mg_state': True}, {'id': 937, 'role_name': '超级管理员', 'username': '8888', 'create_time': 1595943977, 'mobile': '17399999999', 'email': '123@qq.com', 'mg_state': False}, {'id': 938, 'role_name': '超级管理员', 'username': 'sam', 'create_time': 1596180213, 'mobile': '18959688888', 'email': 'ss@sss.aa', 'mg_state': True}, {'id': 939, 'role_name': '超级管理员', 'username': '333', 'create_time': 1596206055, 'mobile': '18822222222', 'email': '33333@qq.com', 'mg_state': False}, {'id': 940, 'role_name': '超级管理员', 'username': 'sds', 'create_time': 1596206150, 'mobile': '18822222222', 'email': 'ssss@qq.com', 'mg_state': False}, {'id': 942, 'role_name': '超级管理员', 'username': '33344', 'create_time': 1596206379, 'mobile': '18866666666', 'email': 'dddd@qq.com', 'mg_state': False}, {'id': 943, 'role_name': '超级管理员', 'username': '1231', 'create_time': 1596206608, 'mobile': '', 'email': '', 'mg_state': False}]}, 'meta': {'msg': '获取管理员列表成功', 'status': 200}}
需要校验的数据字典: {'msg': '获取管理员列表成功', 'status': 200}
预期校验的数据字典: {'msg': '获取管理员列表成功', 'status': 200}
测试结果: True

View File

@ -0,0 +1 @@
{"uuid": "0ce1e1c4-a334-4a2e-960a-94f50103ec41", "befores": [{"name": "data", "status": "passed", "start": 1596442208563, "stop": 1596442208563}], "start": 1596442208563, "stop": 1596442208764}

View File

@ -0,0 +1 @@
{"uuid": "bb338d11-9cac-4092-9862-b9d80941005f", "befores": [{"name": "file_path", "status": "passed", "start": 1596442208772, "stop": 1596442208772}], "start": 1596442208772, "stop": 1596442208957}

View File

@ -0,0 +1 @@
{"uuid": "c5578151-c565-4fcd-8870-81b8056d924d", "befores": [{"name": "file_var", "status": "passed", "start": 1596442208563, "stop": 1596442208563}], "start": 1596442208563, "stop": 1596442208766}

View File

@ -0,0 +1 @@
{"uuid": "3ec6d03b-fc2a-4062-b215-b39b79bdef1a", "befores": [{"name": "actual", "status": "passed", "start": 1596442208773, "stop": 1596442208773}], "start": 1596442208773, "stop": 1596442208946}

View File

@ -0,0 +1 @@
{"uuid": "491d0adb-b54d-4b59-8ea7-1c727e5657b3", "befores": [{"name": "is_token", "status": "passed", "start": 1596442208562, "stop": 1596442208562}], "start": 1596442208562, "stop": 1596442208767}

Binary file not shown.

60
report/html/app.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
2020-08-03 16:10:08.564 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"username": "admin", "password": "123456"}
2020-08-03 16:10:08.564 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'username': 'admin', 'password': '123456'}
2020-08-03 16:10:08.750 | INFO  | api.base_requests:base_requests:41 - 请求方法:post请求路径:http://47.115.124.102:8888/api/private/v1/login, 请求参数:{'username': 'admin', 'password': '123456'}, 请求文件:None, 请求头:{})
2020-08-03 16:10:08.755 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.761 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 3, 列号: 11, 写入值: {"data": {"id": 500, "rid": 0, "username": "admin", "mobile": "18487984889", "email": "18401782588@qq.com", "token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM"}, "meta": {"msg": "登录成功", "status": 200}}
2020-08-03 16:10:08.761 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}
2020-08-03 16:10:08.762 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': {'id': 500, 'rid': 0, 'username': 'admin', 'mobile': '18487984889', 'email': '18401782588@qq.com', 'token': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'}, 'meta': {'msg': '登录成功', 'status': 200}}
需要校验的数据字典: {'msg': '登录成功', 'status': 200}
预期校验的数据字典: {'msg': '登录成功', 'status': 200}
测试结果: True

View File

@ -0,0 +1,7 @@
2020-08-03 16:10:08.965 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"pagenum": 1, "pagesize": "12"}
2020-08-03 16:10:08.966 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'pagenum': 1, 'pagesize': '12'}
2020-08-03 16:10:09.051 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/users, 请求参数:{'pagenum': 1, 'pagesize': '12'}, 请求文件:None, 请求头:{})
2020-08-03 16:10:09.056 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:09.060 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 5, 列号: 11, 写入值: {"data": null, "meta": {"msg": "无效token", "status": 400}}
2020-08-03 16:10:09.061 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}

View File

@ -0,0 +1,11 @@
2020-08-03 16:10:08.443 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"username": "admin", "password": ""}
2020-08-03 16:10:08.444 | DEBUG  | test.test_api:treating_data:78 - data有数据依赖无数据 {'username': 'admin', 'password': ''}
2020-08-03 16:10:08.539 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/login, 请求参数:{'username': 'admin', 'password': ''}, 请求文件:None, 请求头:{})
2020-08-03 16:10:08.544 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.551 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 2, 列号: 11, 写入值: {"data": null, "meta": {"msg": "参数错误", "status": 400}}
2020-08-03 16:10:08.551 | INFO  | test.test_api:test_main:98 - token_header: {},
no_token_header: {}
2020-08-03 16:10:08.553 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
需要校验的数据字典: {'msg': '参数错误', 'status': 400}
预期校验的数据字典: {'msg': '参数错误', 'status': 400}
测试结果: True

View File

@ -0,0 +1,18 @@
2020-08-03 16:10:08.773 | INFO  | test.test_api:treating_data:59 - 处理依赖时data的数据:{"pagenum": 1, "pagesize": "12"}
2020-08-03 16:10:08.778 | INFO  | tools.read_data:read_actual:94 - i $.data.id, v ['$.data.id'], actual {'data': {'id': 500, 'rid': 0, 'username': 'admin', 'mobile': '18487984889', 'email': '18401782588@qq.com', 'token': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'}, 'meta': {'msg': '登录成功', 'status': 200}}
<class 'dict'>
2020-08-03 16:10:08.780 | INFO  | tools.read_data:read_actual:94 - i $.meta.msg, v ['$.meta.msg', '$.meta.status'], actual {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
<class 'dict'>
2020-08-03 16:10:08.781 | INFO  | tools.read_data:read_actual:94 - i $.meta.status, v ['$.meta.msg', '$.meta.status'], actual {'data': None, 'meta': {'msg': '参数错误', 'status': 400}}
<class 'dict'>
2020-08-03 16:10:08.781 | DEBUG  | test.test_api:treating_data:62 - 依赖数据解析获得的字典{'id': 500, 'msg': '参数错误', 'status': 400}
2020-08-03 16:10:08.781 | DEBUG  | test.test_api:treating_data:67 - data有数据依赖有数据时 {'id': 500, 'msg': '参数错误', 'status': 400, 'pagenum': 1, 'pagesize': '12'}
2020-08-03 16:10:08.933 | INFO  | api.base_requests:base_requests:41 - 请求方法:get请求路径:http://47.115.124.102:8888/api/private/v1/users, 请求参数:{'id': 500, 'msg': '参数错误', 'status': 400, 'pagenum': 1, 'pagesize': '12'}, 请求文件:None, 请求头:{'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'})
2020-08-03 16:10:08.938 | INFO  | tools.read_data:write_result:65 - 开始回写实际响应结果到用例数据中.
2020-08-03 16:10:08.944 | INFO  | tools.read_data:write_result:72 - 写入完毕:-写入文件: ../data/case_data.xlsx, 行号: 4, 列号: 11, 写入值: {"data": {"total": 29, "pagenum": 1, "users": [{"id": 500, "role_name": "超级管理员", "username": "admin", "create_time": 1486720211, "mobile": "18487984889", "email": "18401782588@qq.com", "mg_state": true}, {"id": 929, "role_name": "超级管理员", "username": "asff", "create_time": 1595626624, "mobile": "13888888888", "email": "fiji@qq.com", "mg_state": true}, {"id": 933, "role_name": "超级管理员", "username": "1111", "create_time": 1595844905, "mobile": "13871112234", "email": "1111@qq.com", "mg_state": true}, {"id": 934, "role_name": "超级管理员", "username": "111", "create_time": 1595846015, "mobile": "13871112256", "email": "111@qq.com", "mg_state": true}, {"id": 935, "role_name": "超级管理员", "username": "ces", "create_time": 1595908009, "mobile": "13478945612", "email": "123456@qq.com", "mg_state": true}, {"id": 936, "role_name": "超级管理员", "username": "ssc", "create_time": 1595908072, "mobile": "18370081345", "email": "12@qq.com", "mg_state": true}, {"id": 937, "role_name": "超级管理员", "username": "8888", "create_time": 1595943977, "mobile": "17399999999", "email": "123@qq.com", "mg_state": false}, {"id": 938, "role_name": "超级管理员", "username": "sam", "create_time": 1596180213, "mobile": "18959688888", "email": "ss@sss.aa", "mg_state": true}, {"id": 939, "role_name": "超级管理员", "username": "333", "create_time": 1596206055, "mobile": "18822222222", "email": "33333@qq.com", "mg_state": false}, {"id": 940, "role_name": "超级管理员", "username": "sds", "create_time": 1596206150, "mobile": "18822222222", "email": "ssss@qq.com", "mg_state": false}, {"id": 942, "role_name": "超级管理员", "username": "33344", "create_time": 1596206379, "mobile": "18866666666", "email": "dddd@qq.com", "mg_state": false}, {"id": 943, "role_name": "超级管理员", "username": "1231", "create_time": 1596206608, "mobile": "", "email": "", "mg_state": false}]}, "meta": {"msg": "获取管理员列表成功", "status": 200}}
2020-08-03 16:10:08.944 | INFO  | test.test_api:test_main:98 - token_header: {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIyMDgsImV4cCI6MTU5NjUyODYwOH0.EevDrEh-EQEYfU8G1J6J7_Ab_AaqqDb3adcb_IWgdfM'},
no_token_header: {}
2020-08-03 16:10:08.945 | INFO  | test.test_api:test_main:105 - 完整的json响应: {'data': {'total': 29, 'pagenum': 1, 'users': [{'id': 500, 'role_name': '超级管理员', 'username': 'admin', 'create_time': 1486720211, 'mobile': '18487984889', 'email': '18401782588@qq.com', 'mg_state': True}, {'id': 929, 'role_name': '超级管理员', 'username': 'asff', 'create_time': 1595626624, 'mobile': '13888888888', 'email': 'fiji@qq.com', 'mg_state': True}, {'id': 933, 'role_name': '超级管理员', 'username': '1111', 'create_time': 1595844905, 'mobile': '13871112234', 'email': '1111@qq.com', 'mg_state': True}, {'id': 934, 'role_name': '超级管理员', 'username': '111', 'create_time': 1595846015, 'mobile': '13871112256', 'email': '111@qq.com', 'mg_state': True}, {'id': 935, 'role_name': '超级管理员', 'username': 'ces', 'create_time': 1595908009, 'mobile': '13478945612', 'email': '123456@qq.com', 'mg_state': True}, {'id': 936, 'role_name': '超级管理员', 'username': 'ssc', 'create_time': 1595908072, 'mobile': '18370081345', 'email': '12@qq.com', 'mg_state': True}, {'id': 937, 'role_name': '超级管理员', 'username': '8888', 'create_time': 1595943977, 'mobile': '17399999999', 'email': '123@qq.com', 'mg_state': False}, {'id': 938, 'role_name': '超级管理员', 'username': 'sam', 'create_time': 1596180213, 'mobile': '18959688888', 'email': 'ss@sss.aa', 'mg_state': True}, {'id': 939, 'role_name': '超级管理员', 'username': '333', 'create_time': 1596206055, 'mobile': '18822222222', 'email': '33333@qq.com', 'mg_state': False}, {'id': 940, 'role_name': '超级管理员', 'username': 'sds', 'create_time': 1596206150, 'mobile': '18822222222', 'email': 'ssss@qq.com', 'mg_state': False}, {'id': 942, 'role_name': '超级管理员', 'username': '33344', 'create_time': 1596206379, 'mobile': '18866666666', 'email': 'dddd@qq.com', 'mg_state': False}, {'id': 943, 'role_name': '超级管理员', 'username': '1231', 'create_time': 1596206608, 'mobile': '', 'email': '', 'mg_state': False}]}, 'meta': {'msg': '获取管理员列表成功', 'status': 200}}
需要校验的数据字典: {'msg': '获取管理员列表成功', 'status': 200}
预期校验的数据字典: {'msg': '获取管理员列表成功', 'status': 200}
测试结果: True

View File

@ -0,0 +1,2 @@
"Epic","Feature","Story","FAILED","BROKEN","PASSED","SKIPPED","UNKNOWN"
"","","","1","0","3","0","0"
1 Epic Feature Story FAILED BROKEN PASSED SKIPPED UNKNOWN
2 1 0 3 0 0

View File

@ -0,0 +1,57 @@
{
"uid" : "b1a8273437954620fa374b796ffaacdd",
"name" : "behaviors",
"children" : [ {
"name" : "test_main[get请求实现登录]",
"uid" : "2ecfa83e99ce1744",
"parentUid" : "b1a8273437954620fa374b796ffaacdd",
"status" : "passed",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'", "'case_001'", "'{\"username\": \"admin\", \"password\": \"\"}'", "''", "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'", "''", "''", "''", "'get'", "'login'" ]
}, {
"name" : "test_main[post请求实现登录]",
"uid" : "d2ab6d22b9808223",
"parentUid" : "b1a8273437954620fa374b796ffaacdd",
"status" : "passed",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'", "'case_002'", "'{\"username\": \"admin\", \"password\": \"123456\"}'", "''", "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'", "''", "''", "'写'", "'post'", "'login'" ]
}, {
"name" : "test_main[get请求查询用户数据列表0]",
"uid" : "a936c6eea54552c9",
"parentUid" : "b1a8273437954620fa374b796ffaacdd",
"status" : "passed",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'", "'case_003'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "'读'", "'get'", "'users'" ]
}, {
"name" : "test_main[get请求查询用户数据列表1]",
"uid" : "7a8d2a0629601fd8",
"parentUid" : "b1a8273437954620fa374b796ffaacdd",
"status" : "failed",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
} ]
}

View File

@ -0,0 +1,2 @@
"Category","FAILED","BROKEN","PASSED","SKIPPED","UNKNOWN"
"Product defects","1","0","0","0","0"
1 Category FAILED BROKEN PASSED SKIPPED UNKNOWN
2 Product defects 1 0 0 0 0

View File

@ -0,0 +1,26 @@
{
"uid" : "4b4757e66a1912dae1a509f688f20b0f",
"name" : "categories",
"children" : [ {
"name" : "Product defects",
"children" : [ {
"name" : "AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\n Differing items:\n {'status': 400} != {'status': 200}\n {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\n Use -v to get the full diff",
"children" : [ {
"name" : "test_main[get请求查询用户数据列表1]",
"uid" : "7a8d2a0629601fd8",
"parentUid" : "553d07b8afcfc686182afc1f87b8ebf4",
"status" : "failed",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
} ],
"uid" : "553d07b8afcfc686182afc1f87b8ebf4"
} ],
"uid" : "8fb3a91ba5aaf9de24cc8a92edc82b5d"
} ]
}

View File

@ -0,0 +1,61 @@
{
"uid" : "83edc06c07f9ae9e47eb6dd1b683e4e2",
"name" : "packages",
"children" : [ {
"name" : "test.test_api",
"children" : [ {
"name" : "test_main[get请求实现登录]",
"uid" : "2ecfa83e99ce1744",
"parentUid" : "485fc2165f78227bc8432e24ae413ca4",
"status" : "passed",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'", "'case_001'", "'{\"username\": \"admin\", \"password\": \"\"}'", "''", "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'", "''", "''", "''", "'get'", "'login'" ]
}, {
"name" : "test_main[post请求实现登录]",
"uid" : "d2ab6d22b9808223",
"parentUid" : "485fc2165f78227bc8432e24ae413ca4",
"status" : "passed",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'", "'case_002'", "'{\"username\": \"admin\", \"password\": \"123456\"}'", "''", "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'", "''", "''", "'写'", "'post'", "'login'" ]
}, {
"name" : "test_main[get请求查询用户数据列表0]",
"uid" : "a936c6eea54552c9",
"parentUid" : "485fc2165f78227bc8432e24ae413ca4",
"status" : "passed",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'", "'case_003'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "'读'", "'get'", "'users'" ]
}, {
"name" : "test_main[get请求查询用户数据列表1]",
"uid" : "7a8d2a0629601fd8",
"parentUid" : "485fc2165f78227bc8432e24ae413ca4",
"status" : "failed",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
} ],
"uid" : "test.test_api"
} ]
}

View File

@ -0,0 +1,5 @@
"Status","Start Time","Stop Time","Duration in ms","Parent Suite","Suite","Sub Suite","Test Class","Test Method","Name","Description"
"passed","Mon Aug 03 16:10:08 CST 2020","Mon Aug 03 16:10:08 CST 2020","199","test","test_api","TestApiAuto","","","test_main[post请求实现登录]",""
"failed","Mon Aug 03 16:10:08 CST 2020","Mon Aug 03 16:10:09 CST 2020","98","test","test_api","TestApiAuto","","","test_main[get请求查询用户数据列表1]",""
"passed","Mon Aug 03 16:10:08 CST 2020","Mon Aug 03 16:10:08 CST 2020","110","test","test_api","TestApiAuto","","","test_main[get请求实现登录]",""
"passed","Mon Aug 03 16:10:08 CST 2020","Mon Aug 03 16:10:08 CST 2020","173","test","test_api","TestApiAuto","","","test_main[get请求查询用户数据列表0]",""
1 Status Start Time Stop Time Duration in ms Parent Suite Suite Sub Suite Test Class Test Method Name Description
2 passed Mon Aug 03 16:10:08 CST 2020 Mon Aug 03 16:10:08 CST 2020 199 test test_api TestApiAuto test_main[post请求实现登录]
3 failed Mon Aug 03 16:10:08 CST 2020 Mon Aug 03 16:10:09 CST 2020 98 test test_api TestApiAuto test_main[get请求查询用户数据列表1]
4 passed Mon Aug 03 16:10:08 CST 2020 Mon Aug 03 16:10:08 CST 2020 110 test test_api TestApiAuto test_main[get请求实现登录]
5 passed Mon Aug 03 16:10:08 CST 2020 Mon Aug 03 16:10:08 CST 2020 173 test test_api TestApiAuto test_main[get请求查询用户数据列表0]

View File

@ -0,0 +1,69 @@
{
"uid" : "98d3104e051c652961429bf95fa0b5d6",
"name" : "suites",
"children" : [ {
"name" : "test",
"children" : [ {
"name" : "test_api",
"children" : [ {
"name" : "TestApiAuto",
"children" : [ {
"name" : "test_main[get请求实现登录]",
"uid" : "2ecfa83e99ce1744",
"parentUid" : "c2015daad5d1e19252cd8489cf17d227",
"status" : "passed",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'", "'case_001'", "'{\"username\": \"admin\", \"password\": \"\"}'", "''", "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'", "''", "''", "''", "'get'", "'login'" ]
}, {
"name" : "test_main[post请求实现登录]",
"uid" : "d2ab6d22b9808223",
"parentUid" : "c2015daad5d1e19252cd8489cf17d227",
"status" : "passed",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'", "'case_002'", "'{\"username\": \"admin\", \"password\": \"123456\"}'", "''", "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'", "''", "''", "'写'", "'post'", "'login'" ]
}, {
"name" : "test_main[get请求查询用户数据列表0]",
"uid" : "a936c6eea54552c9",
"parentUid" : "c2015daad5d1e19252cd8489cf17d227",
"status" : "passed",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'", "'case_003'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "'读'", "'get'", "'users'" ]
}, {
"name" : "test_main[get请求查询用户数据列表1]",
"uid" : "7a8d2a0629601fd8",
"parentUid" : "c2015daad5d1e19252cd8489cf17d227",
"status" : "failed",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
} ],
"uid" : "c2015daad5d1e19252cd8489cf17d227"
} ],
"uid" : "5ec56e5acb19289a654b41c9fccc3a4c"
} ],
"uid" : "ff2b04dbb9c449a4d40723f51d841925"
} ]
}

View File

@ -0,0 +1,192 @@
{
"uid" : "2ecfa83e99ce1744",
"name" : "test_main[get请求实现登录]",
"fullName" : "test.test_api.TestApiAuto#test_main",
"historyId" : "5012049d63ad8ce5a26120338c8702c7",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"status" : "passed",
"flaky" : false,
"newFailed" : false,
"beforeStages" : [ ],
"testStage" : {
"status" : "passed",
"steps" : [ {
"name" : "处理相关数据依赖header",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208445,
"duration" : 1
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "发送请求取得响应结果的json串",
"time" : {
"start" : 1596442208445,
"stop" : 1596442208540,
"duration" : 95
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "将响应结果的内容写入用例中的实际结果栏",
"time" : {
"start" : 1596442208540,
"stop" : 1596442208552,
"duration" : 12
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "根据配置文件的提取响应规则提取实际数据",
"time" : {
"start" : 1596442208552,
"stop" : 1596442208553,
"duration" : 1
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "处理读取出来的预期结果响应",
"time" : {
"start" : 1596442208553,
"stop" : 1596442208553,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "预期结果与实际响应进行断言操作",
"time" : {
"start" : 1596442208554,
"stop" : 1596442208554,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
} ],
"attachments" : [ {
"uid" : "57695c5d0d01a0bc",
"name" : "stderr",
"source" : "57695c5d0d01a0bc.txt",
"type" : "text/plain",
"size" : 1647
} ],
"parameters" : [ ],
"stepsCount" : 6,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false,
"hasContent" : true
},
"afterStages" : [ ],
"labels" : [ {
"name" : "parentSuite",
"value" : "test"
}, {
"name" : "suite",
"value" : "test_api"
}, {
"name" : "subSuite",
"value" : "TestApiAuto"
}, {
"name" : "host",
"value" : "bogon"
}, {
"name" : "thread",
"value" : "4035-MainThread"
}, {
"name" : "framework",
"value" : "pytest"
}, {
"name" : "language",
"value" : "cpython3"
}, {
"name" : "package",
"value" : "test.test_api"
}, {
"name" : "resultFormat",
"value" : "allure2"
} ],
"parameters" : [ {
"name" : "actual",
"value" : "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'"
}, {
"name" : "case_number",
"value" : "'case_001'"
}, {
"name" : "data",
"value" : "'{\"username\": \"admin\", \"password\": \"\"}'"
}, {
"name" : "dependent",
"value" : "''"
}, {
"name" : "expect",
"value" : "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'"
}, {
"name" : "file_path",
"value" : "''"
}, {
"name" : "file_var",
"value" : "''"
}, {
"name" : "is_token",
"value" : "''"
}, {
"name" : "method",
"value" : "'get'"
}, {
"name" : "path",
"value" : "'login'"
} ],
"links" : [ ],
"hidden" : false,
"retry" : false,
"extra" : {
"severity" : "normal",
"retries" : [ ],
"categories" : [ ],
"tags" : [ ]
},
"source" : "2ecfa83e99ce1744.json",
"parameterValues" : [ "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'", "'case_001'", "'{\"username\": \"admin\", \"password\": \"\"}'", "''", "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'", "''", "''", "''", "'get'", "'login'" ]
}

View File

@ -0,0 +1,202 @@
{
"uid" : "7a8d2a0629601fd8",
"name" : "test_main[get请求查询用户数据列表1]",
"fullName" : "test.test_api.TestApiAuto#test_main",
"historyId" : "be5b5f15fbb8955b34c81b37018d2e61",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"status" : "failed",
"statusMessage" : "AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\n Differing items:\n {'status': 400} != {'status': 200}\n {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\n Use -v to get the full diff",
"statusTrace" : "self = <test.test_api.TestApiAuto object at 0x103432f10>\ncase_number = 'case_004', path = 'users', is_token = '', method = 'get'\nfile_var = '', file_path = '', dependent = ''\ndata = {'pagenum': 1, 'pagesize': '12'}\nexpect = {'msg': '获取管理员列表成功', 'status': 200}\nactual = '{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'\n\n @pytest.mark.parametrize('case_number,path,is_token,method,file_var,'\n 'file_path,dependent,data,expect,actual', data_list, ids=title_ids)\n def test_main(self, case_number, path, is_token, method, file_var, file_path,\n dependent, data, expect, actual):\n \n with allure.step(\"处理相关数据依赖header\"):\n data, header = self.treating_data(is_token, dependent, data)\n with allure.step(\"发送请求取得响应结果的json串\"):\n res = br.base_requests(method=method, url=base_url + path, file_var=file_var, file_path=file_path,\n data=data, header=header)\n with allure.step(\"将响应结果的内容写入用例中的实际结果栏\"):\n ReadData(case_data_path).write_result(case_number, res)\n \n # 写token的接口必须是要正确无误能返回token的\n if is_token == '写':\n with allure.step(\"从登录后的响应中提取token到header中\"):\n token_header['Authorization'] = jsonpath.jsonpath(res, token_reg)[0]\n logger.info(f'token_header: {token_header}, \\n no_token_header: {no_token_header}')\n with allure.step(\"根据配置文件的提取响应规则提取实际数据\"):\n really = jsonpath.jsonpath(res, res_reg)[0]\n with allure.step(\"处理读取出来的预期结果响应\"):\n expect = eval(expect)\n with allure.step(\"预期结果与实际响应进行断言操作\"):\n> assert really == expect\nE AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\nE Differing items:\nE {'status': 400} != {'status': 200}\nE {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\nE Use -v to get the full diff\n\ntest_api.py:104: AssertionError",
"flaky" : false,
"newFailed" : false,
"beforeStages" : [ ],
"testStage" : {
"status" : "failed",
"statusMessage" : "AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\n Differing items:\n {'status': 400} != {'status': 200}\n {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\n Use -v to get the full diff",
"statusTrace" : "self = <test.test_api.TestApiAuto object at 0x103432f10>\ncase_number = 'case_004', path = 'users', is_token = '', method = 'get'\nfile_var = '', file_path = '', dependent = ''\ndata = {'pagenum': 1, 'pagesize': '12'}\nexpect = {'msg': '获取管理员列表成功', 'status': 200}\nactual = '{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'\n\n @pytest.mark.parametrize('case_number,path,is_token,method,file_var,'\n 'file_path,dependent,data,expect,actual', data_list, ids=title_ids)\n def test_main(self, case_number, path, is_token, method, file_var, file_path,\n dependent, data, expect, actual):\n \n with allure.step(\"处理相关数据依赖header\"):\n data, header = self.treating_data(is_token, dependent, data)\n with allure.step(\"发送请求取得响应结果的json串\"):\n res = br.base_requests(method=method, url=base_url + path, file_var=file_var, file_path=file_path,\n data=data, header=header)\n with allure.step(\"将响应结果的内容写入用例中的实际结果栏\"):\n ReadData(case_data_path).write_result(case_number, res)\n \n # 写token的接口必须是要正确无误能返回token的\n if is_token == '写':\n with allure.step(\"从登录后的响应中提取token到header中\"):\n token_header['Authorization'] = jsonpath.jsonpath(res, token_reg)[0]\n logger.info(f'token_header: {token_header}, \\n no_token_header: {no_token_header}')\n with allure.step(\"根据配置文件的提取响应规则提取实际数据\"):\n really = jsonpath.jsonpath(res, res_reg)[0]\n with allure.step(\"处理读取出来的预期结果响应\"):\n expect = eval(expect)\n with allure.step(\"预期结果与实际响应进行断言操作\"):\n> assert really == expect\nE AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\nE Differing items:\nE {'status': 400} != {'status': 200}\nE {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\nE Use -v to get the full diff\n\ntest_api.py:104: AssertionError",
"steps" : [ {
"name" : "处理相关数据依赖header",
"time" : {
"start" : 1596442208966,
"stop" : 1596442208966,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "发送请求取得响应结果的json串",
"time" : {
"start" : 1596442208966,
"stop" : 1596442209052,
"duration" : 86
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "将响应结果的内容写入用例中的实际结果栏",
"time" : {
"start" : 1596442209052,
"stop" : 1596442209062,
"duration" : 10
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "根据配置文件的提取响应规则提取实际数据",
"time" : {
"start" : 1596442209062,
"stop" : 1596442209062,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "处理读取出来的预期结果响应",
"time" : {
"start" : 1596442209062,
"stop" : 1596442209062,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "预期结果与实际响应进行断言操作",
"time" : {
"start" : 1596442209062,
"stop" : 1596442209062,
"duration" : 0
},
"status" : "failed",
"statusMessage" : "AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\n Differing items:\n {'status': 400} != {'status': 200}\n {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\n Use -v to get the full diff\n",
"statusTrace" : " File \"/Users/zy7y/PycharmProjects/apiAutoTest/test/test_api.py\", line 104, in test_main\n assert really == expect\n",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : true,
"hasContent" : true
} ],
"attachments" : [ {
"uid" : "55be4d0987b02d21",
"name" : "stderr",
"source" : "55be4d0987b02d21.txt",
"type" : "text/plain",
"size" : 1448
} ],
"parameters" : [ ],
"stepsCount" : 6,
"attachmentsCount" : 1,
"shouldDisplayMessage" : true,
"hasContent" : true
},
"afterStages" : [ ],
"labels" : [ {
"name" : "parentSuite",
"value" : "test"
}, {
"name" : "suite",
"value" : "test_api"
}, {
"name" : "subSuite",
"value" : "TestApiAuto"
}, {
"name" : "host",
"value" : "bogon"
}, {
"name" : "thread",
"value" : "4035-MainThread"
}, {
"name" : "framework",
"value" : "pytest"
}, {
"name" : "language",
"value" : "cpython3"
}, {
"name" : "package",
"value" : "test.test_api"
}, {
"name" : "resultFormat",
"value" : "allure2"
} ],
"parameters" : [ {
"name" : "actual",
"value" : "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'"
}, {
"name" : "case_number",
"value" : "'case_004'"
}, {
"name" : "data",
"value" : "'{\"pagenum\": 1, \"pagesize\": \"12\"}'"
}, {
"name" : "dependent",
"value" : "''"
}, {
"name" : "expect",
"value" : "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'"
}, {
"name" : "file_path",
"value" : "''"
}, {
"name" : "file_var",
"value" : "''"
}, {
"name" : "is_token",
"value" : "''"
}, {
"name" : "method",
"value" : "'get'"
}, {
"name" : "path",
"value" : "'users'"
} ],
"links" : [ ],
"hidden" : false,
"retry" : false,
"extra" : {
"severity" : "normal",
"retries" : [ ],
"categories" : [ {
"name" : "Product defects",
"matchedStatuses" : [ ],
"flaky" : false
} ],
"tags" : [ ]
},
"source" : "7a8d2a0629601fd8.json",
"parameterValues" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
}

View File

@ -0,0 +1,192 @@
{
"uid" : "a936c6eea54552c9",
"name" : "test_main[get请求查询用户数据列表0]",
"fullName" : "test.test_api.TestApiAuto#test_main",
"historyId" : "0a0b8ae05f47f96cf01c48778be171e9",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"status" : "passed",
"flaky" : false,
"newFailed" : false,
"beforeStages" : [ ],
"testStage" : {
"status" : "passed",
"steps" : [ {
"name" : "处理相关数据依赖header",
"time" : {
"start" : 1596442208774,
"stop" : 1596442208782,
"duration" : 8
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "发送请求取得响应结果的json串",
"time" : {
"start" : 1596442208782,
"stop" : 1596442208934,
"duration" : 152
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "将响应结果的内容写入用例中的实际结果栏",
"time" : {
"start" : 1596442208934,
"stop" : 1596442208945,
"duration" : 11
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "根据配置文件的提取响应规则提取实际数据",
"time" : {
"start" : 1596442208945,
"stop" : 1596442208945,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "处理读取出来的预期结果响应",
"time" : {
"start" : 1596442208945,
"stop" : 1596442208945,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "预期结果与实际响应进行断言操作",
"time" : {
"start" : 1596442208945,
"stop" : 1596442208946,
"duration" : 1
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
} ],
"attachments" : [ {
"uid" : "e5a0b40354949c4f",
"name" : "stderr",
"source" : "e5a0b40354949c4f.txt",
"type" : "text/plain",
"size" : 7238
} ],
"parameters" : [ ],
"stepsCount" : 6,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false,
"hasContent" : true
},
"afterStages" : [ ],
"labels" : [ {
"name" : "parentSuite",
"value" : "test"
}, {
"name" : "suite",
"value" : "test_api"
}, {
"name" : "subSuite",
"value" : "TestApiAuto"
}, {
"name" : "host",
"value" : "bogon"
}, {
"name" : "thread",
"value" : "4035-MainThread"
}, {
"name" : "framework",
"value" : "pytest"
}, {
"name" : "language",
"value" : "cpython3"
}, {
"name" : "package",
"value" : "test.test_api"
}, {
"name" : "resultFormat",
"value" : "allure2"
} ],
"parameters" : [ {
"name" : "actual",
"value" : "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'"
}, {
"name" : "case_number",
"value" : "'case_003'"
}, {
"name" : "data",
"value" : "'{\"pagenum\": 1, \"pagesize\": \"12\"}'"
}, {
"name" : "dependent",
"value" : "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'"
}, {
"name" : "expect",
"value" : "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'"
}, {
"name" : "file_path",
"value" : "''"
}, {
"name" : "file_var",
"value" : "''"
}, {
"name" : "is_token",
"value" : "'读'"
}, {
"name" : "method",
"value" : "'get'"
}, {
"name" : "path",
"value" : "'users'"
} ],
"links" : [ ],
"hidden" : false,
"retry" : false,
"extra" : {
"severity" : "normal",
"retries" : [ ],
"categories" : [ ],
"tags" : [ ]
},
"source" : "a936c6eea54552c9.json",
"parameterValues" : [ "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'", "'case_003'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "'读'", "'get'", "'users'" ]
}

View File

@ -0,0 +1,207 @@
{
"uid" : "d2ab6d22b9808223",
"name" : "test_main[post请求实现登录]",
"fullName" : "test.test_api.TestApiAuto#test_main",
"historyId" : "919b7d04f88d30572b93beb38f794577",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"status" : "passed",
"flaky" : false,
"newFailed" : false,
"beforeStages" : [ ],
"testStage" : {
"status" : "passed",
"steps" : [ {
"name" : "处理相关数据依赖header",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208565,
"duration" : 1
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "发送请求取得响应结果的json串",
"time" : {
"start" : 1596442208565,
"stop" : 1596442208751,
"duration" : 186
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "将响应结果的内容写入用例中的实际结果栏",
"time" : {
"start" : 1596442208751,
"stop" : 1596442208762,
"duration" : 11
},
"status" : "passed",
"steps" : [ {
"name" : "从登录后的响应中提取token到header中",
"time" : {
"start" : 1596442208762,
"stop" : 1596442208762,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
} ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 1,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : true
}, {
"name" : "根据配置文件的提取响应规则提取实际数据",
"time" : {
"start" : 1596442208762,
"stop" : 1596442208762,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "处理读取出来的预期结果响应",
"time" : {
"start" : 1596442208762,
"stop" : 1596442208762,
"duration" : 0
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
}, {
"name" : "预期结果与实际响应进行断言操作",
"time" : {
"start" : 1596442208762,
"stop" : 1596442208763,
"duration" : 1
},
"status" : "passed",
"steps" : [ ],
"attachments" : [ ],
"parameters" : [ ],
"stepsCount" : 0,
"attachmentsCount" : 0,
"shouldDisplayMessage" : false,
"hasContent" : false
} ],
"attachments" : [ {
"uid" : "2cebc344f68a0f1a",
"name" : "stderr",
"source" : "2cebc344f68a0f1a.txt",
"type" : "text/plain",
"size" : 2376
} ],
"parameters" : [ ],
"stepsCount" : 7,
"attachmentsCount" : 1,
"shouldDisplayMessage" : false,
"hasContent" : true
},
"afterStages" : [ ],
"labels" : [ {
"name" : "parentSuite",
"value" : "test"
}, {
"name" : "suite",
"value" : "test_api"
}, {
"name" : "subSuite",
"value" : "TestApiAuto"
}, {
"name" : "host",
"value" : "bogon"
}, {
"name" : "thread",
"value" : "4035-MainThread"
}, {
"name" : "framework",
"value" : "pytest"
}, {
"name" : "language",
"value" : "cpython3"
}, {
"name" : "package",
"value" : "test.test_api"
}, {
"name" : "resultFormat",
"value" : "allure2"
} ],
"parameters" : [ {
"name" : "actual",
"value" : "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'"
}, {
"name" : "case_number",
"value" : "'case_002'"
}, {
"name" : "data",
"value" : "'{\"username\": \"admin\", \"password\": \"123456\"}'"
}, {
"name" : "dependent",
"value" : "''"
}, {
"name" : "expect",
"value" : "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'"
}, {
"name" : "file_path",
"value" : "''"
}, {
"name" : "file_var",
"value" : "''"
}, {
"name" : "is_token",
"value" : "'写'"
}, {
"name" : "method",
"value" : "'post'"
}, {
"name" : "path",
"value" : "'login'"
} ],
"links" : [ ],
"hidden" : false,
"retry" : false,
"extra" : {
"severity" : "normal",
"retries" : [ ],
"categories" : [ ],
"tags" : [ ]
},
"source" : "d2ab6d22b9808223.json",
"parameterValues" : [ "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'", "'case_002'", "'{\"username\": \"admin\", \"password\": \"123456\"}'", "''", "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'", "''", "''", "'写'", "'post'", "'login'" ]
}

View File

@ -0,0 +1,65 @@
{
"uid" : "ab17fc5a4eb3bca4b216b548c7f9fcbc",
"name" : "timeline",
"children" : [ {
"name" : "bogon",
"children" : [ {
"name" : "4035-MainThread",
"children" : [ {
"name" : "test_main[get请求查询用户数据列表1]",
"uid" : "7a8d2a0629601fd8",
"parentUid" : "c4ad07da2a890813fb13e55bc339e6bc",
"status" : "failed",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"无效token\", \"status\": 400}}'", "'case_004'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "''", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "''", "'get'", "'users'" ]
}, {
"name" : "test_main[post请求实现登录]",
"uid" : "d2ab6d22b9808223",
"parentUid" : "c4ad07da2a890813fb13e55bc339e6bc",
"status" : "passed",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"id\": 500, \"rid\": 0, \"username\": \"admin\", \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"token\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE1OTY0NDIwMjEsImV4cCI6MTU5NjUyODQyMX0._mk4pFaj8dTq-z1zoXh8XfqBbTLN8eHL84Wc1SsFVuc\"}, \"meta\": {\"msg\": \"登录成功\", \"status\": 200}}'", "'case_002'", "'{\"username\": \"admin\", \"password\": \"123456\"}'", "''", "'{\n \"msg\": \"登录成功\",\n \"status\": 200\n }'", "''", "''", "'写'", "'post'", "'login'" ]
}, {
"name" : "test_main[get请求实现登录]",
"uid" : "2ecfa83e99ce1744",
"parentUid" : "c4ad07da2a890813fb13e55bc339e6bc",
"status" : "passed",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": null, \"meta\": {\"msg\": \"参数错误\", \"status\": 400}}'", "'case_001'", "'{\"username\": \"admin\", \"password\": \"\"}'", "''", "'{\n \"msg\": \"参数错误\",\n \"status\": 400\n }'", "''", "''", "''", "'get'", "'login'" ]
}, {
"name" : "test_main[get请求查询用户数据列表0]",
"uid" : "a936c6eea54552c9",
"parentUid" : "c4ad07da2a890813fb13e55bc339e6bc",
"status" : "passed",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"flaky" : false,
"newFailed" : false,
"parameters" : [ "'{\"data\": {\"total\": 29, \"pagenum\": 1, \"users\": [{\"id\": 500, \"role_name\": \"超级管理员\", \"username\": \"admin\", \"create_time\": 1486720211, \"mobile\": \"18487984889\", \"email\": \"18401782588@qq.com\", \"mg_state\": true}, {\"id\": 929, \"role_name\": \"超级管理员\", \"username\": \"asff\", \"create_time\": 1595626624, \"mobile\": \"13888888888\", \"email\": \"fiji@qq.com\", \"mg_state\": true}, {\"id\": 933, \"role_name\": \"超级管理员\", \"username\": \"1111\", \"create_time\": 1595844905, \"mobile\": \"13871112234\", \"email\": \"1111@qq.com\", \"mg_state\": true}, {\"id\": 934, \"role_name\": \"超级管理员\", \"username\": \"111\", \"create_time\": 1595846015, \"mobile\": \"13871112256\", \"email\": \"111@qq.com\", \"mg_state\": true}, {\"id\": 935, \"role_name\": \"超级管理员\", \"username\": \"ces\", \"create_time\": 1595908009, \"mobile\": \"13478945612\", \"email\": \"123456@qq.com\", \"mg_state\": true}, {\"id\": 936, \"role_name\": \"超级管理员\", \"username\": \"ssc\", \"create_time\": 1595908072, \"mobile\": \"18370081345\", \"email\": \"12@qq.com\", \"mg_state\": true}, {\"id\": 937, \"role_name\": \"超级管理员\", \"username\": \"8888\", \"create_time\": 1595943977, \"mobile\": \"17399999999\", \"email\": \"123@qq.com\", \"mg_state\": false}, {\"id\": 938, \"role_name\": \"超级管理员\", \"username\": \"sam\", \"create_time\": 1596180213, \"mobile\": \"18959688888\", \"email\": \"ss@sss.aa\", \"mg_state\": true}, {\"id\": 939, \"role_name\": \"超级管理员\", \"username\": \"333\", \"create_time\": 1596206055, \"mobile\": \"18822222222\", \"email\": \"33333@qq.com\", \"mg_state\": false}, {\"id\": 940, \"role_name\": \"超级管理员\", \"username\": \"sds\", \"create_time\": 1596206150, \"mobile\": \"18822222222\", \"email\": \"ssss@qq.com\", \"mg_state\": false}, {\"id\": 942, \"role_name\": \"超级管理员\", \"username\": \"33344\", \"create_time\": 1596206379, \"mobile\": \"18866666666\", \"email\": \"dddd@qq.com\", \"mg_state\": false}, {\"id\": 943, \"role_name\": \"超级管理员\", \"username\": \"1231\", \"create_time\": 1596206608, \"mobile\": \"\", \"email\": \"\", \"mg_state\": false}]}, \"meta\": {\"msg\": \"获取管理员列表成功\", \"status\": 200}}'", "'case_003'", "'{\"pagenum\": 1, \"pagesize\": \"12\"}'", "'{\"case_002\": [\"$.data.id\"],\n\"case_001\":[\"$.meta.msg\",\"$.meta.status\"]}'", "'{\n'msg': '获取管理员列表成功', 'status': 200\n}'", "''", "''", "'读'", "'get'", "'users'" ]
} ],
"uid" : "c4ad07da2a890813fb13e55bc339e6bc"
} ],
"uid" : "2073f7d556df5d27a604e307fdf127df"
} ]
}

View File

@ -0,0 +1,12 @@
launch_status failed=1 1596442210000000000
launch_status broken=0 1596442210000000000
launch_status passed=3 1596442210000000000
launch_status skipped=0 1596442210000000000
launch_status unknown=0 1596442210000000000
launch_time duration=619 1596442210000000000
launch_time min_duration=98 1596442210000000000
launch_time max_duration=199 1596442210000000000
launch_time sum_duration=580 1596442210000000000
launch_problems product_defects=1 1596442210000000000
launch_retries retries=0 1596442210000000000
launch_retries run=4 1596442210000000000

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Allure Report summary mail</title>
</head>
<body>
Mail body
</body>
</html>

View File

@ -0,0 +1,12 @@
launch_status_failed 1
launch_status_broken 0
launch_status_passed 3
launch_status_skipped 0
launch_status_unknown 0
launch_time_duration 619
launch_time_min_duration 98
launch_time_max_duration 199
launch_time_sum_duration 580
launch_problems_product_defects 1
launch_retries_retries 0
launch_retries_run 4

1
report/html/favicon.ico Normal file
View File

@ -0,0 +1 @@
module.exports = __webpack_public_path__ + "favicon.ico";

View File

@ -0,0 +1,5 @@
[ {
"data" : {
"Product defects" : 1
}
} ]

View File

@ -0,0 +1,5 @@
[ {
"data" : {
"duration" : 619
}
} ]

View File

@ -0,0 +1,10 @@
[ {
"data" : {
"failed" : 1,
"broken" : 0,
"skipped" : 0,
"passed" : 3,
"unknown" : 0,
"total" : 4
}
} ]

View File

@ -0,0 +1,79 @@
{
"5012049d63ad8ce5a26120338c8702c7" : {
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
},
"items" : [ {
"uid" : "2ecfa83e99ce1744",
"status" : "passed",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
}
} ]
},
"919b7d04f88d30572b93beb38f794577" : {
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
},
"items" : [ {
"uid" : "d2ab6d22b9808223",
"status" : "passed",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
}
} ]
},
"be5b5f15fbb8955b34c81b37018d2e61" : {
"statistic" : {
"failed" : 1,
"broken" : 0,
"skipped" : 0,
"passed" : 0,
"unknown" : 0,
"total" : 1
},
"items" : [ {
"uid" : "7a8d2a0629601fd8",
"status" : "failed",
"statusDetails" : "AssertionError: assert {'msg': '无效to...'status': 400} == {'msg': '获取管理...'status': 200}\n Differing items:\n {'status': 400} != {'status': 200}\n {'msg': '无效token'} != {'msg': '获取管理员列表成功'}\n Use -v to get the full diff",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
}
} ]
},
"0a0b8ae05f47f96cf01c48778be171e9" : {
"statistic" : {
"failed" : 0,
"broken" : 0,
"skipped" : 0,
"passed" : 1,
"unknown" : 0,
"total" : 1
},
"items" : [ {
"uid" : "a936c6eea54552c9",
"status" : "passed",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
}
} ]
}
}

View File

@ -0,0 +1,6 @@
[ {
"data" : {
"run" : 4,
"retry" : 0
}
} ]

23
report/html/index.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title>Allure Report</title>
<link rel="favicon" href="favicon.ico?v=2">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="plugins/screen-diff/styles.css">
</head>
<body>
<div id="alert"></div>
<div id="content">
<span class="spinner">
<span class="spinner__circle"></span>
</span>
</div>
<div id="popup"></div>
<script src="app.js"></script>
<script src="plugins/behaviors/index.js"></script>
<script src="plugins/packages/index.js"></script>
<script src="plugins/screen-diff/index.js"></script>
</body>
</html>

View File

@ -0,0 +1,150 @@
'use strict';
allure.api.addTranslation('en', {
tab: {
behaviors: {
name: 'Behaviors'
}
},
widget: {
behaviors: {
name: 'Features by stories',
showAll: 'show all'
}
}
});
allure.api.addTranslation('ru', {
tab: {
behaviors: {
name: 'Функциональность'
}
},
widget: {
behaviors: {
name: 'Функциональность',
showAll: 'показать все'
}
}
});
allure.api.addTranslation('zh', {
tab: {
behaviors: {
name: '功能'
}
},
widget: {
behaviors: {
name: '特性场景',
showAll: '显示所有'
}
}
});
allure.api.addTranslation('de', {
tab: {
behaviors: {
name: 'Verhalten'
}
},
widget: {
behaviors: {
name: 'Features nach Stories',
showAll: 'Zeige alle'
}
}
});
allure.api.addTranslation('he', {
tab: {
behaviors: {
name: 'התנהגויות'
}
},
widget: {
behaviors: {
name: 'תכונות לפי סיפורי משתמש',
showAll: 'הצג הכול'
}
}
});
allure.api.addTranslation('br', {
tab: {
behaviors: {
name: 'Comportamentos'
}
},
widget: {
behaviors: {
name: 'Funcionalidades por história',
showAll: 'Mostrar tudo'
}
}
});
allure.api.addTranslation('ja', {
tab: {
behaviors: {
name: '振る舞い'
}
},
widget: {
behaviors: {
name: 'ストーリー別の機能',
showAll: '全て表示'
}
}
});
allure.api.addTranslation('es', {
tab: {
behaviors: {
name: 'Funcionalidades'
}
},
widget: {
behaviors: {
name: 'Funcionalidades por Historias de Usuario',
showAll: 'mostrar todo'
}
}
});
allure.api.addTranslation('kr', {
tab: {
behaviors: {
name: '동작'
}
},
widget: {
behaviors: {
name: '스토리별 기능',
showAll: '전체 보기'
}
}
});
allure.api.addTab('behaviors', {
title: 'tab.behaviors.name', icon: 'fa fa-list',
route: 'behaviors(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
onEnter: (function (testGroup, testResult, testResultTab) {
return new allure.components.TreeLayout({
testGroup: testGroup,
testResult: testResult,
testResultTab: testResultTab,
tabName: 'tab.behaviors.name',
baseUrl: 'behaviors',
url: 'data/behaviors.json',
csvUrl: 'data/behaviors.csv'
});
})
});
allure.api.addWidget('widgets', 'behaviors', allure.components.WidgetStatusView.extend({
rowTag: 'a',
title: 'widget.behaviors.name',
baseUrl: 'behaviors',
showLinks: true
}));

View File

@ -0,0 +1,88 @@
'use strict';
allure.api.addTranslation('en', {
tab: {
packages: {
name: 'Packages'
}
}
});
allure.api.addTranslation('ru', {
tab: {
packages: {
name: 'Пакеты'
}
}
});
allure.api.addTranslation('zh', {
tab: {
packages: {
name: '包'
}
}
});
allure.api.addTranslation('de', {
tab: {
packages: {
name: 'Pakete'
}
}
});
allure.api.addTranslation('he', {
tab: {
packages: {
name: 'חבילות'
}
}
});
allure.api.addTranslation('br', {
tab: {
packages: {
name: 'Pacotes'
}
}
});
allure.api.addTranslation('ja', {
tab: {
packages: {
name: 'パッケージ'
}
}
});
allure.api.addTranslation('es', {
tab: {
packages: {
name: 'Paquetes'
}
}
});
allure.api.addTranslation('kr', {
tab: {
packages: {
name: '패키지'
}
}
});
allure.api.addTab('packages', {
title: 'tab.packages.name', icon: 'fa fa-align-left',
route: 'packages(/)(:testGroup)(/)(:testResult)(/)(:testResultTab)(/)',
onEnter: (function (testGroup, testResult, testResultTab) {
return new allure.components.TreeLayout({
testGroup: testGroup,
testResult: testResult,
testResultTab: testResultTab,
tabName: 'tab.packages.name',
baseUrl: 'packages',
url: 'data/packages.json'
});
})
});

View File

@ -0,0 +1,97 @@
(function () {
var settings = allure.getPluginSettings('screen-diff', {diffType: 'diff'});
function renderImage(src) {
return '<div class="screen-diff__container">' +
'<img class="screen-diff__image" src="data/attachments/' + src + '">' +
'</div>';
}
function renderDiffContent(type, data) {
function findImage(name) {
if (data.testStage && data.testStage.attachments) {
return data.testStage.attachments.filter(function (attachment) {
return attachment.name === name;
})[0];
}
return null;
}
var diffImage = findImage('diff');
var actualImage = findImage('actual');
var expectedImage = findImage('expected');
if (!diffImage && !actualImage && !expectedImage) {
return '<span>Diff, actual and expected image have not been provided.</span>';
}
if (type === 'diff') {
if (!diffImage) {
return renderImage(actualImage.source);
}
return renderImage(diffImage.source);
}
if (type === 'overlay') {
return '<div class="screen-diff__overlay screen-diff__container">' +
'<img class="screen-diff__image" src="data/attachments/' + expectedImage.source + '">' +
'<div class="screen-diff__image-over">' +
'<img class="screen-diff__image" src="data/attachments/' + actualImage.source + '">' +
'</div>' +
'</div>';
}
}
var ScreenDiffView = Backbone.Marionette.View.extend({
className: 'pane__section',
events: {
'click [name="screen-diff-type"]': 'onDiffTypeChange',
'mousemove .screen-diff__overlay': 'onOverlayMove'
},
templateContext: function () {
return {
diffType: settings.get('diffType')
}
},
template: function (data) {
var testType = data.labels.filter(function (label) {
return label.name === 'testType'
})[0];
if (!testType || testType.value !== 'screenshotDiff') {
return '';
}
return '<h3 class="pane__section-title">Screen Diff</h3>' +
'<div class="screen-diff__content">' +
'<div class="screen-diff__switchers">' +
'<label><input type="radio" name="screen-diff-type" value="diff"> Show diff</label>' +
'<label><input type="radio" name="screen-diff-type" value="overlay"> Show overlay</label>' +
'</div>' +
renderDiffContent(data.diffType, data) +
'</div>';
},
adjustImageSize: function (event) {
var overImage = this.$(event.target);
overImage.width(overImage.width());
},
onRender: function () {
const diffType = settings.get('diffType');
this.$('[name="screen-diff-type"][value="' + diffType + '"]').prop('checked', true);
if (diffType === 'overlay') {
this.$('.screen-diff__image-over img').on('load', this.adjustImageSize.bind(this));
}
},
onOverlayMove: function (event) {
var pageX = event.pageX;
var containerScroll = this.$('.screen-diff__container').scrollLeft();
var elementX = event.currentTarget.getBoundingClientRect().left;
var delta = pageX - elementX + containerScroll;
this.$('.screen-diff__image-over').width(delta);
},
onDiffTypeChange: function (event) {
settings.save('diffType', event.target.value);
this.render();
}
});
allure.api.addTestResultBlock(ScreenDiffView, {position: 'before'});
})();

View File

@ -0,0 +1,26 @@
.screen-diff__switchers {
margin-bottom: 1em;
}
.screen-diff__switchers label + label {
margin-left: 1em;
}
.screen-diff__overlay {
position: relative;
cursor: col-resize;
}
.screen-diff__container {
overflow-x: auto;
}
.screen-diff__image-over {
top: 0;
left: 0;
bottom: 0;
background: #fff;
position: absolute;
overflow: hidden;
box-shadow: 2px 0 1px -1px #aaa;
}

6
report/html/styles.css Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
{
"total" : 4,
"items" : [ ]
}

View File

@ -0,0 +1,5 @@
[ {
"data" : {
"Product defects" : 1
}
} ]

View File

@ -0,0 +1,15 @@
{
"total" : 1,
"items" : [ {
"uid" : "8fb3a91ba5aaf9de24cc8a92edc82b5d",
"name" : "Product defects",
"statistic" : {
"failed" : 1,
"broken" : 0,
"skipped" : 0,
"passed" : 0,
"unknown" : 0,
"total" : 1
}
} ]
}

View File

@ -0,0 +1,5 @@
[ {
"data" : {
"duration" : 619
}
} ]

View File

@ -0,0 +1,41 @@
[ {
"uid" : "d2ab6d22b9808223",
"name" : "test_main[post请求实现登录]",
"time" : {
"start" : 1596442208564,
"stop" : 1596442208763,
"duration" : 199
},
"status" : "passed",
"severity" : "normal"
}, {
"uid" : "7a8d2a0629601fd8",
"name" : "test_main[get请求查询用户数据列表1]",
"time" : {
"start" : 1596442208965,
"stop" : 1596442209063,
"duration" : 98
},
"status" : "failed",
"severity" : "normal"
}, {
"uid" : "2ecfa83e99ce1744",
"name" : "test_main[get请求实现登录]",
"time" : {
"start" : 1596442208444,
"stop" : 1596442208554,
"duration" : 110
},
"status" : "passed",
"severity" : "normal"
}, {
"uid" : "a936c6eea54552c9",
"name" : "test_main[get请求查询用户数据列表0]",
"time" : {
"start" : 1596442208773,
"stop" : 1596442208946,
"duration" : 173
},
"status" : "passed",
"severity" : "normal"
} ]

View File

@ -0,0 +1 @@
[ ]

View File

@ -0,0 +1 @@
[ ]

View File

@ -0,0 +1,10 @@
[ {
"data" : {
"failed" : 1,
"broken" : 0,
"skipped" : 0,
"passed" : 3,
"unknown" : 0,
"total" : 4
}
} ]

View File

@ -0,0 +1 @@
[ ]

Some files were not shown because too many files have changed in this diff Show More