Skip to content

Releases: bbxwinner/httprunner

v4.3.6

07 Sep 13:23
f79553a

Choose a tag to compare

Merge pull request #1692 from httprunner/fix-identifier

fix: swipeToTapTexts redundant identifiers

v4.3.3.2306151200

16 Jun 08:07

Choose a tag to compare

active IgnoreNotFoundError option for tap_cv

v4.3.2-fix-adb

29 Jan 03:27

Choose a tag to compare

fix: err wrap and TapFloat

v4.2.0

08 Oct 08:36
7364b60

Choose a tag to compare

fix bug when --run-time specified.

v4.2.0-dial

03 Aug 08:17

Choose a tag to compare

Main Changes

支持数字体验监测——网络拨测的基础能力:ping / dns解析 / traceroute

v4.1.6-dial-test

29 Jul 04:08

Choose a tag to compare

Main Changes

  • feat: support run ping and save results
Usage:
  hrp ping $url [flags]

Flags:
  -c, --count int           Stop after sending (and receiving) N packets (default 10)
  -h, --help                help for ping
  -i, --interval duration   Wait N seconds between sending each packet (default 1s)
      --save-tests          Save ping results json
  -t, --timeout duration    Ping exits after N seconds (default 20s)

Global Flags:
      --log-json           set log to json format
  -l, --log-level string   set log level (default "INFO")
      --venv string        specify python3 venv path

v4.1.7-fix-upload-file

13 Jul 08:07

Choose a tag to compare

新特性

上传文件时支持指定 MIME 类型和文件名称

使用方式

在用于上传文件的 upload 字段中,当且仅当 map 的值以 @ 开头,例如 @"FILEPATH"@FILEPATH 的形式时,程序会尝试加载 FILEPATH 所指向的文件,并以 form-data 的形式上传。另外,支持在文件路径的后面增加filename=xxxtype=xxx选项用于配置 MIME 头域信息,选项和文件路径之间用分号 ‘;‘ 分隔开。

如果 map 值不为文件路径而是普通文本时,程序会自动去除文本最外层包裹的双引号,例如传递的文本为 "@DUMMYPATH" 时,实际传递给服务端的是 @DUMMYPATH

注意

当 map 值为普通文本时,filenametype 选项依然会生效。

下面给出一个完整的测试用例:

{
    "config": {
        "name": "test upload file to httpbin",
        "base_url": "http://httpbin.org",
        "variables": {
            "upload_file": "test.env"
        }
    },
    "teststeps": [
        {
            "name": "upload field string with filename and type",
            "request": {
                "method": "POST",
                "url": "/post",
                "headers": {
                    "Content-Type": "${multipart_content_type($m_encoder)}"
                },
                "body": "$m_encoder",
                "upload": {
                    "foo1": "bar1",
                    "foo2": "@\"$upload_file\";filename=newBar2;type=text/plain"
                }
            },
            "validate": [
                {
                    "check": "status_code",
                    "assert": "equals",
                    "expect": 200,
                    "msg": "check status code"
                },
                {
                    "check": "body.form.foo1",
                    "assert": "startswith",
                    "expect": "bar1",
                    "msg": "check foo1 in form"
                },
                {
                    "check": "body.files.foo2",
                    "assert": "startswith",
                    "expect": "UserName=test",
                    "msg": "check foo2 in files"
                }
            ]
        }
    ]
}

抓包自测

使用 hrp 运行上面的测试用例,并使用 wireshark 的抓包结果如下:

image

v4.1.7-fix-ws

12 Jul 12:26

Choose a tag to compare

v4.1.7 (2022-07-11)

go version

  • feat: support omitting websocket url if not necessary
  • feat: support multiple websocket connections each session
  • fix: optimize websocket step initialization