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
57247dc4
Commit
57247dc4
authored
Oct 12, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
a655af66
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_a4_流程四_基础模块设置_数据库验证.air/a_a4_流程四_基础模块设置_数据库验证.py
View file @
57247dc4
...
@@ -140,11 +140,12 @@ def check_basics_set_info():
...
@@ -140,11 +140,12 @@ def check_basics_set_info():
else
:
else
:
dept_id
=
get_id
(
dept_id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;"
%
branch_id
)
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;"
%
branch_id
)
if
i
==
2
:
if
i
==
2
:
stock_name
=
get_branch_name
()
stock_name
=
get_branch_name
()
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_stock_info'
+
str
(
i
),
id
,
hos_id
,
pid
,
branch_id
,
'check_mcms_stock_info'
+
str
(
i
),
id
,
hos_id
,
pid
,
branch_id
,
stock_code
,
stock_name
,
dept_id
,
create_user
,
create_time
,
last_modified
,
stock_code
,
stock_name
,
dept_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
last_modified_user
)
)
else
:
else
:
...
@@ -171,7 +172,7 @@ def check_basics_set_info():
...
@@ -171,7 +172,7 @@ def check_basics_set_info():
else
:
else
:
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
#检查新增的用户信息
#
检查新增的用户信息
# 要验证的数据sql
# 要验证的数据sql
sql1
=
"select * from sys_user order by create_time desc LIMIT 1 OFFSET 0;"
sql1
=
"select * from sys_user order by create_time desc LIMIT 1 OFFSET 0;"
actual
=
check_mcms_pur_sql
(
sql1
)
actual
=
check_mcms_pur_sql
(
sql1
)
...
@@ -180,15 +181,15 @@ def check_basics_set_info():
...
@@ -180,15 +181,15 @@ def check_basics_set_info():
"select id from sys_user order by create_time desc LIMIT 1 OFFSET 0;"
)
"select id from sys_user order by create_time desc LIMIT 1 OFFSET 0;"
)
hos_id
=
get_hosid
()
hos_id
=
get_hosid
()
user_code
=
get_id
(
user_code
=
get_id
(
"select user_code from sys_user where id='%s';"
%
id
)
"select user_code from sys_user where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from sys_user where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from sys_user where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from sys_user where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from sys_user where id='%s';"
%
id
)
last_update_datetime
=
get_create_time
(
"select last_update_datetime from sys_user where id='%s';"
%
id
)
last_update_datetime
=
get_create_time
(
"select last_update_datetime from sys_user where id='%s';"
%
id
)
corp_id
=
get_hosid
()
corp_id
=
get_hosid
()
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_sys_user'
,
id
,
user_code
,
last_update_datetime
,
create_time
,
'check_sys_user'
,
id
,
user_code
,
last_update_datetime
,
create_time
,
create_user
,
last_modified
,
last_modified_user
,
corp_id
create_user
,
last_modified
,
last_modified_user
,
corp_id
)
)
actual_value1
=
get_process_list2
(
actual
)
actual_value1
=
get_process_list2
(
actual
)
...
@@ -209,12 +210,19 @@ def check_basics_set_info():
...
@@ -209,12 +210,19 @@ def check_basics_set_info():
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_mcms_dept_goods_info
():
def
check_mcms_dept_goods_info
():
print
(
'检查科室添加产品信息'
)
print
(
'检查科室添加产品信息'
)
hos_id
=
get_hosid
()
hos_id
=
get_hosid
()
hos_name
=
get_hosname
()
branch_id
=
get_branch_id
()
dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
hos_name
=
get_hosname
()
dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid2'
]
dept_name
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室name"
,
'message6'
)[
'deptid2'
]
username
=
commonFuc
().
get_business_data
(
'b2_herp3_bs'
,
"username"
)
create_user
=
get_login_user_uxid_bydb
(
username
)
last_modified_user
=
create_user
target_dept_id
=
FileUtils
().
r_info8
(
"b2_herp3_bs"
,
"所有科室id"
,
'message6'
)[
'deptid1'
]
# 要验证的数据sql
# 要验证的数据sql
for
i
in
range
(
5
):
for
i
in
range
(
5
):
sql1
=
"select * from mcms_dept_goods_info order by create_time desc LIMIT 1 OFFSET %s;"
%
(
sql1
=
"select * from mcms_dept_goods_info order by create_time desc LIMIT 1 OFFSET %s;"
%
(
...
@@ -227,24 +235,28 @@ def check_mcms_dept_goods_info():
...
@@ -227,24 +235,28 @@ def check_mcms_dept_goods_info():
hos_goods_id
=
get_id
(
hos_goods_id
=
get_id
(
"select hos_goods_id from mcms_dept_goods_info where id='%s';"
%
(
"select hos_goods_id from mcms_dept_goods_info where id='%s';"
%
(
id
))
id
))
if
check_hos_goods_id
(
hos_goods_id
)
==
True
:
if
check_hos_goods_id
(
hos_goods_id
)
==
True
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
else
:
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
pid
=
get_id
(
"select pid from mcms_stock_info order by create_time desc LIMIT 1 OFFSET %s;"
%
(
i
))
stock_code
=
get_id
(
create_time
=
get_create_time
(
"select create_time from mcms_dept_goods_info where id='%s';"
%
id
)
"select stock_code from mcms_stock_info where id='%s';"
%
(
id
))
last_modified
=
get_create_time
(
"select last_modified from mcms_dept_goods_info where id='%s';"
%
id
)
corp_id
=
get_hosid
()
shelf_code
=
get_stockAreaId_new_fromDb
(
dept_name
,
2
)
create_time
=
get_create_time
(
"select create_time from mcms_stock_info where id='%s';"
%
id
)
if
i
==
2
or
i
==
3
:
last_modified
=
get_create_time
(
"select last_modified from mcms_stock_info where id='%s';"
%
id
)
pkg_def_id
=
get_id
(
"select id from branch_goods_pkg_def where hos_goods_id='%s';"
%
hos_goods_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_goods_info'
+
str
(
i
),
id
,
hos_id
,
hos_name
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
dept_id
,
'check_mcms_stock_info'
+
str
(
i
),
id
,
hos_id
,
pid
hos_goods_id
,
pkg_def_id
,
target_dept_id
,
shelf_code
,
create_user
,
create_time
,
)
last_modified
,
last_modified_user
,
branch_id
)
else
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_dept_goods_info'
+
str
(
i
),
id
,
hos_id
,
hos_name
,
dept_id
,
hos_goods_id
,
target_dept_id
,
shelf_code
,
create_user
,
create_time
,
last_modified
,
last_modified_user
,
branch_id
)
actual_value1
=
get_process_list2
(
actual
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
expected_value1
=
get_process_list2
(
expected
)
...
@@ -264,14 +276,15 @@ def check_mcms_dept_goods_info():
...
@@ -264,14 +276,15 @@ def check_mcms_dept_goods_info():
print
(
'error'
)
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
def
check_hos_goods_id
(
hos_goods_id
):
def
check_hos_goods_id
(
hos_goods_id
):
print
(
'检查产品信息'
)
print
(
'检查产品信息'
)
for
i
in
range
(
1
,
6
):
for
i
in
range
(
1
,
6
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
hosGoodsId
=
info
[
'hosGoodsId'
]
if
hos_goods_id
==
hosGoodsId
:
if
hos_goods_id
==
hosGoodsId
:
return
True
return
True
return
False
return
False
pro_path
=
commonFuc
().
get_pro_path2
()
pro_path
=
commonFuc
().
get_pro_path2
()
...
@@ -288,9 +301,9 @@ try:
...
@@ -288,9 +301,9 @@ try:
# dept_query_all() # 科室查询,将科室id写入文件中
# dept_query_all() # 科室查询,将科室id写入文件中
# time.sleep(6)
# time.sleep(6)
# 检查院区数据,科室数据,库房,新增用户数据
# 检查院区数据,科室数据,库房,新增用户数据
check_basics_set_info
()
#
check_basics_set_info()
time
.
sleep
(
3
)
#
time.sleep(3)
#检查mcms_dept_goods_info表数据,验证科室添加的产品信息
#
检查mcms_dept_goods_info表数据,验证科室添加的产品信息
check_mcms_dept_goods_info
()
check_mcms_dept_goods_info
()
grants_user
()
# 给用户授权
grants_user
()
# 给用户授权
set_dept_lead1
()
# 设置一级科室负责人
set_dept_lead1
()
# 设置一级科室负责人
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
57247dc4
...
@@ -490,4 +490,14 @@
...
@@ -490,4 +490,14 @@
"check_mcms_stock_info2": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "%s中心库房", "stock_fzr": None, "stock_phone": "13401003250", "dept_id": "%s", "stock_level": "1", "short_pinyin": "sbk001", "address": "设备科001", "mgr_type": 1, "remark": None, "version": 0, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
"check_mcms_stock_info2": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "%s中心库房", "stock_fzr": None, "stock_phone": "13401003250", "dept_id": "%s", "stock_level": "1", "short_pinyin": "sbk001", "address": "设备科001", "mgr_type": 1, "remark": None, "version": 0, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
#新增用户数据检查
#新增用户数据检查
"check_sys_user": '{"id": "%s", "user_code": "%s", "kind": 0, "enable_flag": 1, "create_datetime": None, "create_user_id": None, "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified": %s, "last_modified_user": "%s", "corp_id": "%s"}'
"check_sys_user": '{"id": "%s", "user_code": "%s", "kind": 0, "enable_flag": 1, "create_datetime": None, "create_user_id": None, "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified": %s, "last_modified_user": "%s", "corp_id": "%s"}'
\ No newline at end of file
#检查科室添加产品信息
"check_mcms_dept_goods_info0": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "dept_id": "%s", "dept_name": "二级检验科002", "hos_goods_id": "%s", "stock_upper": Decimal("0.00"), "stock_lower": Decimal("0.00"), "mgr_type": None, "packet_qty": None, "pkg_def_id": None, "stock_id": None, "req_num": None, "tb_status": 1, "target_dept_id": "%s", "shelf_code": "%s-A-01-01", "grant_way": 1, "consume_mode": None, "auto_unpack": None, "limit_flag": 0, "buy_round": 0, "buy_allow": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "branch_id": "%s", "coding_type": 0}'
"check_mcms_dept_goods_info1": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "dept_id": "%s", "dept_name": "二级检验科002", "hos_goods_id": "%s", "stock_upper": Decimal("0.00"), "stock_lower": Decimal("0.00"), "mgr_type": None, "packet_qty": None, "pkg_def_id": None, "stock_id": None, "req_num": None, "tb_status": 1, "target_dept_id": "%s", "shelf_code": "%s-A-01-01", "grant_way": 1, "consume_mode": None, "auto_unpack": None, "limit_flag": 0, "buy_round": 0, "buy_allow": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "branch_id": "%s", "coding_type": 0}'
"check_mcms_dept_goods_info2": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "dept_id": "%s", "dept_name": "二级检验科002", "hos_goods_id": "%s", "stock_upper": Decimal("0.00"), "stock_lower": Decimal("0.00"), "mgr_type": None, "packet_qty": Decimal("100.00"), "pkg_def_id": "%s", "stock_id": None, "req_num": None, "tb_status": 1, "target_dept_id": "%s", "shelf_code": "%s-A-01-01", "grant_way": 1, "consume_mode": None, "auto_unpack": 0, "limit_flag": 0, "buy_round": 0, "buy_allow": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "branch_id": "%s", "coding_type": 0}'
"check_mcms_dept_goods_info3": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "dept_id": "%s", "dept_name": "二级检验科002", "hos_goods_id": "%s", "stock_upper": Decimal("0.00"), "stock_lower": Decimal("0.00"), "mgr_type": None, "packet_qty": Decimal("100.00"), "pkg_def_id": "%s", "stock_id": None, "req_num": None, "tb_status": 1, "target_dept_id": "%s", "shelf_code": "%s-A-01-01", "grant_way": 1, "consume_mode": None, "auto_unpack": 0, "limit_flag": 0, "buy_round": 0, "buy_allow": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "branch_id": "%s", "coding_type": 0}'
"check_mcms_dept_goods_info4": '{"id": "%s", "hos_id": "%s", "hos_name": "%s", "dept_id": "%s", "dept_name": "二级检验科002", "hos_goods_id": "%s", "stock_upper": Decimal("0.00"), "stock_lower": Decimal("0.00"), "mgr_type": None, "packet_qty": None, "pkg_def_id": None, "stock_id": None, "req_num": None, "tb_status": 1, "target_dept_id": "%s", "shelf_code": "%s-A-01-01", "grant_way": 1, "consume_mode": None, "auto_unpack": None, "limit_flag": 0, "buy_round": 0, "buy_allow": 1, "version": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "branch_id": "%s", "coding_type": 0}'
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