Commit 27770b20 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

Signed-off-by: xiao-hesheng <xhs89@sina.com>

parent a6f0dc05
......@@ -32,7 +32,7 @@ username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token,projectCode = login_system(username, password).get_token()
token,projectCode,uxid = login_system(username, password).get_token()
#获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
......
# -*- encoding=utf8 -*-
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,注册医院审核通过,用例集id2249,sit,on,20230907
主数据平台:注册医院审核通过
"""
from common.common_func import commonFuc
module = "mdm3-hs"
# 注册医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "insertHosRegistInfo_url")
# #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers",
commonFuc().get_business_data(module, "json_contentType"))
print(headers)
h_name = commonFuc().get_business_data(module, "name1") # 获取前缀name
h_name = h_name + commonFuc().randomString(5) # 随机数生成拼接医院名称
request_body = commonFuc().get_business_data(module, "payload", h_name, h_name, h_name, h_name, h_name, h_name, h_name,
h_name)
print(request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print(result)
# 医院审核接口_查询数据_开始
# 登录
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid = login_system(username, password).get_token()
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryListPage_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload2", h_name)
# 发送请求
result1 = commonFuc().http_post(url, request_body, headers)
# 获取接口返回数据
id1 = commonFuc().analysis_json('id', result1)
# print('id1',id1)
code = commonFuc().analysis_json('code', result1)
# print('code',code)
# 断言实际结果中是否包含预期结果的内容
# commonFuc().check_result(code, result)
# 断言实际结果中是否包含预期的文本
commonFuc().check_text_exist(code, result1)
# ===============医院注册提交接口_查询数据_结束
# 锁定医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url")
# #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers",
commonFuc().get_business_data(module, "json_contentType"))
# 调用函数获取时间
now = timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload3", id1, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('abc',result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict")
# print(check_dict)
# #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# #=============== 锁定结束
#
# #医院注册_审核通过_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "checkHosRegistInfo_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload4", id1, now, now, h_name, uxid, h_name, h_name, h_name,
h_name, h_name, h_name, h_name, now, now, uxid)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# #获取接口返回数据
# code = commonFuc().analysis_json('code', result)
check_dict2 = commonFuc().get_business_data(module, "checkDict2")
#
# #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict2, result)
# #===============医院注册提交接口_审核通过_结束
# -*- encoding=utf8 -*-
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,注册医院审核驳回,用例集id2249,sit,on,202309072
主数据平台:注册医院审核驳回
"""
from common.common_func import commonFuc
module = "mdm3-hs"
# 注册医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "insertHosRegistInfo_url")
# #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers",
commonFuc().get_business_data(module, "json_contentType"))
print(headers)
h_name = commonFuc().get_business_data(module, "name1") # 获取前缀name
h_name = h_name + commonFuc().randomString(5) # 随机数生成拼接医院名称
request_body = commonFuc().get_business_data(module, "payload", h_name, h_name, h_name, h_name, h_name, h_name, h_name,
h_name)
print(request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print(result)
# 医院审核接口_查询数据_开始
# 登录
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid = login_system(username, password).get_token()
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "queryListPage_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload2", h_name)
# print('aaaaaaaaaaaa',request_body)
# 发送请求
result1 = commonFuc().http_post(url, request_body, headers)
# print('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',result1)
# 获取接口返回数据
id1 = commonFuc().analysis_json('id', result1)
# print('id1',id1)
code = commonFuc().analysis_json('code', result1)
# print('code',code)
# 断言实际结果中是否包含预期结果的内容
# commonFuc().check_result(code, result)
# 断言实际结果中是否包含预期的文本
commonFuc().check_text_exist(code, result1)
# ===============医院注册提交接口_查询数据_结束
# 锁定医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url")
# #获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers",
commonFuc().get_business_data(module, "json_contentType"))
# 调用函数获取时间
now = timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload3", id1, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('abc',result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict")
# print(check_dict)
# #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# #=============== 锁定结束
#
# #医院注册_审核驳回_开始
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload5", id1, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',result)
# #获取接口返回数据
# code = commonFuc().analysis_json('code', result)
checkDict = commonFuc().get_business_data(module, "checkDict")
#
# #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(checkDict, result)
# #===============医院注册提交接口_审核通过_结束
......@@ -20,13 +20,13 @@ class login_system():
# 获取验证码接口
def get_token(self):
url = commonFuc().get_api_url() + commonFuc().get_business_data(self.module, "VerifyCode_url")
print("aaaaaaaaaaaaaaaaaa" + url)
# print("aaaaaaaaaaaaaaaaaa" + url)
# 发送请求
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,39 +34,39 @@ 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)
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)
# 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
return token,projectCode,uxid
# login_system('test001', 'a123456!').get_token()
......
from common.db.db import dbOP
import datetime
# 数据读入和写入文件
class timeUtils(object):
def get_time_hms(self):
'''2023-05-06 09:39:30'''
import time
t = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
return t
\ No newline at end of file
"insertHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/insertHosRegistInfo"
# 医院注册提交接口_认领
"queryListPage_url": "/test2api/mdmService/companyRegistBill/listPage"
"updateById_url": "/test2api/mdmService/companyRegistBill/updateById"
"checkHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/checkHosRegistInfo"
"username": "1679886114521"
"password": "a123456!"
json_contentType: "application/json"
json_headers: {
"Content-Type": "%s"
}
json_headers2: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s"
}
"payload": {
"hosProperty": "1",
"cname": "%s附属医院",
"shortName": "%s附属医院",
"cname": "%s",
"shortName": "%s",
"hosLevel": "三级甲等",
"area": "湖南省长沙市下陆区",
"code": "420101",
......@@ -35,8 +43,8 @@ json_headers: {
}
"payload1": {
"hosProperty": "私立医院",
"cname": "%s附属医院",
"shortName": "%s附属医院",
"cname": "%s",
"shortName": "%s",
"hosLevel": "三级甲等",
"area": "湖南省长沙市下陆区",
"code": "420101",
......@@ -58,6 +66,73 @@ json_headers: {
"createUser": "%s",
"hoslevelName": ""
}
"payload2": {
"pageNum": 1,
"pageSize": 100,
"queryObject": {
"compFunction": 1,
"auditStatus": 10,
"cname": "%s"
}
}
"payload3": {
"id": "%s",
"isLocked": 1,
"auditor": "%s",
"auditStartTime": "%s"
}
"payload4": {
"id": "%s",
"lastModified": "%s",
"version": 1,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"userLoginCode": "%s",
"userLoginPsw": "a123456!",
"userName": "%s",
"cname": "%s",
"shortName": "%s",
"upCompanyId": null,
"compKind": 2,
"compFunction": "1",
"area": "湖南省长沙市市辖区",
"legal": null,
"address": "湖南省人民医院附属医院",
"isAbroad": 0,
"nation": null,
"registContactUser": "%s",
"registContactWay": "%s",
"email": "%s@sina.com",
"hosProperty": "1",
"hosLevel": "三级甲等",
"erpCode": null,
"regCode": null,
"jyxkCode": null,
"jyxkbaCode": null,
"scxkzCode": null,
"scbapzCode": null,
"isLocked": 1,
"auditStatus": 30,
"auditStartTime": "%s",
"auditEndTime": "%s",
"auditor": "%s",
"auditComment": "test",
"registSourceProject": "0000",
"dataEntrance": "注册",
"createUserCorpId": null
}
"payload5": {
"id": "%s",
"auditStatus": 30,
"auditComment": "驳回",
"auditor": "%s",
"auditEndTime": "%s"
}
"name1": "湖南省人民医院"
checkDict: {"code": 0,'msg': None,'data':1}
\ No newline at end of file
checkDict: {"code": 0,'msg': None,'data':1}
checkDict1: {"code": -2,"msg": "医院已被注册,请耐心等待审核通知!", "data": None}
checkDict2: {'code': 0, 'msg': None, 'data': 'success'}
\ No newline at end of file
1691384174643 geckodriver INFO Listening on 127.0.0.1:60395
1691384177063 mozrunner::runner INFO Running command: "D:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\rust_mozprofilekzunjD"
console.warn: services.settings: Ignoring preference override of remote settings server
console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
1691384177326 Marionette INFO Marionette enabled
Dynamically enable window occlusion 0
console.error: "Warning: unrecognized command line flag" "-foreground"
1691384177391 Marionette INFO Listening on port 60405
1691384177764 RemoteAgent WARN TLS certificate errors will be ignored for this session
[GFX1-]: Failed to create a D3D11 content device: 0x887a0031
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
1691384189508 Marionette INFO Stopped listening on port 60405
Dynamically enable window occlusion 1
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
JavaScript error: chrome://remote/content/marionette/cert.sys.mjs, line 51: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICertOverrideService.setDisableAllSecurityChecksAndLetAttackersInterceptMyData]
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
[Parent 13764, IPC I/O Parent] WARNING: DuplicateHandle failed for handle 0 in TransferHandles: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:621
[GPU 15232, IPC I/O Child] WARNING: pipe error: 232: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_win.cc:443
......@@ -54,8 +54,8 @@
</tr>
<tr width="600">
<td class='details-col-elapsed'>2</td>
<td class='details-col-elapsed'>2</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分0秒</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
......@@ -72,16 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/医院注册_正常注册_公立医院/log.html' target='_blank'>医院注册_正常注册_公立医院</a></td>
<td class="details-col-elapsed"><a href='../log/注册医院审核驳回/log.html' target='_blank'>注册医院审核驳回</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.233</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/医院注册_正常注册_私立医院/log.html' target='_blank'>医院注册_正常注册_私立医院</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.113</td>
<td class="details-col-elapsed">0.88</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