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

新增库区设置脚本

parent 2918b2ed
# -*- 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_d2库房管理_库区设置_人员管理_添加人员,id2263,id2263-235,sit,on
内网:r_d2库房管理_库区设置_人员管理_添加人员
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockAreaId='b72a363163ff4670b4fa0390de5adb8c'):
"""
场景:r_d2库房管理_库区设置_人员管理_添加人员
用例名称:r_d2库房管理_库区设置_人员管理_添加人员
输入:""
输出:"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_d2库房管理_库区设置_人员管理_添加人员
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_insert_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"))
# str = commonFuc().get_business_data(module, 'data3')
# list2 = list(str.split(","))
# print(list2)
# for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_9",dept_id,stockAreaId)
# request_body = commonFuc().get_business_data(module, "payload62_9")
request_body='['+str(request_body)+']'
new_request_body = request_body.replace("'", '"')
new_request_body = new_request_body.replace("None", 'null')
print('new_request_body',new_request_body)
import json
request_body_json=""
try:
request_body_json = json.loads(new_request_body)
except json.decoder.JSONDecodeError as e:
print("JSONDecodeError:", str(e))
# print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body_json, headers)
print('resultbbbbbbbbbbb', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
# print(type(data1))
# pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize, type(pageSize))
if code == 0 and data == 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_d3库房管理_库区设置_人员管理_移除人员,id2263,id2263-236,sit,on
内网:r_d3库房管理_库区设置_人员管理_移除人员
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockAreaId='b72a363163ff4670b4fa0390de5adb8c'):
"""
场景:r_d3库房管理_库区设置_人员管理_移除人员
用例名称:r_d3库房管理_库区设置_人员管理_移除人员
输入:""
输出:"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_d3库房管理_库区设置_人员管理_移除人员
# 查询人员id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_10", dept_id, stockAreaId)
# print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
userid = commonFuc().analysis_json('id', data1[0])
print(userid)
# pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize, type(pageSize))
#移除人员
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_updateById_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_11", userid)
# print('request_body',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)
if code == 0 and data == 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_d4库房管理_库区设置_货位管理_添加货位,id2263,id2263-237,sit,on
内网:r_d4库房管理_库区设置_货位管理_添加货位
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d4库房管理_库区设置_货位管理_添加货位
用例名称:r_d4库房管理_库区设置_货位管理_添加货位
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1)
shelfCode = commonFuc().analysis_json('shelfCode', data1)
createTime = commonFuc().analysis_json('createTime', data1)
stockId = commonFuc().analysis_json('stockId', data1)
shelfName = commonFuc().analysis_json('shelfName', data1)
address = commonFuc().analysis_json('address', data1)
recPhone = commonFuc().analysis_json('recPhone', data1)
lastModified = commonFuc().analysis_json('lastModified', data1)
shelfNo = commonFuc().analysis_json('shelfNo', data1)
print(id1, lastModified, shelfCode, createTime, stockId, shelfName, address, recPhone, shelfNo)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# r_d4库房管理_库区设置_货位管理_添加货位
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_insertShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_12", id1,shelfCode,stockId,id1)
print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
# pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize, type(pageSize))
if code == 0 and data == 4:
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_d5库房管理_库区设置_货位管理_添加货位_重复添加,id2263,id2263-238,sit,on
内网:r_d5库房管理_库区设置_货位管理_添加货位_重复添加
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d5库房管理_库区设置_货位管理_添加货位_重复添加
用例名称:r_d5库房管理_库区设置_货位管理_添加货位_重复添加
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1)
shelfCode = commonFuc().analysis_json('shelfCode', data1)
createTime = commonFuc().analysis_json('createTime', data1)
stockId = commonFuc().analysis_json('stockId', data1)
shelfName = commonFuc().analysis_json('shelfName', data1)
address = commonFuc().analysis_json('address', data1)
recPhone = commonFuc().analysis_json('recPhone', data1)
lastModified = commonFuc().analysis_json('lastModified', data1)
shelfNo = commonFuc().analysis_json('shelfNo', data1)
print(id1, lastModified, shelfCode, createTime, stockId, shelfName, address, recPhone, shelfNo)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# r_d4库房管理_库区设置_货位管理_添加货位
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockUser_insertShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_12", id1,shelfCode,stockId,id1)
print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
# pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize, type(pageSize))
if code == 1100000 and data == None:
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_d6库房管理_库区设置_货位管理_设为默认,id2263,id2263-239,sit,on
内网:r_d6库房管理_库区设置_货位管理_设为默认
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d6库房管理_库区设置_货位管理_设为默认
用例名称:r_d6库房管理_库区设置_货位管理_设为默认
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1) #
print(id1) #stockAreaId 库区id
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 获取货位id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_13", dept_id,id1)
print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id2 = commonFuc().analysis_json('id', data1[1]) #
parentId= commonFuc().analysis_json('parentId', data1[1])
# 货位id
print(id2,parentId)
#r_d5库房管理_库区设置_货位管理_编辑货位
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_updateById_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_15", id2,parentId)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result)
#断言
pageSize = commonFuc().analysis_json('pageSize', data)
print(pageSize, type(pageSize))
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
if code == 0 and data == 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_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询,id2263,id2263-240,sit,on
内网:r_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询
用例名称:r_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1) #
print(id1) #stockAreaId 库区id
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 获取货位id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_13", dept_id,id1)
print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id2 = commonFuc().analysis_json('id', data1[0]) #
parentId= commonFuc().analysis_json('parentId', data1[0])
shelfCode= commonFuc().analysis_json('shelfCode', data1[0])
# 货位id
print(id2,parentId,shelfCode,'ccccccccccccccccccccccccccccc')
#r_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_probeInfo_probe_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_16",shelfCode)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result)
#断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
probe_id=commonFuc().analysis_json('id', data1[0])
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
print(commonFuc().analysis_json('id', data1[0]))
# return probe_id
else:
commonFuc().check_text_exist('error', result)
#列表页面精确查询和模糊查询
# # 请求体精确查询
request_body = commonFuc().get_business_data(module, "payload62_17", probe_id,shelfCode)
result = commonFuc().http_post(url, request_body, headers)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#请求体,模糊查询
request_body = commonFuc().get_business_data(module, "payload62_17", '3',shelfCode)
result = commonFuc().http_post(url, request_body, headers)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#请求体异常查询
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
print(list2)
for i in list2:
request_body = commonFuc().get_business_data(module, "payload62_17", i, shelfCode)
result = commonFuc().http_post(url, request_body, headers)
print('dddddd',result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
if code == 0 and len(data1) == 0:
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_d5库房管理_库区设置_货位管理_编辑货位,id2263,id2263-241,sit,on
内网:r_d5库房管理_库区设置_货位管理_编辑货位
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d5库房管理_库区设置_货位管理_编辑货位
用例名称:r_d5库房管理_库区设置_货位管理_编辑货位
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1) #
print(id1) # stockAreaId 库区id
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 获取货位id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_13", dept_id, id1)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id2 = commonFuc().analysis_json('id', data1[0]) #
parentId = commonFuc().analysis_json('parentId', data1[0])
shelfCode = commonFuc().analysis_json('shelfCode', data1[0])
shelfNo= commonFuc().analysis_json('shelfNo', data1[0])
# 货位id
print(id2, parentId, shelfCode, shelfNo,'ccccccccccccccccccccccccccccc')
# r_d7库房管理_库区设置_货位管理_绑定探针_列表页面查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_probeInfo_probe_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_16", shelfCode)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
probeId = commonFuc().analysis_json('id', data1[0]) # 探针id
if code == 0 and len(data) >= 1:
commonFuc().check_text_exist(0, result)
print(commonFuc().analysis_json('id', data1[0]))
else:
commonFuc().check_text_exist('error', result)
#绑定探针
url2 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_probeInfo_shelf_save_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"))
# 请求体
request_body = commonFuc().get_business_data(module, "payload62_18", probeId,shelfCode,shelfNo)
request_body = '[' + str(request_body) + ']'
print('request_body', request_body)
new_request_body = request_body.replace("'", '"')
new_request_body = new_request_body.replace("None", 'null')
print('new_request_body', new_request_body)
import json
request_body_json = json.loads(new_request_body)
print('request_body_json', request_body_json)
# # # # 发送请求
result = commonFuc().http_post(url2, request_body_json, headers)
print('resultdddddddddddddddddddddddddd', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
if code == 0 and data== 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_d9库房管理_库区设置_货位管理_编辑货位,id2263,id2263-242,sit,on
内网:r_d9库房管理_库区设置_货位管理_编辑货位
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1(dept_id='d69a68df361a4289b2262e4ef75b55a5', stockId='c66b6ed38dbb4fbc8603dc00cdabb572'):
"""
场景:r_d8库房管理_库区设置_货位管理_编辑货位
用例名称:r_d8库房管理_库区设置_货位管理_编辑货位
输入:""
输出:"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)
# 获取库区id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
request_body = commonFuc().get_business_data(module, "payload62_6", dept_id, stockId)
result = commonFuc().http_post(url, request_body, headers)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1) #
print(id1) #stockAreaId 库区id
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# 获取货位id
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_13", dept_id,id1)
print('request_body',request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultbbbbbbbbbbb', result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id2 = commonFuc().analysis_json('id', data1[0]) #
parentId= commonFuc().analysis_json('parentId', data1[0])
# 货位id
print(id2,parentId)
#r_d8库房管理_库区设置_货位管理_编辑货位
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "basic_stockShelf_updateById_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"))
# # 请求体
request_body = commonFuc().get_business_data(module, "payload62_14", id2,parentId)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultccccccccccccccc', result)
#断言
pageSize = commonFuc().analysis_json('pageSize', data)
print(pageSize, type(pageSize))
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
if code == 0 and data == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
#删除货位,库区
delData().Delete_probeInfo()
\ No newline at end of file
...@@ -89,6 +89,23 @@ class delData(object): ...@@ -89,6 +89,23 @@ class delData(object):
print(new_str1) print(new_str1)
cursor.close() cursor.close()
return new_str1 return new_str1
def Delete_probeInfo(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 删除货位信息
sql = "delete from mcms_stock_shelf where shelf_no like '%自动化测试-2%';"
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('货位信息删除成功 ')
# 删除库区信息
sql = "delete from mcms_stock_shelf where shelf_name like '%自动化测试%';"
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('库区信息删除成功 ')
cursor.close()
# delData().Delete_branch_by_id() # delData().Delete_branch_by_id()
# delData().Delete_goods_change_info() # delData().Delete_goods_change_info()
# delData().Delete_sys_config() # delData().Delete_sys_config()
......
...@@ -95,6 +95,12 @@ ...@@ -95,6 +95,12 @@
"basic_stockShelf_page_url": "/api/herpService/basic/stockShelf/page" "basic_stockShelf_page_url": "/api/herpService/basic/stockShelf/page"
"basic_stockShelf_updateById_url": "/api/herpService/basic/stockShelf/updateById" "basic_stockShelf_updateById_url": "/api/herpService/basic/stockShelf/updateById"
"basic_stockUser_list_url": "/api/herpService/basic/stockUser/list" "basic_stockUser_list_url": "/api/herpService/basic/stockUser/list"
"basic_stockUser_insert_url": "/api/herpService/basic/stockUser/insert"
"basic_stockUser_page_url": "/api/herpService/basic/stockUser/page"
"basic_stockUser_updateById_url": "/api/herpService/basic/stockUser/updateById"
"basic_stockUser_insertShelf_url": "/api/herpService/basic/stockShelf/insertShelf"
"basic_probeInfo_probe_url": "/api/herpService/basic/probeInfo/available/probe"
"basic_probeInfo_shelf_save_url": "/api/herpService/basic/probeInfo/shelf/save"
data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印' data1: '条码,high_info,check_detail,高值打码,out_stock,goods_change_baseInfo,center_out_stock_pkg,mcms_centre_out_stock,pkg_info,mcms_dept_out_stock,barcode_common,mcms_centre_in_stock,goods_change_price,mcms_dept_in_stock,check_detail_pkg,center_out_stock_high,center_out_stock_high,high_consume,shelf_code,barcode_common_pkg,check_detail_high,balance_bill,barcode_rfid,bottle_info,验收单明细打印,产品信息变更,中心库出库单低值,医院中心库出库单,包信息,医院科室出库单,高值纸质条码打印,医院中心库入库单,产品调价,医院科室入库单,低值验收单,中心库出库单高值,高值耗材使用登记表,货位码,单元包纸质条码打印,高值验收单,结算单打印,高值RFID条码打印,单瓶码打印'
...@@ -465,6 +471,16 @@ json_headers2: { ...@@ -465,6 +471,16 @@ json_headers2: {
"payload62_6": {"queryObject":{"deptId":"%s","stockAreaId":"%s","stockCode":"自动化测试","stockType":"0"},"pageNum":1,"pageSize":50} "payload62_6": {"queryObject":{"deptId":"%s","stockAreaId":"%s","stockCode":"自动化测试","stockType":"0"},"pageNum":1,"pageSize":50}
"payload62_7": {"id":"%s","lastModified":"%s","version":"%s","createTime":"%s","createUser":"UID-050151","lastModifiedUser":"UID-050151","stockId":"%s","shelfCode":"%s","shelfName":"%s","address":"%s","shelfType":null,"stockType":0,"defaultFlag":1,"specialFlag":0,"parentId":null,"levelCode":null,"tbStatus":1,"linkman":"UID-048618","recPhone":"%s","delFlag":0,"shelfNo":"%s","shelfKind":0,"hosId":null,"deptId":null,"areaCode":null,"areaName":null,"stockName":null,"probeId":null,"bindFlag":null} "payload62_7": {"id":"%s","lastModified":"%s","version":"%s","createTime":"%s","createUser":"UID-050151","lastModifiedUser":"UID-050151","stockId":"%s","shelfCode":"%s","shelfName":"%s","address":"%s","shelfType":null,"stockType":0,"defaultFlag":1,"specialFlag":0,"parentId":null,"levelCode":null,"tbStatus":1,"linkman":"UID-048618","recPhone":"%s","delFlag":0,"shelfNo":"%s","shelfKind":0,"hosId":null,"deptId":null,"areaCode":null,"areaName":null,"stockName":null,"probeId":null,"bindFlag":null}
"payload62_8": {"deptId":"%s","stockAreaId":"%s","userName":"%s"} "payload62_8": {"deptId":"%s","stockAreaId":"%s","userName":"%s"}
"payload62_9": {"delFlag":1,"deptId":"%s","deptName":"001","hosId":"h0347","roleId":null,"roleName":"内网医院初始化模板角色(内置)","stockAreaId":"%s","tbStatus":1,"userCode":"xhs","userId":"UID-048618","userName":"xhs"}
"payload62_10": {"queryObject":{"deptId":"%s","stockAreaId":"%s","hosId":"h0347"},"pageNum":1,"pageSize":50}
"payload62_11": {"delFlag":0,"id":"%s"}
"payload62_12": {"shelfNum":"2","shelfColumn":2,"shelfPlie":2,"version":"","defaultFlag":0,"tbStatus":1,"shelfKind":0,"parentId":"%s","stockCode":"%s","shelfNo":"自动化测试","stockId":"%s","stockAreaId":"%s"}
"payload62_13": {"queryObject":{"deptId":"%s","stockAreaId":"%s","stockType":1},"pageNum":1,"pageSize":50}
"payload62_14": {"shelfNum":"2","shelfColumn":"01","shelfPlie":"01","version":0,"defaultFlag":1,"tbStatus":0,"id":"%s","shelfKind":0,"parentId":"%s"}
"payload62_15": {"id":"%s","parentId":"%s","defaultFlag":1}
"payload62_16": {"pageNum":1,"pageSize":50,"queryObject":{"shelfCode":"%s","hosId":"h0347"}}
"payload62_17": {"pageNum":1,"pageSize":50,"queryObject":{"probeId":"%s","shelfCode":"%s","hosId":"h0347"}}
"payload62_18": {"hosId":"h0347","probeId":"%s","shelfId":"%s","shelfCode":"%s","createUser":"UID-050151","lastModifiedUser":"UID-050151","oldProbeId":null}
checkDict: {"code": 0,'msg': None,'data': True} checkDict: {"code": 0,'msg': None,'data': True}
......
...@@ -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分3</td> <td class='details-col-elapsed'>0分4</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_d1库房管理_库区设置_人员管理_添加人员_查询人员_异常/log.html' target='_blank'>r_d1库房管理_库区设置_人员管理_添加人员_查询人员_异常</a></td> <td class="details-col-elapsed"><a href='../log/r_d9库房管理_库区设置_货位管理_编辑货位/log.html' target='_blank'>r_d9库房管理_库区设置_货位管理_编辑货位</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">2.979</td> <td class="details-col-elapsed">3.892</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