diff --git a/README.en.md b/README.en.md new file mode 100644 index 00000000..6c743720 --- /dev/null +++ b/README.en.md @@ -0,0 +1,127 @@ +# HttpRunner + +[![Github Actions](https://github.com/httprunner/httprunner/actions/workflows/unittest.yml/badge.svg)](https://github.com/httprunner/httprunner/actions) +[![codecov](https://codecov.io/gh/httprunner/httprunner/branch/master/graph/badge.svg)](https://codecov.io/gh/httprunner/httprunner) +[![Go Reference](https://pkg.go.dev/badge/github.com/httprunner/httprunner.svg)](https://pkg.go.dev/github.com/httprunner/httprunner) +[![downloads](https://pepy.tech/badge/httprunner)](https://pepy.tech/project/httprunner) +[![pypi version](https://img.shields.io/pypi/v/httprunner.svg)](https://pypi.python.org/pypi/httprunner) +[![pyversions](https://img.shields.io/pypi/pyversions/httprunner.svg)](https://pypi.python.org/pypi/httprunner) +[![TesterHome](https://img.shields.io/badge/TTF-TesterHome-2955C5.svg)](https://testerhome.com/github_statistics) + +`HttpRunner` is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC network protocols, covering API testing, performance testing and digital experience monitoring (DEM) test types. Simple and easy to use, powerful, with rich plug-in mechanism and high scalability. + +> HttpRunner [用户调研问卷][survey] 持续收集中,我们将基于用户反馈动态调整产品特性和需求优先级。 + +![flow chart](docs/assets/hrp-flow.jpg) + +[CHANGELOG] | [中文] + +## Key Features + +### API Testing + +- [x] Full support for HTTP(S)/1.1 and HTTP/2 requests. +- [ ] Support more protocols, WebSocket, TCP, RPC etc. +- [x] Testcases can be described in multiple formats, `YAML`/`JSON`/`Golang`, and they are interchangeable. +- [x] Use Charles/Fiddler/Chrome/etc to record HTTP requests and generate testcases from exported [`HAR`][HAR]. +- [x] Supports `variables`/`extract`/`validate`/`hooks` mechanisms to create extremely complex test scenarios. +- [x] Data driven with `parameterize` mechanism, supporting sequential/random/unique strategies to select data. +- [ ] Built-in 100+ commonly used functions for ease, including md5sum, max/min, sleep, gen_random_string etc. +- [x] Create and call custom functions with `plugin` mechanism, support [hashicorp plugin] and [go plugin]. +- [x] Generate html reports with rich test results. +- [x] Using it as a `CLI tool` or a `library` are both supported. + +### Load Testing + +Base on the API testing testcases, you can run professional load testing without extra work. + +- [x] Inherit all powerful features of [`locust`][locust] and [`boomer`][boomer]. +- [x] Report performance metrics to [prometheus pushgateway][pushgateway]. +- [x] Use `transaction` to define a set of end-user actions that represent the real user activities. +- [x] Use `rendezvous` points to force Vusers to perform tasks concurrently during test execution. +- [x] Load testing with specified concurrent users or constant RPS, also supports spawn rate. +- [ ] Support mixed-scenario testing with custom weight. +- [ ] Simulate browser's HTTP parallel connections. +- [ ] IP spoofing. +- [ ] Run in distributed mode to generate unlimited RPS. + +### Digital Experience Monitoring (DEM) + +You can also monitor online services for digital experience assessments. + +- [ ] HTTP(S) latency statistics including DNSLookup, TCP connections, SSL handshakes, content transfers, etc. +- [ ] `ping` indicators including latency, throughput and packets loss. +- [ ] traceroute +- [ ] DNS monitoring + +## Install + +You can install HttpRunner via one curl command. + +```bash +$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)" +# backup +$ bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)" +``` + +Then you will get a `hrp` CLI tool. + +```bash +$ hrp -h + +██╗ ██╗████████╗████████╗██████╗ ██████╗ ██╗ ██╗███╗ ██╗███╗ ██╗███████╗██████╗ +██║ ██║╚══██╔══╝╚══██╔══╝██╔══██╗██╔══██╗██║ ██║████╗ ██║████╗ ██║██╔════╝██╔══██╗ +███████║ ██║ ██║ ██████╔╝██████╔╝██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝ +██╔══██║ ██║ ██║ ██╔═══╝ ██╔══██╗██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗ +██║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║ +╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ + +HttpRunner is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC +network protocols, covering API testing, performance testing and digital experience +monitoring (DEM) test types. Enjoy! ✨ 🚀 ✨ + +License: Apache-2.0 +Website: https://httprunner.com +Github: https://github.com/httprunner/httprunner +Copyright 2021 debugtalk + +Usage: + hrp [command] + +Available Commands: + boom run load test with boomer + completion generate the autocompletion script for the specified shell + har2case convert HAR to json/yaml testcase files + help Help about any command + run run API test + startproject create a scaffold project + +Flags: + -h, --help help for hrp + --log-json set log to json format + -l, --log-level string set log level (default "INFO") + -v, --version version for hrp + +Use "hrp [command] --help" for more information about a command. +``` + +## Subscribe + +关注 HttpRunner 的微信公众号,第一时间获得最新资讯。 + +HttpRunner + +如果你期望加入 HttpRunner 核心用户群,请填写[用户调研问卷][survey]并留下你的联系方式,作者将拉你进群。 + +[HttpRunner]: https://github.com/httprunner/httprunner +[boomer]: https://github.com/myzhan/boomer +[locust]: https://github.com/locustio/locust +[jmespath]: https://jmespath.org/ +[allure]: https://docs.qameta.io/allure/ +[HAR]: http://httparchive.org/ +[hashicorp plugin]: https://github.com/hashicorp/go-plugin +[go plugin]: https://pkg.go.dev/plugin +[CHANGELOG]: docs/CHANGELOG.md +[pushgateway]: https://github.com/prometheus/pushgateway +[survey]: https://wj.qq.com/s2/9699514/0d19/ +[中文]: README.md diff --git a/README.md b/README.md index c0570535..26714dc7 100644 --- a/README.md +++ b/README.md @@ -8,57 +8,99 @@ [![pyversions](https://img.shields.io/pypi/pyversions/httprunner.svg)](https://pypi.python.org/pypi/httprunner) [![TesterHome](https://img.shields.io/badge/TTF-TesterHome-2955C5.svg)](https://testerhome.com/github_statistics) -HttpRunner aims to be a one-stop solution for HTTP(S) testing, covering API testing, load testing and digital experience monitoring (DEM). - -See [CHANGELOG]. +`HttpRunner` 是一个开源的 API 测试工具,支持 HTTP(S)/HTTP2/WebSocket/RPC 等网络协议,涵盖接口测试、性能测试、数字体验监测等测试类型。简单易用,功能强大,具有丰富的插件化机制和高度的可扩展能力。 > HttpRunner [用户调研问卷][survey] 持续收集中,我们将基于用户反馈动态调整产品特性和需求优先级。 -## Key Features +![flow chart](docs/assets/hrp-flow.jpg) -![flow chart](docs/assets/flow.jpg) +[版本发布日志] | [English] -### API Testing +## 设计理念 -- [x] Full support for HTTP(S)/1.1 requests. -- [ ] Support more protocols, HTTP/2, WebSocket, TCP, RPC etc. -- [x] Testcases can be described in multiple formats, `YAML`/`JSON`/`Golang`, and they are interchangeable. -- [x] Use Charles/Fiddler/Chrome/etc to record HTTP requests and generate testcases from exported [`HAR`][HAR]. -- [x] Supports `variables`/`extract`/`validate`/`hooks` mechanisms to create extremely complex test scenarios. -- [x] Data driven with `parameterize` mechanism, supporting sequential/random/unique strategies to select data. -- [ ] Built-in 100+ commonly used functions for ease, including md5sum, max/min, sleep, gen_random_string etc. -- [x] Create and call custom functions with `plugin` mechanism, support [hashicorp plugin] and [go plugin]. -- [x] Generate html reports with rich test results. -- [x] Using it as a `CLI tool` or a `library` are both supported. +相比于其它 API 测试工具,HttpRunner 最大的不同在于设计理念。 -### Load Testing +- 约定大于配置:测试用例是标准结构化的,格式统一,方便协作和维护 +- 标准开放:基于开放的标准,支持与 [HAR]/Postman/Swagger/Curl/JMeter 等工具对接,轻松实现用例生成和转换 +- 一次投入多维复用:一套脚本可同时支持接口自动化测试、性能测试、数字体验监测等多种 API 测试需求 +- 融入最佳工程实践:不仅仅是一款测试工具,在功能中融入最佳工程实践,实现面向网络协议的一站式测试解决方案 -Base on the API testing testcases, you can run professional load testing without extra work. +## 核心特性 -- [x] Inherit all powerful features of [`locust`][locust] and [`boomer`][boomer]. -- [x] Report performance metrics to [prometheus pushgateway][pushgateway]. -- [x] Use `transaction` to define a set of end-user actions that represent the real user activities. -- [x] Use `rendezvous` points to force Vusers to perform tasks concurrently during test execution. -- [x] Load testing with specified concurrent users or constant RPS, also supports spawn rate. -- [ ] Support mixed-scenario testing with custom weight. -- [ ] Simulate browser's HTTP parallel connections. -- [ ] IP spoofing. -- [ ] Run in distributed mode to generate unlimited RPS. +- 网络协议:完整支持 HTTP(S)/1.1 和 HTTP/2,可扩展支持 WebSocket/TCP/RPC 等更多协议 +- 多格式可选:测试用例支持 YAML/JSON/go test/pytest 格式,并且支持格式互相转换 +- 双执行引擎:同时支持 golang/python 两个执行引擎,兼具 go 的高性能和 [pytest] 的丰富生态 +- 录制 & 生成:可使用 [HAR]/Postman/Swagger/curl 等生成测试用例;基于链式调用的方法提示也可快速编写测试用例 +- 复杂场景:基于 variables/extract/validate/hooks 机制可以方便地创建任意复杂的测试场景 +- 插件化机制:内置丰富的函数库,同时可以基于主流编程语言(go/python/java)编写自定义函数轻松实现更多能力 +- 性能测试:无需额外工作即可实现压力测试;单机可轻松支撑 `1w+` VUM,结合分布式负载能力可实现海量发压 +- 网络性能采集:在场景化接口测试的基础上,可额外采集网络链路性能指标(DNS 解析、TCP 连接、SSL 握手、网络传输等) +- 一键部署:采用二进制命令行工具分发,无需环境依赖,一条命令即可在 macOS/Linux/Windows 快速完成安装部署 -### Digital Experience Monitoring (DEM) +## 用户声音 -You can also monitor online services for digital experience assessments. +基于 252 份调研问卷的统计结果,HttpRunner 用户的整体满意度评分 `4.3/5`,最喜欢的特性包括: -- [ ] HTTP(S) latency statistics including DNSLookup, TCP connections, SSL handshakes, content transfers, etc. -- [ ] `ping` indicators including latency, throughput and packets loss. -- [ ] traceroute -- [ ] DNS monitoring +- 简单易用:测试用例支持 YAML/JSON 标准化格式,可通过录制的方式快速生成用例,上手简单,使用方便 +- 功能强大:支持灵活的自定义函数和 hook 机制,参数变量、数据驱动、结果断言等机制一应俱全,轻松适应各种复杂场景 +- 设计理念:测试用例组织支持分层设计,格式统一,易于实现测试用例的维护和复用 -## Sponsors +更多内容详见 [HttpRunner 首轮用户调研报告(2022.02)][user-survey-report] -Thank you to all our sponsors! ✨🍰✨ ([become a sponsor](sponsors.md)) +## 一键部署 -### 金牌赞助商(Gold Sponsor) +HttpRunner 二进制命令行工具已上传至阿里云 OSS,在系统终端中执行如下命令可完成安装部署。 + +```bash +$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)" +# backup +$ bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)" +``` + +安装成功后,你将获得一个 `hrp` 命令行工具,执行 `hrp -h` 即可查看到参数帮助说明。 + +```bash +$ hrp -h + +██╗ ██╗████████╗████████╗██████╗ ██████╗ ██╗ ██╗███╗ ██╗███╗ ██╗███████╗██████╗ +██║ ██║╚══██╔══╝╚══██╔══╝██╔══██╗██╔══██╗██║ ██║████╗ ██║████╗ ██║██╔════╝██╔══██╗ +███████║ ██║ ██║ ██████╔╝██████╔╝██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝ +██╔══██║ ██║ ██║ ██╔═══╝ ██╔══██╗██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗ +██║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║ +╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ + +HttpRunner is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC +network protocols, covering API testing, performance testing and digital experience +monitoring (DEM) test types. Enjoy! ✨ 🚀 ✨ + +License: Apache-2.0 +Website: https://httprunner.com +Github: https://github.com/httprunner/httprunner +Copyright 2021 debugtalk + +Usage: + hrp [command] + +Available Commands: + boom run load test with boomer + completion generate the autocompletion script for the specified shell + har2case convert HAR to json/yaml testcase files + help Help about any command + run run API test + startproject create a scaffold project + +Flags: + -h, --help help for hrp + --log-json set log to json format + -l, --log-level string set log level (default "INFO") + -v, --version version for hrp + +Use "hrp [command] --help" for more information about a command. +``` + +## 赞助商 + +### 金牌赞助商 [霍格沃兹测试开发学社](https://ceshiren.com/) @@ -66,7 +108,7 @@ Thank you to all our sponsors! ✨🍰✨ ([become a sponsor](sponsors.md)) > [进入测试开发技术能力测评!](http://qrcode.testing-studio.com/f?from=httprunner&url=https://ceshiren.com/t/topic/14940) -### 开源服务赞助商(Open Source Sponsor) +### 开源服务赞助商 [Sentry](https://sentry.io/_/open-source/) @@ -85,9 +127,12 @@ HttpRunner is in Sentry Sponsored plan. [locust]: https://github.com/locustio/locust [jmespath]: https://jmespath.org/ [allure]: https://docs.qameta.io/allure/ -[HAR]: http://httparchive.org/ +[HAR]: https://en.wikipedia.org/wiki/HAR_(file_format) [hashicorp plugin]: https://github.com/hashicorp/go-plugin [go plugin]: https://pkg.go.dev/plugin -[CHANGELOG]: docs/CHANGELOG.md +[版本发布日志]: docs/CHANGELOG.md [pushgateway]: https://github.com/prometheus/pushgateway [survey]: https://wj.qq.com/s2/9699514/0d19/ +[user-survey-report]: https://httprunner.com/blog/user-survey-report/ +[English]: README.en.md +[pytest]: https://docs.pytest.org/ diff --git a/docs/assets/flow.jpg b/docs/assets/flow.jpg deleted file mode 100644 index 98515853..00000000 Binary files a/docs/assets/flow.jpg and /dev/null differ diff --git a/docs/assets/hrp-flow.jpg b/docs/assets/hrp-flow.jpg new file mode 100644 index 00000000..01a0d050 Binary files /dev/null and b/docs/assets/hrp-flow.jpg differ diff --git a/hrp/cmd/root.go b/hrp/cmd/root.go index 680686ce..b0d69625 100644 --- a/hrp/cmd/root.go +++ b/hrp/cmd/root.go @@ -15,7 +15,7 @@ import ( // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "hrp", - Short: "One-stop solution for HTTP(S) testing.", + Short: "One-stop solution for API testing.", Long: ` ██╗ ██╗████████╗████████╗██████╗ ██████╗ ██╗ ██╗███╗ ██╗███╗ ██╗███████╗██████╗ ██║ ██║╚══██╔══╝╚══██╔══╝██╔══██╗██╔══██╗██║ ██║████╗ ██║████╗ ██║██╔════╝██╔══██╗ @@ -24,12 +24,13 @@ var rootCmd = &cobra.Command{ ██║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ -hrp (HttpRunner+) aims to be a one-stop solution for HTTP(S) testing, covering API testing, -load testing and digital experience monitoring (DEM). Enjoy! ✨ 🚀 ✨ +HttpRunner is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC +network protocols, covering API testing, performance testing and digital experience +monitoring (DEM) test types. Enjoy! ✨ 🚀 ✨ License: Apache-2.0 Website: https://httprunner.com -Github: https://github.com/httprunner/httprunner/hrp +Github: https://github.com/httprunner/httprunner Copyright 2021 debugtalk`, PersistentPreRun: func(cmd *cobra.Command, args []string) { var noColor = false diff --git a/scripts/install.sh b/scripts/install.sh index 1858cc7b..d26b93b6 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -23,7 +23,7 @@ export -f echoError function get_latest_version() { # Release v0.4.0 · httprunner/hrp · GitHub - curl -sL https://github.com/httprunner/hrp/releases/latest | grep 'Release' | cut -d" " -f4 + curl -sL https://github.com/httprunner/httprunner/releases/latest | grep '<title>Release' | cut -d" " -f4 } function get_os() { @@ -75,7 +75,7 @@ function main() { # aliyun OSS url is invalid, try to download from github version=$(get_latest_version) pkg="hrp-$version-$os-$arch$pkg_suffix" - url="https://github.com/httprunner/hrp/releases/download/$version/$pkg" + url="https://github.com/httprunner/httprunner/releases/download/$version/$pkg" fi echo "Latest version: $version"