Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
Test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曹燕
Test
Commits
71a4e837
Commit
71a4e837
authored
Nov 25, 2019
by
huangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改执行的用例配置
parent
89397b26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
common.py
Interface_Atuo_test/jiyunying/common.py
+7
-7
config.conf
Interface_Atuo_test/jiyunying/config.conf
+2
-2
run.conf
Interface_Atuo_test/jiyunying/run.conf
+3
-2
run.py
Interface_Atuo_test/jiyunying/run.py
+3
-3
No files found.
Interface_Atuo_test/jiyunying/common.py
View file @
71a4e837
...
@@ -45,10 +45,10 @@ def get_time_name() -> list:
...
@@ -45,10 +45,10 @@ def get_time_name() -> list:
# 读取配置文件
# 读取配置文件
def
readconf
(
section
,
option
):
def
readconf
(
section
,
option
,
config_path
=
"config.conf"
):
value
=
""
value
=
""
cf
=
configparser
.
ConfigParser
()
cf
=
configparser
.
ConfigParser
()
cf
.
read
(
"config.conf"
,
encoding
=
"utf-8"
)
cf
.
read
(
config_path
,
encoding
=
"utf-8"
)
if
cf
.
has_option
(
section
,
option
):
if
cf
.
has_option
(
section
,
option
):
value
=
cf
.
get
(
section
,
option
)
value
=
cf
.
get
(
section
,
option
)
else
:
else
:
...
@@ -57,10 +57,10 @@ def readconf(section, option):
...
@@ -57,10 +57,10 @@ def readconf(section, option):
# 获取执行的用例或用例路径
# 获取执行的用例或用例路径
def
get_case_path
(
section
):
def
get_case_path
(
section
,
config_path
=
"run.conf"
):
values
=
[]
values
=
[]
cf
=
configparser
.
ConfigParser
()
cf
=
configparser
.
ConfigParser
()
cf
.
read
(
"run.conf"
,
encoding
=
"utf-8"
)
cf
.
read
(
config_path
,
encoding
=
"utf-8"
)
if
cf
.
has_section
(
section
):
if
cf
.
has_section
(
section
):
items
=
cf
.
items
(
section
)
items
=
cf
.
items
(
section
)
for
item
in
items
:
for
item
in
items
:
...
@@ -72,12 +72,12 @@ def get_case_path(section):
...
@@ -72,12 +72,12 @@ def get_case_path(section):
# 更新配置文件
# 更新配置文件
def
update_conf
(
section
,
option
,
value
):
def
update_conf
(
section
,
option
,
value
,
config_path
=
"config.conf"
):
cf
=
configparser
.
ConfigParser
()
cf
=
configparser
.
ConfigParser
()
cf
.
read
(
"config.conf"
,
encoding
=
"utf-8"
)
cf
.
read
(
config_path
,
encoding
=
"utf-8"
)
if
cf
.
has_option
(
section
,
option
):
if
cf
.
has_option
(
section
,
option
):
cf
.
set
(
section
,
option
,
value
)
cf
.
set
(
section
,
option
,
value
)
cf
.
write
(
open
(
"config.conf"
,
"w"
))
cf
.
write
(
open
(
config_path
,
"w"
))
else
:
else
:
print
(
"section, option,value值错误:"
,
section
+
" "
+
option
+
" "
+
value
)
print
(
"section, option,value值错误:"
,
section
+
" "
+
option
+
" "
+
value
)
...
...
Interface_Atuo_test/jiyunying/config.conf
View file @
71a4e837
...
@@ -9,10 +9,10 @@ reportpath = report/
...
@@ -9,10 +9,10 @@ reportpath = report/
web_hook
=
https
://
oapi
.
dingtalk
.
com
/
robot
/
send
?
access_token
=
94
b76afb5b538437e9986e95bd9e4c882cfcf3c75e8c1b3a6f209cac403b8e00
web_hook
=
https
://
oapi
.
dingtalk
.
com
/
robot
/
send
?
access_token
=
94
b76afb5b538437e9986e95bd9e4c882cfcf3c75e8c1b3a6f209cac403b8e00
[
token
]
[
token
]
token
=
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
.
eyJ1aWQiOiIyNTc0ODgiLCJ0ZXJtaW5hbCI6InBjIiwidXVpZCI6I
jIwNDFlZmNjNWNmZjRlNTlhZTkzNWY0YjhkODQ3MzhlIiwidGltZXN0YW1wIjoxNTc0NjY2NjQwODU3fQ
.
_
G5B9sI238xlT6sAkJ3ou15Qj3HXUIleF4UhJ48YdeY
token
=
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
.
eyJ1aWQiOiIyNTc0ODgiLCJ0ZXJtaW5hbCI6InBjIiwidXVpZCI6I
mMxZmYwYzM0NWU5OTRmZWJhZWRiZTE3YjY4YWE0YmZkIiwidGltZXN0YW1wIjoxNTc0NjY3NzUxMDM4fQ
.
TsobEylOLhkayoGSPWMXy9SrGCrRyFrQ
-
wgX9H7ROi0
[
password
]
[
password
]
wan_neng_password
=
A0S7f14f94e7
-
dcc
wan_neng_password
=
[
user
]
[
user
]
phone
=
15300000000
phone
=
15300000000
...
...
Interface_Atuo_test/jiyunying/run.conf
View file @
71a4e837
[
test
]
[
test
]
student_new
=
reception
/
testsuites
/
apply_stuent_new
.
yml
login
=
login
/
testsuites
/
login
.
yml
\ No newline at end of file
#
student_new
=
reception
/
testsuites
/
apply_stuent_new
.
yml
\ No newline at end of file
Interface_Atuo_test/jiyunying/run.py
View file @
71a4e837
...
@@ -21,7 +21,7 @@ def run():
...
@@ -21,7 +21,7 @@ def run():
# mapping=override_mapping
# mapping=override_mapping
for
test_case_path
in
path_or_testcases
:
for
test_case_path
in
path_or_testcases
:
runner
.
run
(
test_case_path
)
runner
.
run
(
test_case_path
)
dingdingmessage
.
send_result_message
(
runner
.
summary
)
#
dingdingmessage.send_result_message(runner.summary)
send_email
=
SendEmail
()
send_email
=
SendEmail
()
subject
=
common
.
get_time_name
()[
0
]
+
"接口测试报告"
subject
=
common
.
get_time_name
()[
0
]
+
"接口测试报告"
attachments
=
[]
attachments
=
[]
...
@@ -35,8 +35,8 @@ if __name__ == "__main__":
...
@@ -35,8 +35,8 @@ if __name__ == "__main__":
gd
=
getdata
.
GetData
()
gd
=
getdata
.
GetData
()
phone
=
common
.
readconf
(
"user"
,
"phone"
)
phone
=
common
.
readconf
(
"user"
,
"phone"
)
password
=
common
.
readconf
(
"user"
,
"password"
)
password
=
common
.
readconf
(
"user"
,
"password"
)
gd
.
set_token
(
phone
,
password
)
#
gd.set_token(phone, password)
#
gd.set_wan_neng_password(phone, password)
gd
.
set_wan_neng_password
(
phone
,
password
)
run
()
run
()
...
...
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