Skip to main content

Convert POSTMAN data to JSON testcases for HttpRunner.

Project description

postman2runner

Convert postman data to JSON testcases for HttpRunner.

usage

To see postman2runner version:

$ python main.py -V

To see available options, run

$ python main.py -h
usage: main.py [-h] [-V] [--log-level LOG_LEVEL]
               [postman_testset_file] [-- output_dir] [-- output_file_type]

Convert postman testcases to JSON testcases for HttpRunner.

positional arguments:
  postman_testset_file  Specify postman testset file.
  -- output_dir   Optional. Specify converted JSON testset folder.
  -- output_file_type  Optional. Generate file format , default json.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show version
  --log-level LOG_LEVEL Specify logging level, default is INFO.

examples

In most cases, you can run postman2runner like this:

$ python3 main.py tests/data/test.json --output_dir tests/postman2case --output_file_type yaml
INFO:root:Generate JSON testset successfully: output.json

As you see, the first parameter is postman source file path, and the second is converted JSON file path.

The output testset file type is detemined by the suffix of your specified file.

If you only specify postman source file path, the output testset is in JSON format by default and located in the same folder with source file.

$ python3 main.py tests/data/test.json
INFO:root:Generate JSON testset successfully: test/test.output.json

generated testset

generated JSON testset output.json shows like this:

[
    {
        "test": {
            "name": "/api/v1/Account/Login",
            "request": {
                "method": "POST",
                "url": "https://httprunner.top/api/v1/Account/Login",
                "headers": {
                    "Content-Type": "application/json"
                },
                "json": {
                    "UserName": "test001",
                    "Pwd": "123",
                    "VerCode": ""
                }
            },
            "validate": []
        }
    }
]

参考来源

HttpRunner

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

postman2runner-0.0.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

postman2runner-0.0.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file postman2runner-0.0.2.tar.gz.

File metadata

  • Download URL: postman2runner-0.0.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for postman2runner-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5ef26e4c53e5cb0ef3de2284ae801530048dbb80ad60084789b7a7e32dc00253
MD5 e6723c191f1ece9e69d1474c605b79b5
BLAKE2b-256 c0117b102b861017fc2f52b72e612773a5a16343bac3f6de44a57d9daab6af21

See more details on using hashes here.

File details

Details for the file postman2runner-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: postman2runner-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for postman2runner-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 599e014bd5c9878a11a892bd6109b0d099c9fdec8389cb91e0dc3c2019154ef7
MD5 eb995acf9953c8c7c57c4482a5ca8ca1
BLAKE2b-256 5b390a10b1e6781a7011bebc0edbe06571a89191473de6e88b6cfa107257bb28

See more details on using hashes here.

Supported by

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