Giter Site home page Giter Site logo

swagger2case's Introduction

swagger2case

LICENSE Build Status coveralls

Convert swagger data to yaml testcases for HttpRunner.

usage

To see swagger2case version:

$ sw2case -V
0.0.1

To see available options, run

$ sw2case -h
usage: sw2case [-h] [-V] [--log-level LOG_LEVEL]
               [swagger_testset_file] [output_testset_file]

Convert swagger testcases to JSON testcases for HttpRunner.

positional arguments:
  swagger_testset_file  Specify swagger testset file.
  output_testset_file   Optional. Specify converted JSON testset file.

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 swagger2case like this:

$ sw2case test/test.json output.json
INFO:root:Generate JSON testset successfully: output.json

As you see, the first parameter is swagger 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 swagger source file path, the output testset is in JSON format by default and located in the same folder with source file.

$ sw2case test/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": []
        }
    }
]

swagger2case's People

Contributors

shuangyangcoco avatar garyzhang avatar bstester avatar debugtalk avatar

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.