Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
83e57909
Commit
83e57909
authored
Jul 24, 2024
by
xiao-hesheng
Browse files
数据库验证流程十二脚本编写
parent
e9d805ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/public1/public1/public1.py
View file @
83e57909
...
...
@@ -141,6 +141,64 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'):
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
approval_center_all
(
OBH_ID
=
'OBhxxxxxxxxxxxxxxx'
):
module
=
"b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
print
(
info
)
username1
=
info
[
'username1'
]
username
=
username1
## print('医院名称',username)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"apprCenter_url"
)
# 获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
# 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload50_6"
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
data
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
for
i
in
data1
:
# code = commonFuc().analysis_json('code', result)
# data = commonFuc().analysis_json('data', result)
# total = commonFuc().analysis_json('total', result)
# data1 = commonFuc().analysis_json('data', i)
taskId
=
commonFuc
().
analysis_json
(
'taskId'
,
i
)
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"approvalBatch_url"
)
# 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload50_7"
,
taskId
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
>=
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
approval_center1
():
module
=
"b2_herp3_bs"
...
...
main1/main_text.py
View file @
83e57909
...
...
@@ -3,6 +3,10 @@ import sys
import
os
# print('根据当前文件获取当前文件所在目录的路径', os.path.dirname(__file__))
import
traceback
from
air_case.public1.public1.public1
import
approval_center
,
approval_center_all
curPath
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
# 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath) # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
...
...
@@ -183,20 +187,33 @@ def main_text():
else
:
print
(
'Cancel'
)
def
flow5_flow18
():
flow5
()
flow6
()
flow7
()
flow8
()
flow9
()
flow10
()
flow11
()
flow12
()
flow13
()
flow14
()
flow15
()
flow16
()
flow17
()
flow18
()
#脚本运行前清空所有待审批数据
approval_center_all
()
i
=
1
while
True
:
try
:
flow5
()
flow6
()
flow7
()
flow8
()
flow9
()
flow10
()
flow11
()
flow12
()
flow13
()
flow14
()
flow15
()
flow16
()
flow17
()
flow18
()
except
Exception
as
e
:
print
(
'第'
+
str
(
i
)
+
'次脚本出现异常,请检查脚本或者数据'
)
# print("发生异常:", str(e))
# traceback.print_exc()
print
(
'第'
+
str
(
i
)
+
'次重新运行'
)
continue
else
:
break
def
flow11_flow18
():
flow11
()
flow12
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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