Giter Club home page Giter Club logo

micengineapitest's Introduction

计算服务API测试用例

  • 安装nodejs

API测试环境是HTML和JavaScript代码,要正常运行这些代码需要需要Node.js环境。安装Node环境请参阅搭建Node环境 .

  • 安装nodejs本地静态服务器
npm install -g live-server
  • 克隆项目
git clone https://github.com/bkzy-wangjp/micengineapitest.git
  • 编辑配置文件

配置文件为: static/config.json

配置文件内容:

{
    "BaseUrl":"http://127.0.0.1:8080/",
    "UserName":"abcde",
    "Password":"123456",
    "Apis":[
        {
            "Name":"接口的文字描述"
            ,"Method":"GET"
            ,"Url":"api/test"
            ,"Parameters":{
                "version":"v2"
            }
            ,"Result":{}
        }
    ]
}

其中:

参数 类型 说明
BaseUrl string 计算服务访问地址
UserName string 用户名
Password string 密码
Apis object数组 待测试的接口信息,不限个数
Apis[x].Name string 接口的描述信息
Apis[x].Method string 接口的读取方法,GETPOST
Apis[x].Url string 接口的短URL
Apis[x].Parameters object 接口的参数键值对,不限个数
Apis[x].Result object 接口的返回值存储预留区,留空
  • 运行项目

方法1:

# 导航到项目所在文件夹
cd micengineapitest
# 启动本地静态服务器
live-server

方法2: 在Visual Studio Code中启动在线服务 在Visual Studio Code中启动在线服务

运行后的API接口测试页面如下图: 运行后的API接口测试页面

micengineapitest's People

Contributors

bdgca-wjp avatar

Watchers

James Cloos avatar  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.