Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
10499768
Commit
10499768
authored
May 22, 2024
by
xiao-hesheng
Browse files
流程九脚本编写
parent
050fbfe0
Changes
11
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a3_流程三_产品导入和审批.air/a_a3_流程三_产品导入和审批.py
View file @
10499768
...
@@ -294,19 +294,22 @@ def add_goods4():
...
@@ -294,19 +294,22 @@ def add_goods4():
else
:
else
:
commonFuc
().
check_text_exist
(
-
1
,
result
)
commonFuc
().
check_text_exist
(
-
1
,
result
)
#删除上次新增的产品,避免产生过多的重复数据
#删除上次新增的产品,避免产生过多的重复数据====这里不能每天删除,万一导入产品功能出现问题会影响后续脚本
try
:
#每隔一段时间来删除重复的产品数据即可,内外网同步删除
list2
=
[]
# try:
for
i
in
range
(
1
,
6
):
# list2=[]
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
# for i in range(1, 6):
hosGoodsId
=
info
[
'hosGoodsId'
]
# info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i)
list2
.
append
(
hosGoodsId
)
# hosGoodsId = info['hosGoodsId']
print
(
list2
)
# list2.append(hosGoodsId)
for
i
in
list2
:
# print(list2)
print
(
i
,
'aaaaaaaaaaaaaaaa'
)
# for i in list2:
delData
().
Del_goods_info
(
i
)
# print(i,'aaaaaaaaaaaaaaaa')
except
:
# delData().Del_goods_info(i)
print
(
'产品数据删除出现异常'
)
# except:
# print('产品数据删除出现异常')
#删除上次新增的产品,避免产生过多的重复数据====这里不能每天删除,万一导入产品功能出现问题会影响后续脚本
#每隔一段时间来删除重复的产品数据即可,内外网同步删除
try
:
try
:
add_goods
()
#直销高值
add_goods
()
#直销高值
select1
(
'message1'
)
select1
(
'message1'
)
...
...
air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air/a_a4_流程四_基础模块设置.py
View file @
10499768
# -*- encoding=utf8 -*-
# -*- encoding=utf8 -*-
from
air_case.public1.public1.public1
import
get_hosid
from
air_case.public1.public1.public1
import
get_hosid
,
branch_add
from
common.db.sql.sql_del_branch_info
import
delData
from
common.db.sql.sql_del_branch_info
import
delData
from
common.fileUtls
import
FileUtils
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.run_cmd_script
import
execute_command
...
@@ -7,7 +7,7 @@ from common.run_cmd_script import execute_command
...
@@ -7,7 +7,7 @@ from common.run_cmd_script import execute_command
__author__
=
"xiaohesheng"
__author__
=
"xiaohesheng"
"""
"""
case_tag:api,spd_core,a_a4_流程四_基础模块设置,id2302,id2302-4,sit,on
case_tag:api,spd_core
1
,a_a4_流程四_基础模块设置,id2302,id2302-4,sit,on
主数据平台:a_a4_流程四_基础模块设置
主数据平台:a_a4_流程四_基础模块设置
python runner_test.py tag id2302-4 debug mdm3
python runner_test.py tag id2302-4 debug mdm3
...
@@ -261,14 +261,57 @@ def grants_user(orgName='d69a68df361a4289b2262e4ef75b55a5', mgrRangeId='feb0cc16
...
@@ -261,14 +261,57 @@ def grants_user(orgName='d69a68df361a4289b2262e4ef75b55a5', mgrRangeId='feb0cc16
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
def
test3
():
# 院区新增
branch_add
()
# 新增科室
execute_command
(
"python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit"
)
# 一键导入所有产品
execute_command
(
"python runner_test.py tag id2263-48 debug sit"
)
# 导入同步过来的新产品,防止因同步时间差导致新建的产品没有导入过来
for
i
in
range
(
1
,
6
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
import_goods
(
hosGoodsId
)
# r_b8库房管理_库区设置_同步库房信息
execute_command
(
"python runner_test.py tag id2263-221 debug sit"
)
# 新增用户
execute_command
(
"python runner_test.py tag id2263-253 debug sit"
)
# 根据院区名称查询中心库房id
execute_command
(
"python runner_test.py tag id2263-222 debug sit"
)
# 新增库区
execute_command
(
"python runner_test.py tag id2263-226 debug sit"
)
# 查询库区
execute_command
(
"python runner_test.py tag id2263-228 debug sit"
)
# r_d0库房管理_库区设置_人员管理_添加人员_查询人员
execute_command
(
"python runner_test.py tag id2263-233 debug sit"
)
# r_d2库房管理_库区设置_人员管理_添加人员
execute_command
(
"python runner_test.py tag id2263-235 debug sit"
)
# r_d4库房管理_库区设置_货位管理_添加货位
execute_command
(
"python runner_test.py tag id2263-237 debug sit"
)
# 科室管理-科室人员查询 设置科室负责人
execute_command
(
"python runner_test.py tag id2263-219 debug sit"
)
try
:
try
:
delData
().
Delete_business_Data
()
#删除业务数据
# ==============删除业务数据和报表数据
delData
().
Del_reporter_data
()
# 删除报表数据
# delData().Delete_business_Data()#删除业务数据
# delData().Del_reporter_data() # 删除报表数据
#==============删除业务数据和报表数据
test1
()
test1
()
test2
()
# 科室添加产品信息(产品是从外网同步过来的)
test2
()
# 科室添加产品信息(产品是从外网同步过来的)
dept_query_all
()
# 科室查询,将科室id写入文件中
dept_query_all
()
# 科室查询,将科室id写入文件中
grants_user
()
#给用户授权
grants_user
()
#给用户授权
# delData().Delete_branch_by_id()#删除院区数据
# flag= commonFuc().get_business_data(module,'flag')
# print(flag)
# 这里创建的院区数据不经常删除了,院区有了采购数据后,再删除院区,垃圾数据太多
# #如果院区已经产生了业务数据,删除院区时必须同步删除业务数据
# if flag=="True":
# test3()
# test2() # 科室添加产品信息(产品是从外网同步过来的)
# dept_query_all() # 科室查询,将科室id写入文件中
# grants_user() # 给用户授权
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
Exception
as
e
:
except
Exception
as
e
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'error'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'error'
)
...
...
air_case/b5_spd3_core_business_flow/a_b3流程十请领业务流_二级库向边仓.air/a_b3流程十请领业务流_二级库向边仓.py
View file @
10499768
...
@@ -23,6 +23,9 @@ python runner_test.py tag id2302-13 debug mdm3
...
@@ -23,6 +23,9 @@ python runner_test.py tag id2302-13 debug mdm3
try
:
try
:
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_platform
()
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_platform
()
print
(
token
,
projectCode
,
uxid
,
corpId
,
info
)
print
(
token
,
projectCode
,
uxid
,
corpId
,
info
)
# token, projectCode, uxid, corpId, info =login_logic_stock()
# print(token, projectCode, uxid, corpId, info)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
except
:
except
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'1'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'1'
)
air_case/public1/public1/public1.py
View file @
10499768
...
@@ -2472,4 +2472,46 @@ def login_platform():
...
@@ -2472,4 +2472,46 @@ def login_platform():
print
(
username
,
password
)
print
(
username
,
password
)
# 获取token和projectCode
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
return
token
,
projectCode
,
uxid
,
corpId
,
info
return
token
,
projectCode
,
uxid
,
corpId
,
info
\ No newline at end of file
def
login_logic_stock
():
module
=
"b5_spd3_core_business_flow"
from
air_case.mdm_login.登录外网系统.登录云仓
import
login_system
# 登录
username
=
commonFuc
().
get_business_data
(
module
,
"username2"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
print
(
username
,
password
)
# 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
return
token
,
projectCode
,
uxid
,
corpId
,
info
def
branch_add
():
module
=
"b2_herp3_bs"
#内网登录
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)
#a4_院区新增
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"insert_url"
)
print
(
'a4_院区新增'
,
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"
))
name
=
timeUtils
().
get_time_hms
(
5
)
#请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload"
,
name
,
name
)
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
#断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
commonFuc
().
check_text_exist
(
0
,
result
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
name
=
commonFuc
().
analysis_json
(
'name'
,
commonFuc
().
analysis_json
(
'data'
,
result
))
# print(id1,name,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
return
id1
,
name
\ No newline at end of file
data/a2_mdm3_ea/message
View file @
10499768
企业信息:
企业信息:
e_id: CR2024052
0
003
8
e_id: CR2024052
2
003
7
cname: 国药集团公司
qgVTA
cname: 国药集团公司
f$F5C
data/a3_mdm3_hs/message
View file @
10499768
医院信息:
医院信息:
h_id: 湖南省人民医院o
C1eg
h_id: 湖南省人民医院o
3Jru
h_name: 湖南省人民医院o
C1eg
h_name: 湖南省人民医院o
3Jru
data/a5_mdm3_pdm/message2
View file @
10499768
产品审核信息
:
产品审核信息
:
MSPid
:
MSP24052
0
0011_1
MSPid
:
MSP24052
2
0011_1
hosId
:
h0347
hosId
:
h0347
hosGoodsId
:
h0347000036
67
hosGoodsId
:
h0347000036
84
provGoodsid
:
provGood-992208
00
provGoodsid
:
provGood-992208
17
goodsAuditBillId
:
MSP24052
0
0011
goodsAuditBillId
:
MSP24052
2
0011
targetId
:
MSP24052
0
0011_1
targetId
:
MSP24052
2
0011_1
data/b2_herp3_bs/message
View file @
10499768
院区新增:
院区新增:
branch_id: h0347-361
1
branch_id: h0347-361
6
branch_name: 东土城路院区
!6enX
branch_name: 东土城路院区
3pvuL
科室信息:
科室信息:
dept2_id: 7
45b792a76cd4a708842eef63ae5b991
dept2_id: 7
aa9a7c18aa1440ba5c88f459c2d17c8
dept2_name: 二级检验科002
dept2_name: 二级检验科002
data/b5_spd3_core_business_flow/data
View file @
10499768
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
"password": "1qaz!QAZ"
"password": "1qaz!QAZ"
"password1": "a123456!"
"password1": "a123456!"
"X-APP-CODE": "herp.pc"
"X-APP-CODE": "herp.pc"
"flag": "True"
json_contentType: "application/json"
json_contentType: "application/json"
json_headers: {
json_headers: {
"Content-Type": "%s"
"Content-Type": "%s"
...
...
report/summary.html
View file @
10499768
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
<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'
>
0
</td>
<td
class=
'details-col-elapsed'
>
0分
3
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
2
秒
</td>
<td
class=
"details-col-elapsed"
>
10
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/a_
b3流程十请领业务流_二级库向边仓
/log.html'
target=
'_blank'
>
a_
b3流程十请领业务流_二级库向边仓
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
a4_流程四_基础模块设置
/log.html'
target=
'_blank'
>
a_
a4_流程四_基础模块设置
</a></td>
<td
class=
"
success"
>
成功
</td>
<td
class=
"
fail"
>
失败
</td>
<td
class=
"details-col-elapsed"
>
3.737
</td>
<td
class=
"details-col-elapsed"
>
2.152
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
</tr>
...
...
runner.py
View file @
10499768
...
@@ -96,7 +96,6 @@ if __name__ == '__main__':
...
@@ -96,7 +96,6 @@ if __name__ == '__main__':
#删除自动化脚本产生的数据
#删除自动化脚本产生的数据
delData
().
Delete_branch_by_id
()
delData
().
Delete_branch_by_id
()
delData
().
Delete_goods_change_info
()
delData
().
Delete_goods_change_info
()
delData
().
Delete_probeInfo_other
()
#
delData().Delete_probeInfo_other()
delData
().
Del_supply_relation
()
delData
().
Del_supply_relation
()
# delData().Del_reporter_data()
print
(
'结束了'
)
print
(
'结束了'
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment