1 Star 0 Fork 87

woerwin/Hitchhiker

forked from brookshi/Hitchhiker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sample collection.json 6.77 KB
一键复制 编辑 原始数据 按行查看 历史
brookshi 提交于 2017-11-12 18:18 . add new sample
{
"id": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"name": "Sample",
"description": "",
"order": [
"6e7f60c9-acbc-f6c5-c393-6223d9ec2f5f",
"f9bf371f-262b-f9b0-ad74-e829e8efb10a",
"7a021e01-90fb-4623-c583-d3d2af6da990",
"e3a40f37-337b-65d5-6d06-18f967cd1abb",
"d5f04d52-baa5-0c4f-b73c-687ed2c7917e",
"871f08b6-7abe-b32f-b328-0f362f12e140",
"dd4bbfc4-9d70-a050-6d53-93575939a188"
],
"folders": [],
"folders_order": [],
"timestamp": 1510480454919,
"owner": "1010955",
"public": false,
"requests": [
{
"id": "6e7f60c9-acbc-f6c5-c393-6223d9ec2f5f",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a=b",
"queryParams": [
{
"key": "a",
"value": "b",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": null,
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const crypto = hitchhiker.require('crypto-js');\n\ntests[`crypto ${crypto.HmacSHA1('test', 'asdf')}`] = true;\n\ntests[`crypto ${crypto.MD5('test')}`] = true;",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510480555818,
"name": "crypto",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "7a021e01-90fb-4623-c583-d3d2af6da990",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a=b",
"queryParams": [
{
"key": "a",
"value": "b",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const _ = hitchhiker.require('lodash');\n\nconst a = [1, 2];\n\nconst b= [3, 4];\n\ntests[_.union(a, b).join('-')] = true;",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481420285,
"name": "lodash",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "871f08b6-7abe-b32f-b328-0f362f12e140",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a={{resBody}}",
"queryParams": [
{
"key": "a",
"value": "{{resBody}}",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "const request = hitchhiker.require('request');\n\nfunction getData() {\n return new Promise((resolve, reject) => {\n const req = request(\"http://httpbin.org/get?a=request in request\", (err, res, body) => {\n resolve({ err: err, response: res, body: body });\n });\n });\n}\n\nconst res = await getData(); // MUST use async/await\n\nhitchhiker.setEnvVariable('resBody', res.body);",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const body = hitchhiker.getEnvVariable('resBody');\n\nconst obj = JSON.parse(body);\n\ntests[obj.args.a] = true;",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481527045,
"name": "request in request",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "d5f04d52-baa5-0c4f-b73c-687ed2c7917e",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a=b",
"queryParams": [
{
"key": "a",
"value": "b",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const xlsx = hitchhiker.require('xlsx');\n\nconst workbook = hitchhiker.readFileByReader('test.xlsx', xlsx.readFile); // read excel file in global_data/data by using readFileByReader\n\ntests[workbook.SheetNames[0]] = true;\n\ntests[workbook.Sheets[workbook.SheetNames[0]]['A1'].v] = true;",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481490142,
"name": "read excel",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "dd4bbfc4-9d70-a050-6d53-93575939a188",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a=b",
"queryParams": [
{
"key": "a",
"value": "b",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const uuid = hitchhiker.require('uuid');\n\ntests[uuid.v4()] = true;\n\ntests[uuid.v1()] = true;",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481546798,
"name": "uuid",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "e3a40f37-337b-65d5-6d06-18f967cd1abb",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a=b",
"queryParams": [
{
"key": "a",
"value": "b",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "hitchhiker.saveFile('test.txt', 'test file content'); // save content\n",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const value = hitchhiker.readFile('test.txt'); // read file content, support custom reader by using readFileByReader\n\ntests[value] = true;\n\nhitchhiker.removeFile('test.json'); // remove file",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481465887,
"name": "read / save / remove File",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
},
{
"id": "f9bf371f-262b-f9b0-ad74-e829e8efb10a",
"headers": "",
"headerData": [],
"url": "http://httpbin.org/get?a={{value}}",
"queryParams": [
{
"key": "a",
"value": "{{value}}",
"equals": true,
"description": "",
"enabled": true
}
],
"preRequestScript": "hitchhiker.setEnvVariable('value', 'test'); // set env variable",
"pathVariables": {},
"pathVariableData": [],
"method": "GET",
"data": null,
"dataMode": "params",
"version": 2,
"tests": "const value = hitchhiker.getEnvVariable('value'); // get env variable\n\ntests[value] = true;\n\nhitchhiker.removeEnvVariable('value'); // remove env variable\n\ntests[hitchhiker.environment] = true; // get current selected env",
"currentHelper": "normal",
"helperAttributes": {},
"time": 1510481057584,
"name": "environment",
"description": "",
"collectionId": "a8f80c44-cedd-8096-0618-aa1cc140bdb0",
"responses": []
}
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/woerwin/Hitchhiker.git
git@gitee.com:woerwin/Hitchhiker.git
woerwin
Hitchhiker
Hitchhiker
master

搜索帮助