承接 psybizz/http-endpoint-tester 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

psybizz/http-endpoint-tester

最新稳定版本:v1.0.3

Composer 安装命令:

composer create-project psybizz/http-endpoint-tester

包简介

Test application for http(s) endpoints written in node.js

README 文档

README

A HTTP endpoint tester using node.js, inspired by the node-test-tutorial of David Beath and the talk of Danny Dinneen at the 2014 edition of the Endpoint conference.

The tool is written to be used in a CI pipeline with jenkins, to test endpoints of rest(ful) API's. That's why it depends on environment variables, this makes it easy to use the tool in a CI pipeline.

Usage

initialise environment

npm install

This will install/update all the required modules for running the tests

Also a composer wrapper is provided, implemented to keep our own jenkins as stupid as possible ;)

Run tests

ENDPOINT_PATHS=<path/to/paths/file.json> ENDPOINT_HOST=<host>:<port> SITE_URI=<FQDN> ./node_modules/.bin/mocha --ui tdd

Adding paths to test

Select the project in resources Open paths.json and add the following stanza:

[
    {
            "path": "/api/info",
            "method": "GET",
            "headers": {
                "header1": "value1",
                "header2": "value2"
            },
            "statusCode": [200, 302],
            "public": 1,
            "secure": 0,
            "requireFQDN": 0,
            "timeout": 500
    },
    {
        // another stanza
    }
]

path: path to test
method: GET,POST, PUT or PATCH
statuscode: [statuscode(s)]
public: should endpoint be available in production
secure: use http or https (needs to be implemented) timeout: timeout in milliseconds
requireFQDN: mark a test as optional or required when an site uri has been specified. ( optional parameter )

public and secure are not implemented yet.

NOTE on site_uri: this will be set as host header in the request object as demanded by the HTTP1.1 standard, but the request/request implementation will use this value as proxy. So when the tested host is not identical to the site_uri, you are strongly advised to specify followRedirects to false.

Resources

Todo

  • implement https support

统计信息

  • 总下载量: 1.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-23