Commit 0adcb4a9 by zhangjingdong

修改活动环境变量和添加企业墙脚本

parent e3055871
# coding = utf-8
# coding = utf-8
......@@ -9,8 +9,11 @@ class PostmanApi:
def post(self):
file = []
report_file = "/phantom/file/testreport/"
# report_file = "/Users/lucas/Documents/报告地址/"
BASE_DIR = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
path = os.listdir(BASE_DIR)
delay_request = str(50)
timeout_request= str(5000)
# print( path)
for p in path:
if os.path.isdir(p):
......@@ -18,24 +21,24 @@ class PostmanApi:
for file_path in file:
now_date = report_file + time.strftime("%Y-%m-%d", time.localtime(time.time()))
now_module = now_date + "/" + file_path
now_time = now_date + "/" + file_path + "/" + time.strftime("%H%M%S", time.localtime(
now_time = now_date + "/" + file_path + "/" + time.strftime("%H-%M", time.localtime(
time.time())) + "_" + file_path + '.html'
if (os.path.exists(now_date)):
if (os.path.exists(now_module)):
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/-" + file_path + "_manage.postman_environment.json --delay-request 500 --timeout-request 5000 --reporters html --reporter-html-export " + now_time
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/" + file_path + "_manage.postman_environment.json --delay-request "+delay_request+" --timeout-request "+timeout_request+" --reporters html --reporter-html-export " + now_time
os.system(execute)
else:
os.system("mkdir " + now_module)
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/-" + file_path + "_manage.postman_environment.json --delay-request 500 --timeout-request 5000 --reporters html --reporter-html-export " + now_time
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/" + file_path + "_manage.postman_environment.json --delay-request "+delay_request+" --timeout-request "+timeout_request+" --reporters html --reporter-html-export " + now_time
os.system(execute)
else:
os.system("mkdir " + now_date)
if (os.path.exists(now_module)):
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/-" + file_path + "_manage.postman_environment.json --delay-request 500 --timeout-request 5000 --reporters html --reporter-html-export " + now_time
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/" + file_path + "_manage.postman_environment.json --delay-request "+delay_request+" --timeout-request "+timeout_request+" --reporters html --reporter-html-export " + now_time
os.system(execute)
else:
os.system("mkdir " + now_module)
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/-" + file_path + "_manage.postman_environment.json --delay-request 500 --timeout-request 5000 --reporters html --reporter-html-export " + now_time
execute = "newman run " + BASE_DIR + "/" + file_path + "/" + file_path + ".postman_collection.json -e " + BASE_DIR + "/" + file_path + "/" + file_path + "_manage.postman_environment.json --delay-request "+delay_request+" --timeout-request "+timeout_request+" --reporters html --reporter-html-export " + now_time
os.system(execute)
return self
......
{
{
"id": "a3a5880d-98ad-45e8-84e3-7642fdfa81c2",
"name": "\b活动_manage",
"values": [
{
"key": "gateway-user",
"value": "https://usergwtest.bgycc.com",
"enabled": true,
"type": "text"
},
{
"key": "user_phone",
"value": "18670340158",
"enabled": true,
"type": "text"
},
{
"key": "access-Token",
"value": "be4c6160f25c4085b6c4c61fa7803a7a",
"enabled": true,
"type": "text"
},
{
"key": "activityId",
"value": "196",
"enabled": true,
"type": "text"
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2018-11-27T03:29:41.309Z",
"_postman_exported_using": "Postman/6.1.4"
}
\ 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