Commit 6c8a653f authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增采购计划模块脚本

parent eeaca1ac
......@@ -2,6 +2,7 @@
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
import time
__author__ = "xiaohesheng"
"""
......@@ -12,9 +13,11 @@ case_tag:api,mdm-web,a1订单配送列表数据查询_待确认查询3.0医院,i
from common.common_func import commonFuc
from airtest.core.api import using
import sys
module = "a6_mdm3_dp"
def select1():
def select1():
execute_command("python runner.py tag id2297-10,id2263-80 debug sit")
execute_command("python runner.py tag id2297-10,id2263-80 debug sit")
execute_command("python runner.py tag id2297-10,id2263-80 debug sit")
......@@ -38,7 +41,7 @@ def select1():
输出:"rtn_msg": 0
"""
module = "a6_mdm3_dp"
#a1订单配送列表数据查询_全部
# a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
......@@ -50,30 +53,31 @@ def select1():
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
#断言
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
total=commonFuc().analysis_json('total',data)
while True:
if total>=3:
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if total >= 3:
break
else:
time.sleep(6)
data1 = commonFuc().analysis_json('data', data)
if code==0 and total>=1:
id1=commonFuc().analysis_json('id',data1[0])
if code == 0 and total >= 1:
id1 = commonFuc().analysis_json('id', data1[0])
print(id1)
global_var_cname = id1
id2=commonFuc().analysis_json('id',data1[1])
id2 = commonFuc().analysis_json('id', data1[1])
print(id2)
global_var_cname = id2
commonFuc().check_text_exist(code,result)
return id1,id2
commonFuc().check_text_exist(code, result)
return id1, id2
else:
commonFuc().check_text_exist('error', result)
select1()
select1()
......@@ -28,4 +28,4 @@ def execute_command(command):
# command="python runner.py tag id2297-10 debug sit"
# print(command)
os.system(command)
execute_command("python runner.py tag id2297-10,id2263-80 debug sit")
# execute_command("python runner.py tag id2297-10,id2263-80 debug sit")
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1分10</td>
<td class='details-col-elapsed'>1分14</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -74,7 +74,7 @@
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a1订单配送列表数据查询_待确认查询3医院/log.html' target='_blank'>a1订单配送列表数据查询_待确认查询3医院</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">70.779</td>
<td class="details-col-elapsed">74.843</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