Skip to main content

No project description provided

Project description

haf

The http api auto test framework. 

Build Status Documentation Status

new features

  • based on local test runner

  • support xlsx,json,yml,py cases

  • report generate with html-template

  • multi-processes on different machines

  • multi-runners

  • web-server support restful api based on flask

  • only mode : loader/runner/recorder/webserver/bus support

report all

How to get it

using pip to get it

   tsbxmw@ps# pip install haf --upgrade

using git tool to get it

   tsbxmw@ps# git clone https://github.com/tsbxmw/haf
   tsbxmw@ps# cd haf
   tsbxmw@ps# python setup.py install

How to run

local bus mode, using local bus to run all cases

  • local bus is without --bus-server(-bs) args, when running the program, the bus would be created
modify the config.json in testcases
  • change the log_path and report_path and case_path to your own path
    {
      "config":{
        "run": {
          "log": {
            "log_path": "D:/workspace/mine/python/haf/data"
          },
          "bus": {
            "only": false,
            "host": "",
            "port": "",
            "auth_key": ""
          },
          "report": {
            "report_path": "D:/workspace/mine/python/haf/data/report.html"
          },
          "case": [
            {
              "case_path": "D:/workspace/mine/python/haf/testcases/test.xlsx"
            },
            {
              "case_path": "D:/workspace/mine/python/haf/testcases/test2.json"
            },
            {
              "case_path": "D:/workspace/mine/python/haf/testcases/test1.xlsx"
            },
            {
              "case_path": "D:/workspace/mine/python/haf/testcases/test3.yml"
            }
          ],
          "runner":{
            "only": false,
            "count": 4
          },
          "loader": {
            "only": false
          },
          "recorder": {
            "only": false
          },
          "web_server": {
            "host": "",
            "port": "",
            "run": true
          }
        }
      }

    }
create testcase
  • create xlsx/json/yml file with template in testcases/
run
  • run with config
    python -m haf run -c=./testcases/config.json
  • run with args
    python -m haf run -case=./testcases/test.xlsx,./testcases/test2.json -ld=./data -rh=true -rod=./data/report.html
other run args
  • run with multi-runners (4 runners)
    python -m haf run -rc=4
  • run with web server
    python -m haf run -ws=true
  • run with only-mode
    # only loader
    python -m haf run -ol=true
    # only bus
    python -m haf run -ob=true
    # only runner
    python -m haf run -or=true
    # only recorder
    python -m haf run -ore=true

web api server suport

  • get loader infos
    http://localhost:8888/loader
  • get runner infos
    http://localhost:8888/runner
  • get result infos
    http://localhost:8888/result
  • get report infos
    http://localhost:8888/report

FrameWork

Design

map

Doc

doc url read the doc

Release Note

release note

Project details


Release history Release notifications | RSS feed

This version

2.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haf-2.0.3-py2.py3-none-any.whl (275.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file haf-2.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: haf-2.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 275.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for haf-2.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e3d2821305ffd3631fc3e0f0e6fbdce89a38d224f8f2281b79b560df9a2e191
MD5 1c6cf3f6607038525100a6a1264854bb
BLAKE2b-256 a1b4f04390ed0560f55009fce8f1b5f6436c057739ed9dd74a80b6174f5cf51d

See more details on using hashes here.

Supported by

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