Skip to main content

No project description provided

Project description

介绍

基于httprunner==3.1.6版本,根据特定需求二次定制开发

1、保留2.x版本的用例分层机制,避免冗余出现api基本信息(url、headers、method等)
2、除支持http和https协议外,支持SSH协议,可以远程执行shell命令、文件上传和下载
3、兼容支持2.x测试报告,便于测试时调试
4、数据驱动改成一个Class N个test_*用例方式,便于用例扫描成独立用例
5、支持test_xx的__doc__自动生成,并支持config.variables和parameters变量解析
6、yml中config中usefixtures字段,支持pytest指定添加fixture
7、支持特定场景下的skipif代码生成

新增SSH部分示例:

1、执行shell命令
config:
  name: demo - exec shell cmd
  variables:
    executor: ls
    params: -alh
teststeps:
  - name: api -> shell
    protocol: ssh
    connection:   # 指定目标机器IP、Port、User和Password
      ssh_ip: ${ENV(hostname)}  
      ssh_port: ${ENV(ssh_port)}
      ssh_user: ${ENV(ssh_user)}
      ssh_password: ${ENV(ssh_password)}
    request:
      type: shell   # 指定类型为执行Shell命令
      executor: $executor  # shell自带命令或可执行程序
      params: $params # 字符串或字符串列表
2、文件上传
config:
  name: demo - upload file
teststeps:
  - name: api -> upload
    protocol: ssh
    connection:
      ssh_ip: ${ENV(hostname)}
      ssh_port: ${ENV(ssh_port)}
      ssh_user: ${ENV(ssh_user)}
      ssh_password: ${ENV(ssh_password)}
    request:
        type: upload # 指定类型为文件上传
        local_path: $local_path  # 相对于本项目根目录的路径
        remote_path: $remote_path  # 远程绝对路径
3、文件下载
config:
  name: demo - download file
teststeps:
  - name: api -> download
    protocol: ssh
    connection:
      ssh_ip: ${ENV(hostname)}
      ssh_port: ${ENV(ssh_port)}
      ssh_user: ${ENV(ssh_user)}
      ssh_password: ${ENV(ssh_password)}
    request:
        type: download # 指定类型为文件下载
        local_path: $local_path  # 相对于本项目根目录的路径
        remote_path: $remote_path  # 远程绝对路径

参考:

homepage = "https://github.com/httprunner/httprunner"
repository = "https://github.com/httprunner/httprunner"
documentation = "https://docs.httprunner.org"
blog = "https://debugtalk.com/

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

vhrun3-1.1.3.tar.gz (57.0 kB view hashes)

Uploaded Source

Built Distribution

vhrun3-1.1.3-py3-none-any.whl (67.0 kB view hashes)

Uploaded Python 3

Supported by

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