Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangjingdong
/
bihe_interface_test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0adcb4a9
authored
Dec 12, 2018
by
zhangjingdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改活动环境变量和添加企业墙脚本
parent
e3055871
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
41 deletions
+9
-41
碧合app/execute_automation_scripts.py
+9
-6
碧合app/活动/-活动_manage.postman_environment.json
+0
-35
No files found.
碧合app/execute_automation_scripts.py
View file @
0adcb4a9
# cod
ing = utf-8
# cod
ing = utf-8
...
@@ -9,8 +9,11 @@ class PostmanApi:
...
@@ -9,8 +9,11 @@ class PostmanApi:
def
post
(
self
):
def
post
(
self
):
file
=
[]
file
=
[]
report_file
=
"/phantom/file/testreport/"
report_file
=
"/phantom/file/testreport/"
# report_file = "/Users/lucas/Documents/报告地址/"
BASE_DIR
=
os
.
path
.
realpath
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
realpath
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
path
=
os
.
listdir
(
BASE_DIR
)
path
=
os
.
listdir
(
BASE_DIR
)
delay_request
=
str
(
50
)
timeout_request
=
str
(
5000
)
# print( path)
# print( path)
for
p
in
path
:
for
p
in
path
:
if
os
.
path
.
isdir
(
p
):
if
os
.
path
.
isdir
(
p
):
...
@@ -18,24 +21,24 @@ class PostmanApi:
...
@@ -18,24 +21,24 @@ class PostmanApi:
for
file_path
in
file
:
for
file_path
in
file
:
now_date
=
report_file
+
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
time
.
localtime
(
time
.
time
()))
now_date
=
report_file
+
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
time
.
localtime
(
time
.
time
()))
now_module
=
now_date
+
"/"
+
file_path
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'
time
.
time
()))
+
"_"
+
file_path
+
'.html'
if
(
os
.
path
.
exists
(
now_date
)):
if
(
os
.
path
.
exists
(
now_date
)):
if
(
os
.
path
.
exists
(
now_module
)):
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
)
os
.
system
(
execute
)
else
:
else
:
os
.
system
(
"mkdir "
+
now_module
)
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
)
os
.
system
(
execute
)
else
:
else
:
os
.
system
(
"mkdir "
+
now_date
)
os
.
system
(
"mkdir "
+
now_date
)
if
(
os
.
path
.
exists
(
now_module
)):
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
)
os
.
system
(
execute
)
else
:
else
:
os
.
system
(
"mkdir "
+
now_module
)
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
)
os
.
system
(
execute
)
return
self
return
self
...
...
碧合app/活动/-活动_manage.postman_environment.json
deleted
100644 → 0
View file @
e3055871
{
{
"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment