No project description provided
Project description
Allure3 Server
一个使用FastAPI构建的简单服务器,用于生成和提供Allure 3报告,兼容Allure 3的新架构和特性。
功能
- 上传测试结果(包含Allure 3结果的ZIP文件)
- 生成带有自定义路径和执行器信息的Allure 3报告
- 列出所有生成的报告
- 将生成的报告作为静态文件提供
安装
-
克隆或下载此仓库
-
安装依赖:
pip install -r requirements.txt
-
安装Allure 3(使用npm):
npm install -g allure
注意:确保你的系统上已安装Node.js。
使用
-
启动服务器:
allure3-server start -
打开浏览器并导航到
http://localhost:8000/docs访问Web界面
API
上传测试结果
参考 test/upload_results.py
示例请求(Python):
import requests
import pathlib
url = "http://10.0.20.202:8000/api/result"
zipfile_path = "./allure-results.zip"
filename = pathlib.Path(zipfile_path).name
headers = {"accept": "*/*"}
with open(zipfile_path, "rb") as file:
files = {
"allure_results": (filename, file, "application/x-zip-compressed"),
}
resp = requests.post(url, files=files, headers=headers)
result = resp.json()
print(result)
示例响应:
{
"fileName": "allure-results.zip",
"uuid": "1037f8be-68fb-4756-98b6-779637aa4670"
}
生成报告
参考 test/generate_report.py
示例请求(Python):
import requests
url = "http://10.0.20.202:8000/api/report"
headers = {"Content-Type": "application/json"}
resp = requests.post(url, headers=headers, data='{"uuid":"87b5ae6e-3e3e-4937-9509-54bd0ff12623"}')
result = resp.json()
print(result)
示例响应:
{
"uuid": "c994654d-6d6a-433c-b8e3-90c77d0e8163",
"path": "master/666",
"url": "http://localhost:8000/reports/87b5ae6e-3e3e-4937-9509-54bd0ff12623/",
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
allure3_server-1.2.0.tar.gz
(43.7 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file allure3_server-1.2.0.tar.gz.
File metadata
- Download URL: allure3_server-1.2.0.tar.gz
- Upload date:
- Size: 43.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8e8187482147f2506fa35e340e110d034fd8f2d65306c5c56f0e08bf04a187d
|
|
| MD5 |
8ff4ff373944b05ccc87f91c1c9c1bb8
|
|
| BLAKE2b-256 |
b46c2ee19c79b7786da22946993b0e2c742c921db17b19cd6b826673cad71a8e
|
File details
Details for the file allure3_server-1.2.0-py3-none-any.whl.
File metadata
- Download URL: allure3_server-1.2.0-py3-none-any.whl
- Upload date:
- Size: 458.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fa3f32fffde88607556447ad87da8e2113d677642cbc939433b7a8466717263
|
|
| MD5 |
788b9b2dd336598dc7ce6a3754a4dda0
|
|
| BLAKE2b-256 |
99df7e169a96e1602e889b8326faf4cfa13db5d7e990d3b5314764080b69318f
|