Giter VIP home page Giter VIP logo

fasterrunner's Introduction

HttpRunner

Github Actions codecov Go Reference downloads pypi version pyversions TesterHome

HttpRunner 是一个开源的 API 测试工具,支持 HTTP(S)/HTTP2/WebSocket/RPC 等网络协议,涵盖接口测试、性能测试、数字体验监测等测试类型。简单易用,功能强大,具有丰富的插件化机制和高度的可扩展能力。

HttpRunner 用户调研问卷 持续收集中,我们将基于用户反馈动态调整产品特性和需求优先级。

flow chart

版本发布日志 | English

设计理念

相比于其它 API 测试工具,HttpRunner 最大的不同在于设计理念。

  • 约定大于配置:测试用例是标准结构化的,格式统一,方便协作和维护
  • 标准开放:基于开放的标准,支持与 HAR/Postman/Swagger/Curl/JMeter 等工具对接,轻松实现用例生成和转换
  • 一次投入多维复用:一套脚本可同时支持接口自动化测试、性能测试、数字体验监测等多种 API 测试需求
  • 融入最佳工程实践:不仅仅是一款测试工具,在功能中融入最佳工程实践,实现面向网络协议的一站式测试解决方案

核心特性

  • 网络协议:完整支持 HTTP(S)/HTTP2/WebSocket,可扩展支持 TCP/UDP/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 快速完成安装部署

用户声音

基于 252 份调研问卷的统计结果,HttpRunner 用户的整体满意度评分 4.3/5,最喜欢的特性包括:

  • 简单易用:测试用例支持 YAML/JSON 标准化格式,可通过录制的方式快速生成用例,上手简单,使用方便
  • 功能强大:支持灵活的自定义函数和 hook 机制,参数变量、数据驱动、结果断言等机制一应俱全,轻松适应各种复杂场景
  • 设计理念:测试用例组织支持分层设计,格式统一,易于实现测试用例的维护和复用

更多内容详见 HttpRunner 首轮用户调研报告(2022.02)

一键部署

HttpRunner 二进制命令行工具已上传至阿里云 OSS,在系统终端中执行如下命令可完成安装部署。

$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"

安装成功后,你将获得一个 hrp 命令行工具,执行 hrp -h 即可查看到参数帮助说明。

$ 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 2017 debugtalk

Usage:
  hrp [command]

Available Commands:
  adb          simple utils for android device management
  boom         run load test with boomer
  build        build plugin for testing
  completion   Generate the autocompletion script for the specified shell
  convert      convert multiple source format to HttpRunner JSON/YAML/gotest/pytest cases
  help         Help about any command
  ios          simple utils for ios device management
  pytest       run API test with pytest
  run          run API test with go engine
  startproject create a scaffold project
  wiki         visit https://httprunner.com

Flags:
  -h, --help               help for hrp
      --log-json           set log to json format
  -l, --log-level string   set log level (default "INFO")
      --venv string        specify python3 venv path
  -v, --version            version for hrp

Use "hrp [command] --help" for more information about a command.

用户案例

赞助商

霍格沃兹测试开发学社

霍格沃兹测试开发学社是中国软件测试开发高端教育品牌,产品由国内顶尖软件测试开发技术专家携手打造,为企业与个人提供专业的技能培训与咨询、测试工具与测试平台、测试外包与测试众包服务。领域涵盖 App/Web 自动化测试、接口自动化测试、性能测试、安全测试、持续交付/DevOps、测试左移、测试右移、精准测试、测试平台开发、测试管理等方向。-> 联系我们

Subscribe

关注 HttpRunner 的微信公众号,第一时间获得最新资讯。

HttpRunner

fasterrunner's People

Contributors

xglh avatar yinquanwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fasterrunner's Issues

建议:编辑用例集相关

  • 编辑用例集时,增加全选功能
  • 把API往用例集里面增加时,提示重复功能.(通过直接复制单个用例来实现一个API多个用例的情况)
  • 编辑用例时,增加单个用例的复制功能.(方便同一个业务,多个类似的用例)
  • 删除用例集的时候,在提示语中,把这个用例集的名字加上(可以更加明确即将删除的用例集)
    image
    image

Failed to build mysqlclient

