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
4f107907
Commit
4f107907
authored
Oct 10, 2023
by
xiao-hesheng
Browse files
新增内网登录类,登录函数
医院信息登记 医院信息编辑 院区管理
parent
5fc7698b
Changes
10
Hide whitespace changes
Inline
Side-by-side
air_case/a1_herp3_login/登录内网系统.air/登录内网系统.py
0 → 100644
View file @
4f107907
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:herp-web1,20231010
内网登录接口:第一步获取验证码,第二步登录系统,第三步平台登录验证token
"""
from
common.common_func
import
commonFuc
from
common.tokenUtils
import
*
class
login_system
():
module
=
"a1_herp3_login"
def
__init__
(
self
,
username
,
password
):
self
.
username
=
username
self
.
password
=
password
# 获取验证码接口
def
get_token
(
self
):
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"VerifyCode_url"
)
print
(
"aaaaaaaaaaaaaaaaaa"
+
url
)
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
headers
=
""
,
params
=
""
)
# print(result)
uuid
=
commonFuc
().
analysis_json
(
'uuId'
,
result
)
# print(uuid)
# 如果不传参数就使用默认数据登录
# username = commonFuc().get_business_data(self.module, "username")
# password = commonFuc().get_business_data(self.module, "password")
# print(username,password)
username
=
self
.
username
password
=
self
.
password
EncryptPassword
=
TokenUtils
(
username
,
password
,
uuid
).
get_PasswordEncrypt
()
# print('加密后的密码', EncryptPassword) # 加密后的密码
login_url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"login_url"
)
request_body
=
commonFuc
().
get_business_data
(
self
.
module
,
"payload"
,
username
,
EncryptPassword
,
uuid
)
# print(request_body)
# #获取请求头信息
headers
=
commonFuc
().
get_business_data
(
self
.
module
,
"json_headers"
,
commonFuc
().
get_business_data
(
self
.
module
,
"json_contentType"
))
# print(headers)
# 发送登录请求
result
=
commonFuc
().
http_post
(
login_url
,
request_body
,
headers
)
token
=
commonFuc
().
analysis_json
(
'token'
,
result
)
uxid
=
commonFuc
().
analysis_json
(
'uxid'
,
result
)
projectCode
=
commonFuc
().
analysis_json
(
'projectCode'
,
result
)
# print(token, uxid)
# 平台登录,请求头里面有token
headers
=
commonFuc
().
get_business_data
(
self
.
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
self
.
module
,
"json_contentType"
),
token
,
projectCode
)
# print('平台登录请求头', headers)
platform_login_url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"platform_login_url"
)
request_body
=
commonFuc
().
get_business_data
(
self
.
module
,
"payload2"
,
token
,
uxid
,
projectCode
)
# print(request_body)
# 发送平台登录请求
result
=
commonFuc
().
http_post
(
platform_login_url
,
request_body
,
headers
)
print
(
'平台登录接口结果'
,
result
)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
self
.
module
,
"checkDict"
)
# print(check_dict)
# 断言实际结果中是否不包含预期的文本
commonFuc
().
check_text_exist
(
uxid
,
result
)
corpId
=
commonFuc
().
analysis_json
(
'corpId'
,
result
)
info
=
(
token
,
projectCode
,
uxid
,
corpId
)
return
token
,
projectCode
,
uxid
,
corpId
,
info
login_system
(
'xhs1009'
,
'1qaz!QAZ'
).
get_token
()
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
air_case/a1_herp3_login/登录内网系统/登录内网系统.py
0 → 100644
View file @
4f107907
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:herp-web1,20231010
内网登录接口:第一步获取验证码,第二步登录系统,第三步平台登录验证token
"""
from
common.common_func
import
commonFuc
from
common.tokenUtils
import
*
class
login_system
():
module
=
"a1_herp3_login"
def
__init__
(
self
,
username
,
password
):
self
.
username
=
username
self
.
password
=
password
# 获取验证码接口
def
get_token
(
self
):
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"VerifyCode_url"
)
# print("aaaaaaaaaaaaaaaaaa" + url)
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
headers
=
""
,
params
=
""
)
# print(result)
uuid
=
commonFuc
().
analysis_json
(
'uuId'
,
result
)
# print(uuid)
# 如果不传参数就使用默认数据登录
# username = commonFuc().get_business_data(self.module, "username")
# password = commonFuc().get_business_data(self.module, "password")
# print(username,password)
username
=
self
.
username
password
=
self
.
password
EncryptPassword
=
TokenUtils
(
username
,
password
,
uuid
).
get_PasswordEncrypt
()
# print('加密后的密码', EncryptPassword) # 加密后的密码
login_url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"login_url"
)
request_body
=
commonFuc
().
get_business_data
(
self
.
module
,
"payload"
,
username
,
EncryptPassword
,
uuid
)
# print(request_body)
# #获取请求头信息
headers
=
commonFuc
().
get_business_data
(
self
.
module
,
"json_headers"
,
commonFuc
().
get_business_data
(
self
.
module
,
"json_contentType"
))
# print(headers)
# 发送登录请求
result
=
commonFuc
().
http_post
(
login_url
,
request_body
,
headers
)
token
=
commonFuc
().
analysis_json
(
'token'
,
result
)
uxid
=
commonFuc
().
analysis_json
(
'uxid'
,
result
)
projectCode
=
commonFuc
().
analysis_json
(
'projectCode'
,
result
)
# print(token, uxid)
# 平台登录,请求头里面有token
headers
=
commonFuc
().
get_business_data
(
self
.
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
self
.
module
,
"json_contentType"
),
token
,
projectCode
)
# print('平台登录请求头', headers)
platform_login_url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
self
.
module
,
"platform_login_url"
)
request_body
=
commonFuc
().
get_business_data
(
self
.
module
,
"payload2"
,
token
,
uxid
,
projectCode
)
# print(request_body)
# 发送平台登录请求
result
=
commonFuc
().
http_post
(
platform_login_url
,
request_body
,
headers
)
print
(
'平台登录接口结果'
,
result
)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
self
.
module
,
"checkDict"
)
# print(check_dict)
# 断言实际结果中是否不包含预期的文本
commonFuc
().
check_text_exist
(
uxid
,
result
)
corpId
=
commonFuc
().
analysis_json
(
'corpId'
,
result
)
info
=
(
token
,
projectCode
,
uxid
,
corpId
)
return
token
,
projectCode
,
uxid
,
corpId
,
info
login_system
(
'test001'
,
'1qaz!QAZ'
).
get_token
()
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
air_case/a2_herp3_bs/a1_医院信息登记.air/a1_医院信息登记.py
0 → 100644
View file @
4f107907
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a1_医院信息登记,id2263,id2263-1,sit,on
主数据平台:a1_医院信息登记
"""
from
common.common_func
import
commonFuc
from
air_case.a1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
def
h_Register
():
module
=
"a2_herp3_bs"
"""
场景:a1_医院信息登记
用例名称:a1_医院信息登记
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
#内网登录
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
,
"9ea057742d4a406a9220b7113f81f61a_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"
))
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
headers
,
params
=
""
)
# print('result', result)
#断言
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict'
)
commonFuc
().
check_result
(
checkDict
,
result
)
h_Register
()
\ No newline at end of file
air_case/a2_herp3_bs/a2_编辑医院信息.air/a2_编辑医院信息.py
0 → 100644
View file @
4f107907
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a2_编辑医院信息,id2263,id2263-2,sit,on
主数据平台:a2_编辑医院信息
"""
from
common.common_func
import
commonFuc
from
air_case.a1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
def
h_edit_info
():
module
=
"a2_herp3_bs"
"""
场景:a2_编辑医院信息
用例名称:a2_编辑医院信息
输入:无
输出:"rtn_msg": 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
,
"edit_h_info_url"
)
url
=
url
+
corpId
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"
))
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
headers
,
params
=
""
)
# print('result', result)
#断言
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict1'
)
commonFuc
().
check_result
(
checkDict
,
result
)
h_edit_info
()
\ No newline at end of file
air_case/a2_herp3_bs/a3院区管理页面.air/a3院区管理页面.py
0 → 100644
View file @
4f107907
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,a3院区管理页面,id2263,id2263-3,sit,on
主数据平台:a3院区管理页面
"""
from
common.common_func
import
commonFuc
from
air_case.a1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
def
hospital_area
():
module
=
"a2_herp3_bs"
"""
场景:a3院区管理页面
用例名称:a3院区管理页面
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
#内网登录
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
,
"5ce279bb138a4261828289ae834ed53a_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"
))
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
headers
,
params
=
""
)
# print('result', result)
#断言
checkDict
=
commonFuc
().
get_business_data
(
module
,
'checkDict'
)
commonFuc
().
check_result
(
checkDict
,
result
)
hospital_area
()
\ No newline at end of file
air_case/mdm_login/登录外网系统.air/登录外网系统.py
View file @
4f107907
...
@@ -71,7 +71,7 @@ class login_system():
...
@@ -71,7 +71,7 @@ class login_system():
return
token
,
projectCode
,
uxid
,
corpId
,
info
return
token
,
projectCode
,
uxid
,
corpId
,
info
# print(
login_system('test001', '1qaz!QAZ').get_token()
)
login_system
(
'test001'
,
'1qaz!QAZ'
).
get_token
()
# if __name__ == '__main__':
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
#1679886114521 a123456!
data/a1_herp3_login/data
0 → 100644
View file @
4f107907
# 登录内网herp系统
"VerifyCode_url": "/hospitaltest2api/oauthService/auth/getVerifyCode"
"login_url": "/hospitaltest2api/oauthService/auth/login"
"platform_login_url": "/hospitaltest2api/platformService/userOnline/getUserOnlineLogin"
"username": "test001"
"password": "1qaz!QAZ"
json_contentType: "application/json"
json_headers: {
"Content-Type": "%s"
}
json_headers2: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s"
}
"payload": {
"username": "%s",
"passwd": "%s",
"verifyCodeId": "%s",
"verifyCode": "",
"projectCode": "hdi.pc"
}
"payload2": {
"sessionId": "%s",
"uxid": "%s",
"projectCode": "%s",
"traceId": null,
"jsHash": null
}
checkDict: {"code": 0,'msg': None}
login_data: {"orderCode": "10200512100243412"}
login_contentType: "application/json"
login_checkDict: {"rtn_code": "0000001"}
\ No newline at end of file
data/a2_herp3_bs/data
0 → 100644
View file @
4f107907
"9ea057742d4a406a9220b7113f81f61a_url": "/hospitaltest2api/platformService/sys/user/v2/permission/9ea057742d4a406a9220b7113f81f61a/"
"edit_h_info_url": "/hospitaltest2api/platformService/basic/company/detail/"
"5ce279bb138a4261828289ae834ed53a_url": "/hospitaltest2api/platformService/sys/user/v2/permission/5ce279bb138a4261828289ae834ed53a/"
"username": "xhs1009"
"password": "1qaz!QAZ"
"X-APP-CODE": "herp.pc"
json_contentType: "application/json"
json_headers: {
"Content-Type": "%s"
}
json_headers2: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s"
}
"payload": {
"username": "%s",
"passwd": "%s",
"verifyCodeId": "%s",
"verifyCode": "",
"projectCode": "hdi.pc"
}
"payload2": {
"sessionId": "%s",
"uxid": "%s",
"projectCode": "%s",
"traceId": null,
"jsHash": null
}
checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: {
"code": 0,
"msg": null,
"data": {
"id": "h0347",
"lastModified": null,
"version": null,
"createTime": null,
"createUser": null,
"lastModifiedUser": null,
"code": "h0347",
"cname": "邹城市人民医院(test)",
"anotherName": "ZCYY",
"regCode": null,
"kind": "1",
"legal": null,
"address": "千泉路59号",
"linkman": "李四",
"contactWay": "10000000000",
"contactFax": null,
"logo": "/sfile/2023/herp/邹城市人民医院_a22ff3016aba48018f2d4840f3d5f8b5.png",
"postCode": null,
"email": null,
"remark": null,
"erpCode": null,
"isSupply": null,
"isThreeInOne": null,
"masterCode": null,
"flag": null,
"province": null,
"city": null,
"area": null,
"areaCode": null,
"mfrsKind": null,
"uxid": null,
"fillDate": null,
"lastUpdateDatetime": null,
"ygcode": null,
"agentName": null,
"recordCard": null,
"jyxkCode": null,
"productCode": null,
"businessScope": null,
"newBusinessScope": null,
"twoBusinessScope": null,
"newTwoBusinessScope": null,
"threeBusinessScope": null,
"newThreeBusinessScope": null,
"auditRemark": null,
"changedRemark": null,
"status": null,
"shortPinyin": null,
"nation": null
}
}
data/mdm3_pim/message
View file @
4f107907
产品新增:
产品新增:
username: 国药集团公司
(LAep
username: 国药集团公司
o#RmO
goodsname: 一次性注射器
aLzgd
goodsname: 一次性注射器
y5%&J
report/summary.html
View file @
4f107907
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分
2
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
0
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</tr>
</table>
</table>
...
@@ -72,9 +72,9 @@
...
@@ -72,9 +72,9 @@
</tr>
</tr>
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
b19供货目录申请_客户类型_医院_提交供货申请单_搜索产品/log.html'
target=
'_blank'
>
b19供货目录申请_客户类型_医院_提交供货申请单_搜索产品
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/
a3院区管理页面/log.html'
target=
'_blank'
>
a3院区管理页面
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2.036
</td>
<td
class=
"details-col-elapsed"
>
0.778
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
</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