API Check分析

api check

postman (js runtime lib)

apizza simple

easy-mock (github)

postman

manage

workspace -- > colletions

exoprt and import(swagger1.0/2.0,curl)

runner ---> collection

develop console--debug

request

prescript

https://www.getpostman.com/docs/v6/postman/scripts/test_examples

proxy

environment(value/object/nest object)

reponse

test

https://www.getpostman.com/docs/v6/postman/scripts/test_exampleshttps://www.getpostman.com/docs/v6/postman/scripts/test_examples control the requestpostman.setNextRequest("request_name");

common lib

  • chai → v3.5.0
  • cheerio → v0.22.0
  • crypto-js → v3.1.9-1
  • csv-parse/lib/sync → 1.2.1
  • lodash → v4.17.4 (when used with require, the inbuilt _ object is for v3.10.1)
  • moment → v2.18.1 (sans locales)
  • postman-collection → v1.2.0
  • tv4 → v1.2.7
  • uuid → (the module loaded is a shim for original module)
  • xml2js → 0.4.19
uses

var atob = require('atob'),
_ = require('lodash'), 

arrayOfStrings,
base64Strings;

arrayOfStrings =  = ['string1', 'string2'];

base64Strings = _.map(arrayOfStrings, atob); 

console.log(base64Strings);

api desc

markdown

ci

new man

npm i -g newman

newman run hetao-console.postman_collection.json --environment hetao-console.postman_environment.json -r html

mock server

mock data

API

CASE:

1,发布时测试, 2,线上的API健康度监控

Feature

  1. 集合

  2. 导出collection,导出环境配置文件

  3. CLI: newman run

  4. document.cookie 导出cookie,添加到每个请求里面。需要建立domain,然后填充cookie.

    创建第一个request,其他的采用复制创建的方式。

你可能感兴趣的:(API Check分析)