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
5c456ab7
Commit
5c456ab7
authored
Oct 12, 2023
by
xiao-hesheng
Browse files
院区停用
院区启用 优化脚本
parent
1f5baa57
Changes
9
Hide whitespace changes
Inline
Side-by-side
air_case/a2_herp3_bs/a1_医院信息登记.air/a1_医院信息登记.py
View file @
5c456ab7
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-
web
,a1_医院信息登记,id2263,id2263-1,sit,on
case_tag:api,mdm-
herp
,a1_医院信息登记,id2263,id2263-1,sit,on
主数据平台:a1_医院信息登记
"""
...
...
air_case/a2_herp3_bs/a2_编辑医院信息.air/a2_编辑医院信息.py
View file @
5c456ab7
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,
mdm
-web,a2_编辑医院信息,id2263,id2263-2,sit,on
case_tag:api,
herp
-web,a2_编辑医院信息,id2263,id2263-2,sit,on
主数据平台:a2_编辑医院信息
"""
...
...
air_case/a2_herp3_bs/a3院区管理页面.air/a3院区管理页面.py
View file @
5c456ab7
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,
mdm
-web,a3院区管理页面,id2263,id2263-3,sit,on
case_tag:api,
herp
-web,a3院区管理页面,id2263,id2263-3,sit,on
主数据平台:a3院区管理页面
"""
...
...
air_case/a2_herp3_bs/a4_院区新增.air/a4_院区新增.py
View file @
5c456ab7
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,
mdm
-web,a4_院区新增,id2263,id2263-4,sit,on
case_tag:api,
herp
-web,a4_院区新增,id2263,id2263-4,sit,on
主数据平台:a4_院区新增
"""
...
...
air_case/a2_herp3_bs/a5_查询院区.air/a5_查询院区.py
View file @
5c456ab7
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,
mdm
-web,a5_查询院区,id2263,id2263-5,sit,on
case_tag:api,
herp
-web,a5_查询院区,id2263,id2263-5,sit,on
主数据平台:a5_查询院区
"""
...
...
air_case/a2_herp3_bs/a6_停用院区.air/a6_停用院区.py
0 → 100644
View file @
5c456ab7
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a6_停用院区,id2263,id2263-6,sit,on
主数据平台:a6_停用院区
"""
from
common.common_func
import
commonFuc
from
air_case.a1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
from
common.fileUtls
import
FileUtils
module
=
"a2_herp3_bs"
def
disable_branch
():
"""
场景:a6_停用院区
用例名称:a6_停用院区
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
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)
#a5_查询院区
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"edit_url"
)
# print(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"
))
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
branch_name
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_name"
]
# print(branch_name)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
branch_id
,
branch_name
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
#断言
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict"
)
commonFuc
().
check_result
(
check_dict
,
result
)
disable_branch
()
\ No newline at end of file
air_case/a2_herp3_bs/a7_启用院区.air/a7_启用院区.py
0 → 100644
View file @
5c456ab7
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a7_启用院区,id2263,id2263-7,sit,on
主数据平台:a7_启用院区
"""
from
common.common_func
import
commonFuc
from
air_case.a1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
from
common.fileUtls
import
FileUtils
module
=
"a2_herp3_bs"
def
enable_branch
():
"""
场景:a7_启用院区
用例名称:a7_启用院区
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
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)
#a5_查询院区
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"edit_url"
)
# print(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"
))
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
branch_name
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_name"
]
# print(branch_name)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2_1"
,
branch_id
,
branch_name
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
#断言
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict"
)
commonFuc
().
check_result
(
check_dict
,
result
)
enable_branch
()
\ No newline at end of file
data/a2_herp3_bs/data
View file @
5c456ab7
...
...
@@ -4,6 +4,7 @@
"5ce279bb138a4261828289ae834ed53a_url": "/hospitaltest2api/platformService/sys/user/v2/permission/5ce279bb138a4261828289ae834ed53a/"
"insert_url": "/hospitaltest2api/platformService/basic/branch/insert/"
"page_url": "/hospitaltest2api/platformService/basic/branch/page/"
"edit_url": "/hospitaltest2api/platformService/basic/branch/edit/"
"username": "xhs1009"
"password": "1qaz!QAZ"
"X-APP-CODE": "herp.pc"
...
...
@@ -38,12 +39,28 @@ json_headers2: {
}
"payload2": {
"sessionId": "%s",
"uxid": "%s",
"projectCode": "%s",
"traceId": null,
"jsHash": null
"id": "%s",
"name": "%s",
"province": "11",
"city": "1101",
"area": "110101",
"mainBranch": 0,
"tbStatus": "0",
"hosId": "h0347",
"ybFlag": "0",
"address": "东土城路院区"
}
"payload2_1": {
"id": "%s",
"name": "%s",
"province": "11",
"city": "1101",
"area": "110101",
"mainBranch": 0,
"tbStatus": "1",
"hosId": "h0347",
"ybFlag": "0",
"address": "东土城路院区"
}
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
...
...
@@ -101,3 +118,11 @@ checkDict1: {
"nation": null
}
}
checkDict: {"code": 0,'msg': None,'data':1}
checkDict1: {"code": 400,'msg': '供销关系已存在!请勿重复添加','data':None}
checkDict2: {"code": 400,'msg': None,'data':None}
checkDict3: {'code': 400, 'msg': '数据更新不成功,可能数据的版本不一致!请刷新页面重试', 'data': None}
checkDict4: {'code': 0, 'msg': None, 'data': []}
report/summary.html
View file @
5c456ab7
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a
5_查询
院区/log.html'
target=
'_blank'
>
a
5_查询
院区
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a
7_启用
院区/log.html'
target=
'_blank'
>
a
7_启用
院区
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
0.7
26
</td>
<td
class=
"details-col-elapsed"
>
0.7
99
</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