diff --git "a/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" "b/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" new file mode 100644 index 0000000000000000000000000000000000000000..f09510eed65838db205db373a775d65d5ed3824a --- /dev/null +++ "b/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" @@ -0,0 +1,77 @@ +# -*- 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! diff --git "a/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" "b/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" new file mode 100644 index 0000000000000000000000000000000000000000..1b93649c8c73d94e464651a1a3aa16d33210868f --- /dev/null +++ "b/air_case/a1_herp3_login/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237/\347\231\273\345\275\225\345\206\205\347\275\221\347\263\273\347\273\237.py" @@ -0,0 +1,77 @@ +# -*- 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! diff --git "a/air_case/a2_herp3_bs/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.air/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.py" "b/air_case/a2_herp3_bs/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.air/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.py" new file mode 100644 index 0000000000000000000000000000000000000000..e4fda108cd726570c3b3ca1fd56d6f95d7b74ffb --- /dev/null +++ "b/air_case/a2_herp3_bs/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.air/a1_\345\214\273\351\231\242\344\277\241\346\201\257\347\231\273\350\256\260.py" @@ -0,0 +1,44 @@ +# -*- 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 diff --git "a/air_case/a2_herp3_bs/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.air/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.py" "b/air_case/a2_herp3_bs/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.air/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.py" new file mode 100644 index 0000000000000000000000000000000000000000..f68d7037a7743bf2117b4bc5350b470a7d3dd9bd --- /dev/null +++ "b/air_case/a2_herp3_bs/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.air/a2_\347\274\226\350\276\221\345\214\273\351\231\242\344\277\241\346\201\257.py" @@ -0,0 +1,46 @@ +# -*- 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 diff --git "a/air_case/a2_herp3_bs/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.air/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.py" "b/air_case/a2_herp3_bs/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.air/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.py" new file mode 100644 index 0000000000000000000000000000000000000000..777b943dc58717860bfa1a9c7ecc45b3f6d82648 --- /dev/null +++ "b/air_case/a2_herp3_bs/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.air/a3\351\231\242\345\214\272\347\256\241\347\220\206\351\241\265\351\235\242.py" @@ -0,0 +1,44 @@ +# -*- 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 diff --git "a/air_case/mdm_login/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.py" "b/air_case/mdm_login/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.py" index 8bf846527923e648785e701fe5e13002ed9150f5..19f9dc42d1dea6b7842891e2852fe899eb1777ff 100644 --- "a/air_case/mdm_login/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.py" +++ "b/air_case/mdm_login/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.air/\347\231\273\345\275\225\345\244\226\347\275\221\347\263\273\347\273\237.py" @@ -71,7 +71,7 @@ class login_system(): return token,projectCode,uxid,corpId,info -# print(login_system('test001', '1qaz!QAZ').get_token()) +login_system('test001', '1qaz!QAZ').get_token() # if __name__ == '__main__': # print(login_system('test001','1qaz!QAZ').get_token()) #1679886114521 a123456! diff --git a/data/a1_herp3_login/data b/data/a1_herp3_login/data new file mode 100644 index 0000000000000000000000000000000000000000..2cdaed2336146220c7697e440e5af83a18d8d469 --- /dev/null +++ b/data/a1_herp3_login/data @@ -0,0 +1,35 @@ +# 登录内网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 diff --git a/data/a2_herp3_bs/data b/data/a2_herp3_bs/data new file mode 100644 index 0000000000000000000000000000000000000000..b030c1a0ba012ab879274241e7ea50facf88bd66 --- /dev/null +++ b/data/a2_herp3_bs/data @@ -0,0 +1,89 @@ + +"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 + } +} diff --git a/data/mdm3_pim/message b/data/mdm3_pim/message index 527c94294f012f15a5ee5c8de64bda022b5757d9..d5247b034f5671742d6ad3f8d447ded2e2fcb8be 100644 --- a/data/mdm3_pim/message +++ b/data/mdm3_pim/message @@ -1,3 +1,3 @@ 产品新增: - username: 国药集团公司(LAep - goodsname: 一次性注射器aLzgd + username: 国药集团公司o#RmO + goodsname: 一次性注射器y5%&J diff --git a/report/summary.html b/report/summary.html index f4e6167080840617f82711d732091db6e416c043..724410321fc77f2b68d0cbd6c4fb13092b8af913 100644 --- a/report/summary.html +++ b/report/summary.html @@ -56,7 +56,7 @@ 1 1 - 0分2秒 + 0分0秒 100.0% @@ -72,9 +72,9 @@ - b19供货目录申请_客户类型_医院_提交供货申请单_搜索产品 + a3院区管理页面 成功 - 2.036 + 0.778 xiaohesheng