Commit 400da0cd authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增自动请领排程脚本

parent ff10571b
...@@ -12,8 +12,8 @@ from common.timeUtils import timeUtils ...@@ -12,8 +12,8 @@ from common.timeUtils import timeUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,herp-web,q9科室管理_自动请领排程_新增,id2263,id2263-203,sit,on case_tag:api,herp-web,r_a1科室管理_自动请领排程_新增_按周,id2263,id2263-203,sit,on
内网:q9科室管理_自动请领排程_新增 内网:r_a1科室管理_自动请领排程_新增_按周
""" """
from common.common_func import commonFuc from common.common_func import commonFuc
...@@ -22,8 +22,8 @@ module = "b2_herp3_bs" ...@@ -22,8 +22,8 @@ module = "b2_herp3_bs"
def test1(): def test1():
""" """
场景:q9科室管理_自动请领排程_新增 场景:r_a1科室管理_自动请领排程_新增_按周
用例名称:q9科室管理_自动请领排程_新增 用例名称:r_a1科室管理_自动请领排程_新增_按周
输入:"" 输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "data":[]} 输出:"rtn_msg": {"code": 0, "msg": null, "data":[]}
""" """
...@@ -36,7 +36,7 @@ def test1(): ...@@ -36,7 +36,7 @@ def test1():
token, projectCode, uxid, corpId, info = login_system(username, password).get_token() token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info) # print( token,projectCode,uxid,corpId,info)
# q9科室管理_自动请领排程_新增 # r_a1科室管理_自动请领排程_新增_按周
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_insert_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_insert_url")
# 获取请求头信息 # 获取请求头信息
......
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_a2科室管理_自动请领排程_列表查询_条件查询,id2263,id2263-204,sit,on
内网:r_a2科室管理_自动请领排程_列表查询_条件查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:r_a2科室管理_自动请领排程_列表查询_条件查询
用例名称:r_a2科室管理_自动请领排程_列表查询_条件查询
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "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)
# r_a2科室管理_自动请领排程_列表查询_条件查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_page_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"]
str = commonFuc().get_business_data(module, 'data12')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
for i in list2:
# 请求体
request_body = commonFuc().get_business_data(module, "payload60_3",i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
# print(len(data1))
if code == 0 and total >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,r_a3科室管理_自动请领排程_列表查询_条件查询_异常,id2263,id2263-205,sit,on
内网:r_a3科室管理_自动请领排程_列表查询_条件查询_异常
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:r_a3科室管理_自动请领排程_列表查询_条件查询_异常
用例名称:r_a3科室管理_自动请领排程_列表查询_条件查询_异常
输入:""
输出:"rtn_msg": {"code": 0, "msg": null, "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)
# r_a3科室管理_自动请领排程_列表查询_条件查询_异常
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "deptProcOrder_page_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"]
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
print(list2)
# #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_hms(2)
# dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"]
for i in list2:
# 请求体
request_body = commonFuc().get_business_data(module, "payload60_3",i)
# request_body='['+str(request_body)+']'
# new_request_body = request_body.replace("'", '"')
# print(new_request_body)
# import json
# request_body_json = json.loads(new_request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body,headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
# print(len(data1))
if code == 0 and total == 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -12,7 +12,7 @@ from common.timeUtils import timeUtils ...@@ -12,7 +12,7 @@ from common.timeUtils import timeUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,herp-web,新增库区,id2263,id2263-xxx,sit,on case_tag:api,herp-web999,新增库区,id22xx,id2263-xxx,sit,on
内网:新增库区 内网:新增库区
""" """
......
...@@ -96,6 +96,7 @@ data8: "眼科,眼,科,001,jyk,1,j,k" ...@@ -96,6 +96,7 @@ data8: "眼科,眼,科,001,jyk,1,j,k"
data9: "不存在的眼科,1眼,2科,111,jyk2" data9: "不存在的眼科,1眼,2科,111,jyk2"
data10: "00001977,手术衣,ssy" data10: "00001977,手术衣,ssy"
data11: "10,20,60" data11: "10,20,60"
data12: "002,006检验科1,0,1,006,检验科"
"username": "xhs1009" "username": "xhs1009"
"password": "1qaz!QAZ" "password": "1qaz!QAZ"
...@@ -425,7 +426,8 @@ json_headers2: { ...@@ -425,7 +426,8 @@ json_headers2: {
"payload60": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"ename":"","branchId":"h0347-2011","hosId":"h0347"}} "payload60": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"ename":"","branchId":"h0347-2011","hosId":"h0347"}}
"payload60_1": {"branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":1,"intervalType":"0","intervalNum":"1","intervalWeek":"","id":"","hosId":"h0347"} "payload60_1": {"branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":1,"intervalType":"0","intervalNum":"1","intervalWeek":"","id":"","hosId":"h0347"}
"payload60_2": {"branchId":"h0347-2011","deptId":"96c4d23bff8541599eb1a7f5f813e421","orderNum":1,"intervalType":"1","intervalNum":"1","intervalWeek":65,"id":"","hosId":"h0347"} "payload60_2": {"branchId":"h0347-2011","deptId":"b3753145b3ba4c7da96b5cdf6c3d436b","orderNum":1,"intervalType":"1","intervalNum":"1","intervalWeek":65,"id":"","hosId":"h0347"}
"payload60_3": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"ename":"%s","branchId":"h0347-2011","hosId":"h0347"}}
checkDict: {"code": 0,'msg': None,'data': True} checkDict: {"code": 0,'msg': None,'data': True}
checkDict1: { checkDict1: {
......
...@@ -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分1秒</td> <td class='details-col-elapsed'>0分51秒</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/r_a1科室管理_自动请领排程_新增_按周/log.html' target='_blank'>r_a1科室管理_自动请领排程_新增_按周</a></td> <td class="details-col-elapsed"><a href='../log/r_a3科室管理_自动请领排程_列表查询_条件查询_异常/log.html' target='_blank'>r_a3科室管理_自动请领排程_列表查询_条件查询_异常</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">1.606</td> <td class="details-col-elapsed">51.478</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </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