Commit a954fa91 by wangyuanfeng

测试脚本

parent 97c02c93
{
{
"info": {
"_postman_id": "8b65b444-52e4-44c0-b66f-10391013f540",
"name": "张贴栏",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "用户登录",
"event": [
{
"listen": "test",
"script": {
"id": "ab616fda-d96b-4f71-a9aa-6c59ce279e71",
"type": "text/javascript",
"exec": [
"// console.log(\"----------------responseBody--------------\"+responseBody);",
"var jsonData = JSON.parse(responseBody);",
"// console.log(\"----------------jsonData.data.accessToken--------------\"+jsonData.data.accessToken);",
"",
"if(jsonData.data !== null || jsonData.data !==\"\")",
"{",
" tests[\"accessToken\"] = true;",
" postman.setEnvironmentVariable(\"access-Token\",jsonData.data.accessToken);",
" ",
"}",
"else",
"{",
" console.log(\"接口返回错误:\"+jsonData.msg);",
" tests[\"accessToken\"]=false;",
"}",
""
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"userPhone\": {{user_phone}},\n \"userPassword\": \"123456\",\n \"equipment\": \"c5d93c486a95d658\",\n \"channelId\": 1\n}"
},
"url": "{{gateway-user}}/app/login"
},
"response": []
},
{
"name": "查看贴纸",
"event": [
{
"listen": "test",
"script": {
"id": "cf6abfe0-7743-4f8d-96d3-a1e9c77fdf7c",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"if(jsonData.code === \"0\")",
"{",
" tests[\"code\"] = true;",
"}",
"else{",
" console.log(\"接口返回错误:\"+jsonData.msg);",
" tests[\"code\"+jsonData.msg]=false;",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "access-token",
"value": "{{access-Token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{gateway-user}}/app/paste/{{townid}}"
},
"response": []
},
{
"name": "添加贴纸",
"event": [
{
"listen": "test",
"script": {
"id": "50bcab4c-c214-49ef-b062-d0a08f75da74",
"exec": [
"var jsonData = JSON.parse(responseBody);",
"if(jsonData.code === \"0\")",
"{",
" tests[\"code\"] = true;",
"}",
"else{",
" console.log(\"接口返回错误:\"+jsonData.msg);",
" tests[\"code\"+jsonData.msg]=false;",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "access-token",
"value": "{{access-Token}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"townId\":1,\n\t\"pasteImg\":\"aaa\",\n\t\"pasteMessage\":\"测试\"\n}"
},
"url": "{{gateway-user}}/app/paste"
},
"response": []
}
]
}
\ No newline at end of file
{
{
"id": "377c6504-6548-4f83-89ee-ae47c9e5762d",
"name": "张贴栏_manage",
"values": [
{
"key": "gateway-user",
"value": "https://usergwtest.bgycc.com",
"description": {
"content": "",
"type": "text/plain"
},
"enabled": true
},
{
"key": "user_phone",
"value": "13535593630",
"description": {
"content": "",
"type": "text/plain"
},
"enabled": true
},
{
"key": "access-Token",
"value": "deed4e19687449e7852d850ca0bae660",
"enabled": true
},
{
"key": "townid",
"value": "1",
"description": {
"content": "",
"type": "text/plain"
},
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-01-07T09:33:28.017Z",
"_postman_exported_using": "Postman/6.5.2"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment