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
1274e8d8
authored
Dec 12, 2018
by
zhangjingdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加脚本
parent
e3055871
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
224 additions
and
19 deletions
+224
-19
.DS_Store
+0
-0
.idea/workspace.xml
+45
-13
碧合app/execute_automation_scripts.py
+9
-6
碧合app/企业墙/企业墙.postman_collection.json
+129
-0
碧合app/企业墙/企业墙_manage.postman_environment.json
+41
-0
碧合app/活动/活动_manage.postman_environment.json
+0
-0
No files found.
.DS_Store
View file @
1274e8d8
No preview for this file type
.idea/workspace.xml
View file @
1274e8d8
...
...
@@ -2,7 +2,9 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"243b24f3-3df7-4c72-bf73-8de81d5ca458"
name=
"Default"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/碧合app/活动/-活动_manage.postman_environment.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"TRACKING_ENABLED"
value=
"true"
/>
...
...
@@ -12,15 +14,15 @@
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
<component
name=
"CoverageDataManager"
>
<SUITE
FILE_PATH=
"coverage/bihe_interface_test$execute_automation_scripts.coverage"
NAME=
"execute_automation_scripts Coverage Results"
MODIFIED=
"154
3544423737
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$/碧合app"
/>
<SUITE
FILE_PATH=
"coverage/bihe_interface_test$execute_automation_scripts.coverage"
NAME=
"execute_automation_scripts Coverage Results"
MODIFIED=
"154
4607852384
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$/碧合app"
/>
</component>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
leaf-file-name=
"execute_automation_scripts.py"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-124
"
>
<caret
line=
"1
5"
column=
"32"
lean-forward=
"true"
selection-start-line=
"15"
selection-start-column=
"32"
selection-end-line=
"15"
selection-end-column=
"32
"
/>
<state
relative-caret-position=
"
198
"
>
<caret
line=
"1
1"
column=
"49"
lean-forward=
"true"
selection-start-line=
"11"
selection-start-column=
"49"
selection-end-line=
"11"
selection-end-column=
"49
"
/>
<folding>
<element
signature=
"e#18#29#0"
expanded=
"true"
/>
</folding>
...
...
@@ -38,8 +40,8 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
leaf-file-name=
"
-
活动_manage.postman_environment.json"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/
-
活动_manage.postman_environment.json"
>
<file
leaf-file-name=
"活动_manage.postman_environment.json"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
...
...
@@ -71,7 +73,7 @@
<component
name=
"NodePackageJsonFileManager"
>
<packageJsonPaths
/>
</component>
<component
name=
"ProjectFrameBounds"
fullScreen=
"true"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
fullScreen=
"true"
>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"height"
value=
"900"
/>
</component>
...
...
@@ -91,7 +93,18 @@
<path>
<item
name=
"bihe_interface_test"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"bihe_interface_test"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"venv"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"bihe_interface_test"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"bihe_interface_test"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"碧合app"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"bihe_interface_test"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"bihe_interface_test"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"碧合app"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"活动"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"bihe_interface_test"
type=
"b2602c69:ProjectViewProjectNode"
/>
...
...
@@ -169,9 +182,9 @@
<window_info
anchor=
"bottom"
id=
"Database Changes"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"7"
/>
<window_info
a
ctive=
"true"
a
nchor=
"bottom"
id=
"Run"
order=
"2"
visible=
"true"
weight=
"0.32969698"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
visible=
"true"
weight=
"0.32969698"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"7"
weight=
"0.32969698"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25679544
"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.26037195
"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
anchor=
"right"
id=
"Database"
order=
"3"
/>
<window_info
anchor=
"right"
id=
"SciView"
order=
"3"
/>
...
...
@@ -208,6 +221,25 @@
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"270"
>
<caret
line=
"15"
column=
"32"
lean-forward=
"true"
selection-start-line=
"15"
selection-start-column=
"32"
selection-end-line=
"15"
selection-end-column=
"32"
/>
<folding>
<element
signature=
"e#18#29#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/README.md"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动.postman_collection.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"234"
>
<caret
line=
"14"
column=
"25"
selection-start-line=
"14"
selection-start-column=
"25"
selection-end-line=
"14"
selection-end-column=
"25"
/>
<folding>
...
...
@@ -222,14 +254,14 @@
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动.postman_collection.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/
-
活动_manage.postman_environment.json"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/htmlOut.html"
/>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动.postman_collection.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/
-
活动_manage.postman_environment.json"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
>
...
...
@@ -243,7 +275,7 @@
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/htmlOut.html"
/>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/
-
活动_manage.postman_environment.json"
>
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动/活动_manage.postman_environment.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/README.md"
>
...
...
@@ -259,8 +291,8 @@
<entry
file=
"file://$PROJECT_DIR$/碧合app/活动2018-11-28_09:34:00.html"
/>
<entry
file=
"file://$PROJECT_DIR$/碧合app/execute_automation_scripts.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-124
"
>
<caret
line=
"1
5"
column=
"32"
lean-forward=
"true"
selection-start-line=
"15"
selection-start-column=
"32"
selection-end-line=
"15"
selection-end-column=
"32
"
/>
<state
relative-caret-position=
"
198
"
>
<caret
line=
"1
1"
column=
"49"
lean-forward=
"true"
selection-start-line=
"11"
selection-start-column=
"49"
selection-end-line=
"11"
selection-end-column=
"49
"
/>
<folding>
<element
signature=
"e#18#29#0"
expanded=
"true"
/>
</folding>
...
...
碧合app/execute_automation_scripts.py
View file @
1274e8d8
# cod
ing = utf-8
# cod
ing = 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
...
...
碧合app/企业墙/企业墙.postman_collection.json
0 → 100644
View file @
1274e8d8
{
{
"info"
:
{
"_postman_id"
:
"2a3c1f0c-37b1-4c06-9f2f-a378571047d6"
,
"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"
:
"APP根据类型查询企业列表"
,
"request"
:
{
"method"
:
"POST"
,
"header"
:
[
{
"key"
:
"access-Token"
,
"value"
:
"{{access-Token}}"
},
{
"key"
:
"Content-Type"
,
"value"
:
"application/json"
}
],
"body"
:
{
"mode"
:
"raw"
,
"raw"
:
"{
\n
\"
townId
\"
: 1,
\n
\"
id
\"
:
\"\"\n
}"
},
"url"
:
{
"raw"
:
"{{gateway-user}}/enterprise/wall/type?p=1&c=10"
,
"host"
:
[
"{{gateway-user}}"
],
"path"
:
[
"enterprise"
,
"wall"
,
"type"
],
"query"
:
[
{
"key"
:
"p"
,
"value"
:
"1"
},
{
"key"
:
"c"
,
"value"
:
"10"
}
]
}
},
"response"
:
[]
},
{
"name"
:
"APP 获取企业详情"
,
"event"
:
[
{
"listen"
:
"test"
,
"script"
:
{
"id"
:
"abd52a73-7a0b-470d-bd6b-26b308776215"
,
"type"
:
"text/javascript"
,
"exec"
:
[
""
]
}
}
],
"request"
:
{
"method"
:
"GET"
,
"header"
:
[
{
"key"
:
"Content-Type"
,
"value"
:
"application/json"
},
{
"key"
:
"access-Token"
,
"value"
:
"{{access-Token}}"
}
],
"body"
:
{},
"url"
:
"{{gateway-user}}/enterprise/wall/{{id}}"
},
"response"
:
[]
}
]
}
\ No newline at end of file
碧合app/企业墙/企业墙_manage.postman_environment.json
0 → 100644
View file @
1274e8d8
{
{
"id"
:
"8696c47e-61ac-4e1c-915a-403b5b20c36e"
,
"name"
:
"企业墙_manage"
,
"values"
:
[
{
"key"
:
"gateway-user"
,
"value"
:
"https://usergwtest.bgycc.com"
,
"enabled"
:
true
,
"type"
:
"text"
},
{
"key"
:
"user_phone"
,
"value"
:
"17610939089"
,
"enabled"
:
true
,
"type"
:
"text"
},
{
"key"
:
"access-Token"
,
"value"
:
"d0623a906fac4f1bb9c410680eced5ef"
,
"enabled"
:
true
,
"type"
:
"text"
},
{
"key"
:
"townId"
,
"value"
:
"1"
,
"enabled"
:
true
,
"type"
:
"text"
},
{
"key"
:
"id"
,
"value"
:
"289"
,
"enabled"
:
true
,
"type"
:
"text"
}
],
"_postman_variable_scope"
:
"environment"
,
"_postman_exported_at"
:
"2018-12-12T07:51:18.360Z"
,
"_postman_exported_using"
:
"Postman/6.1.4"
}
\ No newline at end of file
碧合app/活动/
-
活动_manage.postman_environment.json
→
碧合app/活动/活动_manage.postman_environment.json
View file @
1274e8d8
File moved
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