0.9.15 • Published 9 months ago

lupinus v0.9.15

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

I know there are many API testing tools that seem easy to use at first glance, but I honestly don't trust them because they store OpenAPI specifications and authentication information in some online storage without permission 🤢

But what lupinus does is really simple, so please try it 😘

Architecture

npm.io

lupinus is an API server testing tool. lupinus reads the OpenAPI specification, calls the APIs in the order described in the test cases, and verifies the normality of their responses. The response is verified for correctness. The verification results can be output to standard output or to an arbitrary file.

Install

npm install lupinus

Setting

API Specification

Use the tool of your choice to create an OpenAPI specification and output it somewhere in YAML or JSON.

Test cases

In the test case, write in YAML or JSON what order to call the paths described in the OpenAPI specification. Also, write down the expected response.

For example, if you write that you expect HTTP status code 200, lupinus will verify that the data model written in the OpenAPI 200 response is returned.

The string inside the wave brackets will be replaced; the wave brackets in the Authentication header will be Base64-encoded with the user ID and password between the colons. In addition, context in the brackets stores the response of the path executed in the previous step. For example, context[2] is the response of the third executed path.

testCases: 
  - title: "Example"
    contextPath: "https://example.com/path/to"
    sequence: 
      - path: /auth/token
        method: POST
        spec: oauth2.ClientCredentials
        request:
          headers: 
            accept: application/json
            content-type: application/x-www-form-urlencoded
            authorization: Basic {user1:pass1>}
          body:
            grant_type: client_credentials
        response:
          status: 200
      - path: /business/data
        method: GET
        request:
          headers: 
            authorization: Bearer {context[0].access_token}
        response:
          status: 200

Log setting

By default, lupinus will output test results to standard output. If you want to output to a file, write the file path in the output attribute.

threshold: info
output: result.log
errorOutput: error-result.log

Test

npx lupinus --spec oas.yaml --testcase testcases.yaml --log log.yaml

License

MIT

Developers

Takuro Okada


© Takuro Okada

0.9.15

9 months ago

0.9.14

9 months ago

0.9.13

11 months ago

0.9.12

12 months ago

0.9.11

12 months ago

0.9.10

12 months ago

0.9.9

12 months ago

0.9.8

12 months ago

0.9.7

12 months ago

0.9.6

12 months ago

0.9.5

12 months ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago