Commit ebeb3504 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

脚本调整

parent 0464436d
......@@ -29,7 +29,7 @@ def h_login():
username = h_name
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password)
print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
return token,projectCode,uxid,corpId,h_name
......
......@@ -2,7 +2,7 @@
__author__ = "xiaohesheng"
"""
case_tag:mdm-web,10086登录
case_tag:mdm-web1,10086登录,用例集id2226
主数据平台:统一登录接口,第一步获取验证码,第二步登录系统,第三步平台登录验证token
"""
......@@ -24,9 +24,9 @@ class login_system():
# 发送请求
result = commonFuc().http_get(url, headers="", params="")
print(result)
# print(result)
uuid = commonFuc().analysis_json('uuId', result)
print(uuid)
# print(uuid)
# 如果不传参数就使用默认数据登录
# username = commonFuc().get_business_data(self.module, "username")
# password = commonFuc().get_business_data(self.module, "password")
......@@ -34,42 +34,44 @@ class login_system():
username = self.username
password = self.password
EncryptPassword = TokenUtils(username, password, uuid).get_PasswordEncrypt()
print('加密后的密码', EncryptPassword) # 加密后的密码
# 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)
# print(request_body)
# #获取请求头信息
headers = commonFuc().get_business_data(self.module, "json_headers",
commonFuc().get_business_data(self.module, "json_contentType"))
print(headers)
# print(headers)
# 发送登录请求
result = commonFuc().http_post(login_url, request_body, headers)
print('登录结果',result)
token = commonFuc().analysis_json('token', result)
uxid = commonFuc().analysis_json('uxid', result)
projectCode = commonFuc().analysis_json('projectCode', result)
print(token, uxid)
# 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)
# 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)
# 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)
# print(check_dict)
# 断言实际结果中是否不包含预期的文本
commonFuc().check_text_exist(uxid, result)
return token,projectCode
corpId=commonFuc().analysis_json('corpId', result)
info=(token,projectCode,uxid,corpId)
return token,projectCode,uxid,corpId,info
# login_system('1679886114521', 'a123456!').get_token()
# print(login_system('test001', '1qaz!QAZ').get_token())
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
......@@ -59,7 +59,7 @@ class login_system():
# print(request_body)
# 发送平台登录请求
result = commonFuc().http_post(platform_login_url, request_body, headers)
# print('平台登录接口结果', result)
print('平台登录接口结果', result)
# 获取预期结果
check_dict = commonFuc().get_business_data(self.module, "checkDict")
......@@ -71,7 +71,7 @@ class login_system():
return token,projectCode,uxid,corpId,info
print(login_system('1679886114521', 'a123456!').get_token())
print(login_system('test001', '1qaz!QAZ').get_token())
# if __name__ == '__main__':
# print(login_system('test001','1qaz!QAZ').get_token())
#1679886114521 a123456!
"username": "test001"
"password": "1qaz!QAZ"
"password": "a123456!"
"submitSupplyRelation_url": "/test2api/mdmService/supplyRelation/submitSupplyRelation/"
"listVoPage_url": "/test2api/mdmService/supplyRelation/listVoPage/"
......
......@@ -55,9 +55,9 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分0</td>
<td class="details-col-elapsed">0.0%</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/登录外网系统/log.html' target='_blank'>登录外网系统</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">0.579</td>
<td class="details-col-elapsed"><a href='../log/a1供货关系申请_客户类型_医院_登录_医院登录获取医院id/log.html' target='_blank'>a1供货关系申请_客户类型_医院_登录_医院登录获取医院id</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.695</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment