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
2dfd039c
Commit
2dfd039c
authored
Nov 22, 2019
by
huangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改执行方式
parent
07e35650
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
17 deletions
+40
-17
common.py
Interface_Atuo_test/jiyunying/common.py
+21
-2
config.conf
Interface_Atuo_test/jiyunying/config.conf
+2
-3
dingdingmessage.py
Interface_Atuo_test/jiyunying/dingdingmessage.py
+1
-1
debugtalk.py
Interface_Atuo_test/jiyunying/reception/debugtalk.py
+8
-6
run.py
Interface_Atuo_test/jiyunying/run.py
+7
-4
debugtalk.py
Interface_Atuo_test/jiyunying/teach_manage/debugtalk.py
+1
-1
No files found.
Interface_Atuo_test/jiyunying/common.py
View file @
2dfd039c
...
@@ -19,7 +19,8 @@ def validate_ip(ip_str) -> bool:
...
@@ -19,7 +19,8 @@ def validate_ip(ip_str) -> bool:
# 更新配置文件的数据
# 更新配置文件的数据
def
update_address
(
address
:
str
):
def
update_address
(
address
:
list
):
if
len
(
address
)
==
2
:
if
address
==
"geek.jkwljy.com"
:
if
address
==
"geek.jkwljy.com"
:
update_conf
(
"host"
,
"host"
,
address
)
update_conf
(
"host"
,
"host"
,
address
)
elif
address
:
elif
address
:
...
@@ -28,7 +29,10 @@ def update_address(address: str):
...
@@ -28,7 +29,10 @@ def update_address(address: str):
else
:
else
:
print
(
"IP地址错误:"
,
address
)
print
(
"IP地址错误:"
,
address
)
else
:
else
:
print
(
"未输入IP地址,使用默认IP地址:192.168.32.41:3000"
)
print
(
"未输入IP地址,使用默认IP地址"
)
else
:
print
(
"未输入IP地址,使用默认IP地址"
)
# 获取时间格式名称
# 获取时间格式名称
...
@@ -53,6 +57,21 @@ def readconf(section, option):
...
@@ -53,6 +57,21 @@ def readconf(section, option):
return
value
return
value
# 获取执行的用例或用例路径
def
get_case_path
(
section
):
values
=
[]
cf
=
configparser
.
ConfigParser
()
cf
.
read
(
"config.conf"
,
encoding
=
"utf-8"
)
if
cf
.
has_section
(
section
):
items
=
cf
.
items
(
section
)
for
item
in
items
:
value
=
item
[
1
]
values
.
append
(
value
)
else
:
print
(
"section值错误:"
,
section
)
return
values
# 更新配置文件
# 更新配置文件
def
update_conf
(
section
,
option
,
value
):
def
update_conf
(
section
,
option
,
value
):
cf
=
configparser
.
ConfigParser
()
cf
=
configparser
.
ConfigParser
()
...
...
Interface_Atuo_test/jiyunying/config.conf
View file @
2dfd039c
...
@@ -9,7 +9,7 @@ reportpath = report/
...
@@ -9,7 +9,7 @@ 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
.
eyJ1aWQiOiIyNTc0ODgiLCJ0ZXJtaW5hbCI6InBjIiwidXVpZCI6Ij
ZhMTgxYmFmMDllNjRkZjQ5MDdhNDg3M2M5NDQ0NWNlIiwidGltZXN0YW1wIjoxNTc0MzE5NDEzNDE1fQ
.
FnymeuiIkTflj1UcCgfq3DxrDBeJ
-
TwcJz4pc_xIxdw
token
=
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
.
eyJ1aWQiOiIyNTc0ODgiLCJ0ZXJtaW5hbCI6InBjIiwidXVpZCI6Ij
g2OTE0YzkzNDQwYjQ5OTE5NGNkOGZiNTI4NTE2MWQ3IiwidGltZXN0YW1wIjoxNTc0NDA4NjQ3MDIwfQ
.
zT32vh1ZIc7iwKnZAaS452
-
oyMjQB5JUAhTeyCo9PFM
[
password
]
[
password
]
wan_neng_password
=
A0S7f14f94e7
-
dcc
wan_neng_password
=
A0S7f14f94e7
-
dcc
...
@@ -19,6 +19,5 @@ phone = 15300000000
...
@@ -19,6 +19,5 @@ phone = 15300000000
password
=
Abc123
!
password
=
Abc123
!
[
test
]
[
test
]
login
=
login
/
testsuites
/
student_new
=
reception
/
testsuites
/
apply_stuent_new
.
yml
teach_manage
=
teach_manage
/
testsuites
/
Interface_Atuo_test/jiyunying/dingdingmessage.py
View file @
2dfd039c
...
@@ -79,7 +79,7 @@ def send_result_message(summary: str):
...
@@ -79,7 +79,7 @@ def send_result_message(summary: str):
"teststep_errors"
:
teststeps
[
"errors"
],
"teststep_errors"
:
teststeps
[
"errors"
],
"teststep_skipped"
:
teststeps
[
"skipped"
],
"teststep_skipped"
:
teststeps
[
"skipped"
],
"start_datetime"
:
time
[
"start_datetime"
],
"start_datetime"
:
time
[
"start_datetime"
],
"duration_time"
:
time
[
"duration"
][:
8
]
"duration_time"
:
(
str
(
time
[
"duration"
])[:
8
])
}
}
markdown_template
=
string
.
Template
(
get_markdown_template
())
markdown_template
=
string
.
Template
(
get_markdown_template
())
markdown
=
markdown_template
.
safe_substitute
(
**
messagedata
)
markdown
=
markdown_template
.
safe_substitute
(
**
messagedata
)
...
...
Interface_Atuo_test/jiyunying/reception/debugtalk.py
View file @
2dfd039c
...
@@ -34,10 +34,12 @@ def get_student_data(attendSchool, schoolArea=3015, entrancePaper="", introducer
...
@@ -34,10 +34,12 @@ def get_student_data(attendSchool, schoolArea=3015, entrancePaper="", introducer
return
student_data
return
student_data
def
test
(
re
):
def
is_skip
():
print
(
dir
(
re
))
flag
=
None
print
(
type
(
re
.
text
))
host
=
common
.
readconf
(
"host"
,
"host"
)
if
host
==
"geek.jkwljy.com"
or
host
==
"132.232.15.12"
:
flag
=
True
else
:
flag
=
False
return
flag
Interface_Atuo_test/jiyunying/run.py
View file @
2dfd039c
...
@@ -13,17 +13,20 @@ def run():
...
@@ -13,17 +13,20 @@ def run():
report_name
=
common
.
get_time_name
()[
1
]
+
"_test.html"
report_name
=
common
.
get_time_name
()[
1
]
+
"_test.html"
runner
=
HttpRunner
(
report_dir
=
report_path
,
log_level
=
"INFO"
,
runner
=
HttpRunner
(
report_dir
=
report_path
,
log_level
=
"INFO"
,
log_file
=
log_path
,
report_file
=
report_name
,
failfast
=
True
)
log_file
=
log_path
,
report_file
=
report_name
,
failfast
=
True
)
# 测试用例路径
# 测试用例路径
path_or_testcases
=
"reception/testsuites/apply_stuent_new.yml"
path_or_testcases
=
common
.
get_case_path
(
"test"
)
dot_env_path
=
""
#
dot_env_path = ""
# 变量映射,可用于对传入测试用例中的变量进行覆盖替换。
# 变量映射,可用于对传入测试用例中的变量进行覆盖替换。
# mapping=override_mapping
# mapping=override_mapping
runner
.
run
(
path_or_testcases
)
for
test_case_path
in
path_or_testcases
:
runner
.
run
(
test_case_path
)
# dingdingmessage.send_result_message(runner.summary)
# dingdingmessage.send_result_message(runner.summary)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
common
.
update_address
(
sys
.
argv
[
1
]
)
common
.
update_address
(
sys
.
argv
)
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"
)
...
...
Interface_Atuo_test/jiyunying/teach_manage/debugtalk.py
View file @
2dfd039c
...
@@ -18,7 +18,7 @@ def get_token():
...
@@ -18,7 +18,7 @@ def get_token():
variables
=
{
variables
=
{
"course_name"
:
"测试课程名称"
"course_name"
:
"测试课程名称"
}
}
...
...
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