HttpRunner 项目使用教程

HttpRunner 项目使用教程

httprunnerHttpRunner 是一个开源的 API/UI 测试工具,简单易用,功能强大,具有丰富的插件化机制和高度的可扩展能力。项目地址:https://gitcode.com/gh_mirrors/ht/httprunner

1. 项目的目录结构及介绍

HttpRunner 项目的目录结构如下:

httprunner/
├── docs/
├── examples/
├── hrps/
├── scripts/
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.en.md
├── README.md
├── go.mod
├── go.sum
├── poetry.lock
├── pyproject.toml

目录介绍

  • docs/: 包含项目的文档文件。
  • examples/: 包含示例测试用例。
  • hrps/: 包含核心的测试引擎代码。
  • scripts/: 包含一些辅助脚本。
  • .gitignore: Git 忽略文件配置。
  • Dockerfile: Docker 镜像构建文件。
  • LICENSE: 项目许可证文件。
  • Makefile: 用于构建和测试的 Makefile。
  • README.en.md: 英文版的项目介绍文档。
  • README.md: 中文版的项目介绍文档。
  • go.mod: Go 模块文件。
  • go.sum: Go 模块依赖校验文件。
  • poetry.lock: Python 依赖锁定文件。
  • pyproject.toml: Python 项目配置文件。

2. 项目的启动文件介绍

HttpRunner 项目的启动文件是 hrp 命令行工具。可以通过以下命令启动:

hrp [command]

可用命令

  • adb: 简单的 Android 设备管理工具。
  • boom: 使用 Boomer 运行负载测试。
  • build: 构建测试插件。
  • completion: 生成自动补全脚本。
  • convert: 将多种源格式转换为 HttpRunner JSON/YAML/gotest/pytest 用例。
  • help: 帮助信息。
  • ios: 简单的 iOS 设备管理工具。
  • pytest: 使用 pytest 运行 API 测试。
  • run: 使用 Go 引擎运行 API 测试。

3. 项目的配置文件介绍

HttpRunner 项目的配置文件主要是 pyproject.tomlgo.mod

pyproject.toml

pyproject.toml 是 Python 项目的配置文件,包含项目的基本信息和依赖管理。

[tool.poetry]
name = "httprunner"
version = "3.x.x"
description = "HttpRunner is an open-source API testing tool."
authors = ["debugtalk <debugtalk@example.com>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.6"
requests = "^2.25.1"
PyYAML = "^5.4.1"
...

[tool.poetry.dev-dependencies]
pytest = "^6.2.2"
...

go.mod

go.mod 是 Go 模块文件,定义了项目的 Go 依赖。

module github.com/httprunner/httprunner

go 1.16

require (
    github.com/stretchr/testify v1.7.0
    ...
)

通过这些配置文件,可以管理和构建 HttpRunner 项目。

httprunnerHttpRunner 是一个开源的 API/UI 测试工具,简单易用,功能强大,具有丰富的插件化机制和高度的可扩展能力。项目地址:https://gitcode.com/gh_mirrors/ht/httprunner

  • 14
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

常拓季Jane

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值