Failed to build mysqlclient
Installing collected packages: uwsgi, pytz, Django, django-cors-headers, djangorestframework, MarkupSafe, Jinja2, colorlog, PyYAML, har2case, urllib3, chardet, idna, certifi, requests, requests-toolbelt, colorama, HttpRunner, mysqlclient, beautifulsoup4, tornado, amqp, anyjson, kombu, billiard, celery, django-celery
Running setup.py install for mysqlclient: started
Running setup.py install for mysqlclient: finished with status 'error'
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-3nozu9o_/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-774h17u7-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying mysql_exceptions.py -> build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.5/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.5/MySQLdb
creating build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.5/MySQLdb/constants
running build_ext
building 'mysql' extension
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,13,'final',0) -D__version
=1.3.13 -I/usr/include/mysql -I/usr/include/python3.5m -c _mysql.c -o build/temp.linux-x86_64-3.5/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.5/_mysql.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-3nozu9o_/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-774h17u7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-3nozu9o_/mysqlclient/
The command '/bin/sh -c pip3 install -r ./requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --default-timeout=100 && ln -s /opt/workspace/FasterRunner/nginx.conf /etc/nginx/sites-enabled/' returned a non-zero code: 1

用例组有两个用例集的时候,执行失败.提示服务器连接超时

描述:

  • 环境变量的header调用了get_token函数,这个函数在debugtalk中是已经写了.是可以正常调用
  • 用例组中含有两个用例集,一个用例集有2个用例,一个用例集有1个用例.两个用例集都是可以单独正常执行.
  • 但是执行用例组(含有2个用例集)时,失败就提示服务器连接超时.
  • 服务端日志

image

  • 前端页面
    image

python3 manage.py migrate .Send error please help me

[root@localhost FasterRunner-master]# python3 manage.py migrate
System check identified some issues:

WARNINGS:
?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/2.1/ref/databases/#mysql-sql-mode
Operations to perform:
Apply all migrations: admin, auth, contenttypes, djcelery, fastrunner, fastuser, sessions
Running migrations:
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL)' at line 1")

The above exception was the direct cause of the following exception:

django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL)' at line 1")

During handling of the above exception, another exception occurred:

django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL)' at line 1"))
`

建议:延长token的时间.

  • 目前停在页面稍微长一点时间,可能会出现连接超时的情况
  • 连接超时之后,必须要返回到项目概况,从新进入页面才是正常的.直接刷新当前页面还是连接超时

建议:增加用户管理

  • 目前是直接注册就可以了,木有修改密码的功能.建议改成用Django 的admin后台来替换掉现在的注册功能.

建议:API编写相关

  • 请求默认方式改为get,日常使用中,感觉post没有get频率高
  • 点击Request栏的时候,URL中的请求参数自动加载到params这一栏中.(参考postman)
  • API恢复读取配置(上一版的环境功能)
    • 现在的写法,例如获取用户信息,要求header传入token 请求地址: $url/get/userInfo header信息 token=${get_token()}
      • 只能把请求$url写死在api中.$url是通过变量的方式获取.但切换运行API的环境,还是需要改url的值.
      • 例如:想把测试环境改成生产环境来运行.要么改变全局变量url对应的值.要么设置多一个全局变量来保存生产环境的url.无法实现通过一个请求地址$url/get/userInfo header就能动态切换环境
      • 上一版的写法请求地址: /get/userInfo url在环境在定义好,token在环境中调用hook函数先获取好,因为很多借口需要用到token
      • 上一版的好处1:,多个api中需要token时,只需要在一个环境中调用好即可. 但现在需要在每个api中调用获取token的函数.
      • 上一版的好处2: 现在的版本,因为api中不能读取配置,导致每个api都要在header中调用获取token函数,
        设置header的content-type等信息.但是用例集是可以读取配置.token是可以通过配置来获取.无需在用例中获取...这样就导致写用例的时候,需要写删除掉api中的获取token的函数,来避免重复获取token.
        image

【建议】API相关的优化

API搜索

  • API 增加URL搜索功能
  • API 增加Tag搜索功能
    image

API编辑

  • API 增加Tag功能,对于已经调试过的API,加上一个tag作为标记
    image

API运行

  • API 增加选中多个API,点击可以批量运行(相当于把选中的多个API生成一个临时的用例)
    image

API用例

  • API 增加选中多个API,可以直接加入到已存在的用例,或者新增用例
    image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.