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
90f588fa
Commit
90f588fa
authored
Mar 07, 2024
by
xiao-hesheng
Browse files
新增审批流程设置脚本
parent
39881493
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b2_herp3_bs/r_g5流程设置_审批流程设置_自定义流程_保存.air/r_g5流程设置_审批流程设置_自定义流程_保存.py
0 → 100644
View file @
90f588fa
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,r_g5流程设置_审批流程设置_自定义流程_保存,id2263,id2263-268,sit,on
内网:r_g5流程设置_审批流程设置_自定义流程_保存
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:r_g5流程设置_审批流程设置_自定义流程_保存
用例名称:r_g5流程设置_审批流程设置_自定义流程_保存
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
## 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
()
# print( token,projectCode,uxid,corpId,info)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_insertOrUpdateBatch_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"
))
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# r_g5流程设置_审批流程设置_自定义流程_保存
# for i in list2:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload65_1"
)
print
(
'request_body'
,
request_body
)
new_request_body
=
request_body
.
replace
(
"'"
,
'"'
)
# new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import
json
request_body_json
=
json
.
loads
(
new_request_body
)
print
(
'request_body_json'
,
request_body_json
)
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body_json
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b2_herp3_bs/r_g6流程设置_审批流程设置_自定义流程_编辑.air/r_g6流程设置_审批流程设置_自定义流程_编辑.py
0 → 100644
View file @
90f588fa
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,r_g6流程设置_审批流程设置_自定义流程_编辑,id2263,id2263-269,sit,on
内网:r_g6流程设置_审批流程设置_自定义流程_编辑
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:r_g6流程设置_审批流程设置_自定义流程_编辑
用例名称:r_g6流程设置_审批流程设置_自定义流程_编辑
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
## 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
()
# print( token,projectCode,uxid,corpId,info)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_insertOrUpdateBatch_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"
))
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# r_g6流程设置_审批流程设置_自定义流程_编辑
# for i in list2:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload65_2"
)
print
(
'request_body'
,
request_body
)
new_request_body
=
request_body
.
replace
(
"'"
,
'"'
)
# new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import
json
request_body_json
=
json
.
loads
(
new_request_body
)
print
(
'request_body_json'
,
request_body_json
)
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body_json
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b2_herp3_bs/r_g7流程设置_审批流程设置_自定义流程_删除.air/r_g7流程设置_审批流程设置_自定义流程_删除.py
0 → 100644
View file @
90f588fa
# -*- encoding=utf8 -*-
import
sys
from
airtest.core.helper
import
using
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_kind_goodsinfo
import
delKindGoodsinfo
from
common.db.sql.sql_del_notices_info
import
delByNoticeName
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,r_g7流程设置_审批流程设置_自定义流程_删除,id2263,id2263-270,sit,on
内网:r_g7流程设置_审批流程设置_自定义流程_删除
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
module
=
"b2_herp3_bs"
def
test1
():
"""
场景:r_g7流程设置_审批流程设置_自定义流程_删除
用例名称:r_g7流程设置_审批流程设置_自定义流程_删除
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
"""
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
## 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
()
# print( token,projectCode,uxid,corpId,info)
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_insertOrUpdateBatch_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"
))
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# r_g7流程设置_审批流程设置_自定义流程_删除
# for i in list2:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload65"
)
print
(
'request_body'
,
request_body
)
new_request_body
=
request_body
.
replace
(
"'"
,
'"'
)
# new_request_body = new_request_body.replace("None", 'null')
# print(new_request_body)
import
json
request_body_json
=
json
.
loads
(
new_request_body
)
print
(
'request_body_json'
,
request_body_json
)
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body_json
,
headers
)
print
(
'resultaaaaaaaaaaaaaaaaaaa'
,
result
)
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b2_herp3_bs/data
View file @
90f588fa
...
...
@@ -516,6 +516,9 @@ json_headers2: {
"payload64_3": {"pageNum":1,"pageSize":200,"queryObject":{"methodCode":"%s","operType":"restful","startTime":"","endTime":""}}
"payload64_4": {"pageNum":1,"pageSize":"%s","queryObject":{"methodCode":"","operType":"restful","startTime":"","endTime":""}}
"payload65": '[{"id":"3a8395c5578745a6a7cf6b48ae166ce6","lastModified":"2024-01-22 09:09:29","version":0,"createTime":"2024-01-22 09:09:29","createUser":"UID-050151","lastModifiedUser":"UID-050151","businessType":0,"procType":0,"modelName":"默认审批流","judgeType":"111","rangeType":0,"rangeData":null,"modelJson":"[{\"no\":0,\"nodeName\":\"运营主管\",\"assigneeType\":2}]","nodeQty":1,"sortNo":0,"modelList":[{"no":0,"nodeName":"运营主管","assigneeType":2,"assignee":null}],"rangeDataFirst":null,"rangeDataSecond":null}]'
"payload65_1": '[{"id":"3a8395c5578745a6a7cf6b48ae166ce6","lastModified":"2024-03-07 08:44:05","version":0,"createTime":"2024-03-07 08:44:05","createUser":"h0347:UID-042066","lastModifiedUser":"h0347:UID-042066","businessType":0,"procType":0,"modelName":"默认审批流","judgeType":"111","rangeType":0,"rangeData":null,"modelJson":"[{\"no\":0,\"nodeName\":\"运营主管\",\"assigneeType\":2}]","nodeQty":1,"sortNo":0,"modelList":[{"no":0,"nodeName":"运营主管","assigneeType":2,"assignee":null}],"rangeDataFirst":null,"rangeDataSecond":null},{"businessType":0,"judgeType":"","modelList":[{"assigneeType":0,"nodeName":"test","assignee":"UID-048618"}],"modelName":"test","rangeDataFirst":999999,"rangeDataSecond":null,"rangeType":3}]'
"payload65_2": '[{"id":"3a8395c5578745a6a7cf6b48ae166ce6","lastModified":"2024-03-07 09:32:20","version":0,"createTime":"2024-03-07 09:32:20","createUser":"h0347:UID-042066","lastModifiedUser":"h0347:UID-042066","businessType":0,"procType":0,"modelName":"默认审批流","judgeType":"111","rangeType":0,"rangeData":null,"modelJson":"[{\"no\":0,\"nodeName\":\"运营主管\",\"assigneeType\":2}]","nodeQty":1,"sortNo":0,"modelList":[{"no":0,"nodeName":"运营主管","assigneeType":2,"assignee":null}],"rangeDataFirst":null,"rangeDataSecond":null},{"businessType":0,"judgeType":"","modelList":[{"assigneeType":0,"nodeName":"zzzz","assignee":"UID-050151"}],"modelName":"zzzz","rangeDataFirst":2222,"rangeDataSecond":44444,"rangeType":2}]'
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
...
...
report/summary.html
View file @
90f588fa
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/r_g
4
流程设置_审批流程设置_
默认
流程_
保存
/log.html'
target=
'_blank'
>
r_g
4
流程设置_审批流程设置_
默认
流程_
保存
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/r_g
7
流程设置_审批流程设置_
自定义
流程_
删除
/log.html'
target=
'_blank'
>
r_g
7
流程设置_审批流程设置_
自定义
流程_
删除
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.92
9
</td>
<td
class=
"details-col-elapsed"
>
2.26
9
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
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