Socket
Book a DemoInstallSign in
Socket

mm-api-test

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mm-api-test

MAGICMIND http API 测试工具

latest
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

APITEST

仿真本地登录,保存用户信息,并调用相关测试函数 使用方法:

Todo

  • 实现并行任务处理
  • 使用request组件实现HTTP请求,替换当前的实现
  • 实现预执行任务
  • 实现执行方式为瀑布流方式,使得多个任务间可以传递结果数据

Example

Usage: apitest [host] [port] <testcase ...>
 USING mm-api-test Tools to Execute Standard HTTP JSON API TestCase
 Options:

 -h, --help                  output usage information
 -V, --version               output the version number
 -h, --host [value]          Api Server Host,default=localhost
 -p, --port [n]              Api Server Port,default=8000
 -r, --pre-testcase [value]  pre execute testcase for run Test,eg:prelogin Case
 -t, --tasks [n]             parallel execute Testcase tasks count,using for Performance Test

Example

//测试用例
 var debug=require('debug')('Test-01');
 module.exports={
  //测试用例名称
  name:'START TEST CASE',
  case_steps:[
    {
      //测试步骤名称
      step_name:'测试用例01',
      url:'/test/test01',
      post_body:{
        abc:'test-abc',
      },
      //检测错误,有错误返回错误描述,正确返回null
      checkError:function(resp_code,resp_body){
        if(resp_code != 200) return '错误返回码';
        debug('OK');
      }
    },
  ]
};

Keywords

test

FAQs

Package last updated on 01 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts