Allure3 Server
使用 FastAPI 构建的服务器,用于生成和提供 Allure3 报告。
功能
- 上传测试结果(包含 Allure 结果的 ZIP 文件)
- 生成 Allure3 报告,并返回可访问的 URL
- 列出所有生成的报告
- 删除报告
安装
-
安装依赖:
pip install -r allur3-server
-
安装Allure3(使用npm):
npm install -g allure
注意:确保你的系统上已安装Node.js。
使用
-
启动服务器:
allure3-server start -
打开浏览器并导航到 `http://localhost:8000/ 访问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/",
}
Metadata
Release files for allure3-server 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| allure3_server-1.6.0.tar.gz | 43.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| allure3_server-1.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.2 MB
Release files / allure3_server-1.6.0.tar.gz
| Download URL | allure3_server-1.6.0.tar.gz |
|---|---|
| Size | 43.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acc612eeecfe0bc49e94d5951d072da8239912f06be8ae87519fdfd486e700a8
|
|
BLAKE2b-256 checksum How to use checksums |
a0365bacbfde5fbbd52b21fb88a89dbbcb8183682a50a1242a3cc3eef3855328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / allure3_server-1.6.0-py3-none-any.whl
| Download URL | allure3_server-1.6.0-py3-none-any.whl |
|---|---|
| Size | 463.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b205892ac01e3c3139335e19cd287daffb1c12517c3adddeea86937000812aa
|
|
BLAKE2b-256 checksum How to use checksums |
422d0ce3cf4c6c2fb277a6ad2f6dcc51fd99c1e0bd6aec66d879e09693fa40f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|