Skip to main content

No project description provided

Project description

Allure3 Server

使用 FastAPI 构建的服务器,用于生成和提供 Allure3 报告。

功能

  • 上传测试结果(包含 Allure 结果的 ZIP 文件)
  • 生成 Allure3 报告,并返回可访问的 URL
  • 列出所有生成的报告
  • 删除报告

安装

  1. 安装依赖:

    pip install -r allur3-server
    
  2. 安装Allure3(使用npm):

    npm install -g allure
    

    注意:确保你的系统上已安装Node.js。

使用

  1. 启动服务器:

    allure3-server start
    
  2. 打开浏览器并导航到 `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/",
 
}

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.4.0.tar.gz (43.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allure3_server-1.4.0-py3-none-any.whl (464.2 kB view details)

Uploaded Python 3

File details

Details for the file allure3_server-1.4.0.tar.gz.

File metadata

  • Download URL: allure3_server-1.4.0.tar.gz
  • Upload date:
  • Size: 43.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for allure3_server-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d43d496413f9558afa9bc6ed4a90d06491354415ca9bd3b53a35cdfa453812df
MD5 6260dfd409978975cf5f3d6b8772ecdf
BLAKE2b-256 42ce41acc1b9a1c3f899fefed8f7be97b59027eb65a6c54d5af496398013b2ad

See more details on using hashes here.

File details

Details for the file allure3_server-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: allure3_server-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 464.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for allure3_server-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80274d40bc82088f0e438621dd0804264d8d33e688c1a53089cfc3232f1ee18f
MD5 ed2816d68eb5f5e489f492c94ea074e4
BLAKE2b-256 644faa07610e8cf2fd1d881ddf293c878c552afd3f76e8f6b025bb2f64750494

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page