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

优化脚本

parent d3d0d1a7
...@@ -49,15 +49,15 @@ def test1(): ...@@ -49,15 +49,15 @@ def test1():
# from g8_6添加产品列表_查询 import select1 # from g8_6添加产品列表_查询 import select1
# hosGoodsId,provGoodsId = select1() # hosGoodsId,provGoodsId = select1()
#获取orderNo #获取orderNo
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air') # sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air') # using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
from g2_16调价管理列表_查询_暂存状态数据 import test1 # from g2_16调价管理列表_查询_暂存状态数据 import test1
GChid,orderNo = test1() # GChid,orderNo = test1()
#获取日期 #获取日期
# currentdate=dateUtils().get_current_date() # currentdate=dateUtils().get_current_date()
# print(currentdate) # print(currentdate)
#请求体 #请求体
request_body = commonFuc().get_business_data(module, "payload50_6",orderNo) request_body = commonFuc().get_business_data(module, "payload50_6")
print(request_body) print(request_body)
# # # 发送请求 # # # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
...@@ -67,11 +67,14 @@ def test1(): ...@@ -67,11 +67,14 @@ def test1():
# commonFuc().check_result(checkDict,result) # commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result) code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result) data=commonFuc().analysis_json('data',result)
checkDict=commonFuc().get_business_data(module,'checkDict10') total=commonFuc().analysis_json('total',result)
if code>=0 : data1=commonFuc().analysis_json('data',data)
if code>=0 and total>=0:
print(code) print(code)
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
commonFuc().check_result(checkDict,result) taskId= commonFuc().analysis_json('taskId', data1[0])
print(taskId)
return taskId
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
test1() test1()
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.dateUtils import dateUtils
from common.db.sql.sql_del_branch_info import delByBranchId
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,g2_19审批中心_审核通过,id2263,id2263-80,sit,on
内网:g2_19审批中心_审核通过
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:g2_19审批中心_审核通过
用例名称:g2_19审批中心_审核通过
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
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)
#g2_19审批中心_审核通过
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "approvalBatch_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"))
# # # 获取instId
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_18审批中心_列表查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_18审批中心_列表查询.air')
from g2_18审批中心_列表查询 import test1
taskId = test1()
#获取日期
# currentdate=dateUtils().get_current_date()
# print(currentdate)
#请求体
request_body = commonFuc().get_business_data(module, "payload50_7",taskId)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
total=commonFuc().analysis_json('total',result)
if code>=0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"queryInSettlementStockQty_url": "/hospitaltest2api/herpService/goodsChgSub/queryInSettlementStockQty" "queryInSettlementStockQty_url": "/hospitaltest2api/herpService/goodsChgSub/queryInSettlementStockQty"
"goodsChgMain_insert_url": "/hospitaltest2api/herpService/goodsChgMain/insert" "goodsChgMain_insert_url": "/hospitaltest2api/herpService/goodsChgMain/insert"
"apprCenter_url": "/hospitaltest2api/herpService/apprCenter/waitPage" "apprCenter_url": "/hospitaltest2api/herpService/apprCenter/waitPage"
"approvalBatch_url": "/hospitaltest2api/herpService/apprCenter/approvalBatch"
"username": "xhs1009" "username": "xhs1009"
"password": "1qaz!QAZ" "password": "1qaz!QAZ"
...@@ -242,7 +242,8 @@ json_headers2: { ...@@ -242,7 +242,8 @@ json_headers2: {
"payload50_3": {"attachments":[{"fileName":"","filePath":""}],"changeDetails":[{"hosGoodsId":"%s","newValue":2659,"oldValue":2658,"supplyProvId":"%s"}],"chgType":"GOODS_COLLECT_CHANGE_PRICE","provId":"p10d95","subProvId":"p10d95","hosId":"h0347","planEffectiveDate":"%s 00:00:00","remark":"","id":"","submit":false} "payload50_3": {"attachments":[{"fileName":"","filePath":""}],"changeDetails":[{"hosGoodsId":"%s","newValue":2659,"oldValue":2658,"supplyProvId":"%s"}],"chgType":"GOODS_COLLECT_CHANGE_PRICE","provId":"p10d95","subProvId":"p10d95","hosId":"h0347","planEffectiveDate":"%s 00:00:00","remark":"","id":"","submit":false}
"payload50_4": {"pageNum":1,"pageSize":50,"orderBy":"mgcm.create_time desc","queryObject":{"startDate":null,"endDate":null,"goodsName":"","hosId":"h0347", "tbStatus":"0"}} "payload50_4": {"pageNum":1,"pageSize":50,"orderBy":"mgcm.create_time desc","queryObject":{"startDate":null,"endDate":null,"goodsName":"","hosId":"h0347", "tbStatus":"0"}}
"payload50_5": {"attachments":[{"fileName": "","filePath": ""}],"changeDetails": [{"hosGoodsId": "%s","newValue": 2659,"oldValue": 2658,"supplyProvId": "%s"}],"chgType": "GOODS_COLLECT_CHANGE_PRICE","provId": "p10d95","subProvId":"p10d95","hosId": "h0347","planEffectiveDate": "%s 00:00:00","remark": "","id": "%s","submit": true} "payload50_5": {"attachments":[{"fileName": "","filePath": ""}],"changeDetails": [{"hosGoodsId": "%s","newValue": 2659,"oldValue": 2658,"supplyProvId": "%s"}],"chgType": "GOODS_COLLECT_CHANGE_PRICE","provId": "p10d95","subProvId":"p10d95","hosId": "h0347","planEffectiveDate": "%s 00:00:00","remark": "","id": "%s","submit": true}
"payload50_6": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"%s","createOrderTimeStart":"","createOrderTimeEnd":""}} "payload50_6": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","createOrderTimeStart":"","createOrderTimeEnd":""}}
"payload50_7": {"dtos":[{"remark":"22","taskId":"%s"}],"opinion":1}
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'>0</td> <td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分1</td> <td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">0.0%</td> <td class="details-col-elapsed">0.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/g2_18审批中心_列表查询/log.html' target='_blank'>g2_18审批中心_列表查询</a></td> <td class="details-col-elapsed"><a href='../log/g2_19审批中心_审核通过/log.html' target='_blank'>g2_19审批中心_审核通过</a></td>
<td class="fail">失败</td> <td class="fail">失败</td>
<td class="details-col-elapsed">1.431</td> <td class="details-col-elapsed">2.439</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