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
c0c6972a
Commit
c0c6972a
authored
Oct 10, 2024
by
xiao-hesheng
Browse files
流程五脚本提交
parent
2d1138e5
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 @
c0c6972a
...
...
@@ -40,11 +40,12 @@ def check_test1_info():
address
=
name
create_time
=
get_create_time
(
"select create_time from mcms_branch_info where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_branch_info where id='%s';"
%
id
)
username
=
commonFuc
().
get_business_data
(
'b2_herp3_bs'
,
"username"
)
create_user
=
get_login_user_uxid_bydb
(
username
)
username
=
commonFuc
().
get_business_data
(
'b2_herp3_bs'
,
"username"
)
create_user
=
get_login_user_uxid_bydb
(
username
)
last_modified_user
=
create_user
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_branch_info'
,
id
,
hos_id
,
name
,
address
,
create_time
,
create_user
'check_mcms_branch_info'
,
id
,
hos_id
,
name
,
address
,
create_time
,
create_user
,
last_modified
,
last_modified_user
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
...
...
@@ -67,26 +68,32 @@ def check_test1_info():
# 要验证的数据sql
for
i
in
range
(
4
):
sql1
=
"select * from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
)
sql1
=
"select * from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
)
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
pid
=
get_id
(
"select pid from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
code
=
get_id
(
"select code from sys_org where branch_id='%s' and id='%s';"
%
(
branch_id
,
id
))
id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
pid
=
get_id
(
"select pid from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
code
=
get_id
(
"select code from sys_org where branch_id='%s' and id='%s';"
%
(
branch_id
,
id
))
corp_id
=
get_hosid
()
last_update_datetime
=
get_create_time
(
"select last_update_datetime from sys_org where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from sys_org where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from sys_org where id='%s';"
%
id
)
if
i
<
3
:
if
i
<
3
:
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_dept_info'
+
str
(
i
),
id
,
pid
,
code
,
corp_id
,
branch_id
,
last_update_datetime
,
create_time
,
create_user
,
last_modified_user
,
last_modified
)
'check_dept_info'
+
str
(
i
),
id
,
pid
,
code
,
corp_id
,
branch_id
,
last_update_datetime
,
create_time
,
create_user
,
last_modified_user
,
last_modified
)
else
:
user_leader_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
user_leader_id
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)[
'username1'
])
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_dept_info'
+
str
(
i
),
id
,
pid
,
code
,
corp_id
,
branch_id
,
last_update_datetime
,
create_time
,
create_user
,
last_modified_user
,
last_modified
,
user_leader_id
)
,
create_time
,
create_user
,
last_modified_user
,
last_modified
,
user_leader_id
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
...
...
@@ -105,6 +112,56 @@ def check_test1_info():
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
# 检查库房数据
# 要验证的数据sql
for
i
in
range
(
3
):
sql1
=
"select * from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
)
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
hos_id
=
get_hosid
()
pid
=
get_id
(
"select pid from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;"
%
(
branch_id
,
i
))
stock_code
=
get_id
(
"select stock_code from mcms_stock_info where branch_id='%s' and id='%s';"
%
(
branch_id
,
id
))
corp_id
=
get_hosid
()
create_time
=
get_create_time
(
"select create_time from mcms_stock_info where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from mcms_stock_info where id='%s';"
%
id
)
if
i
==
0
:
dept_id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 1;"
%
branch_id
)
elif
i
==
1
:
dept_id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 2;"
%
branch_id
)
else
:
dept_id
=
get_id
(
"select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;"
%
branch_id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'check_mcms_stock_info'
+
str
(
i
),
id
,
hos_id
,
pid
,
branch_id
,
stock_code
,
dept_id
,
create_user
,
create_time
,
last_modified
,
last_modified_user
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
actual_value2
=
actual_value1
.
replace
(
" "
,
""
)
expected_value2
=
expected_value1
.
replace
(
" "
,
""
)
# print('actual_value2',actual_value2)
print
(
'expected_value2'
)
print
(
expected_value2
)
print
(
'actual_value2'
)
print
(
actual_value2
)
result
=
(
compare_text_index
(
actual_value2
,
expected_value2
))
print
(
'result'
,
result
)
if
actual_value2
==
expected_value2
:
print
(
'ok'
)
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
else
:
print
(
'error'
)
commonFuc
().
check_text_exist_result_text
(
'error'
,
'succees'
)
pro_path
=
commonFuc
().
get_pro_path2
()
print
(
'pro_path'
,
pro_path
)
...
...
@@ -118,7 +175,6 @@ try:
# test1()#参数2是新增院区后缀为6位数的参数1是老模式
# 检查院区数据,科室数据,库房库区数据
check_test1_info
()
test2
()
# 科室添加产品信息(产品是从外网同步过来的)
dept_query_all
()
# 科室查询,将科室id写入文件中
grants_user
()
# 给用户授权
...
...
@@ -127,5 +183,5 @@ try:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'succees'
)
print
(
'=================流程四结束================='
)
except
Exception
as
e
:
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'error'
)
print
(
"发生异常:"
,
str
(
e
))
commonFuc
().
check_text_exist_result_text
(
'succees'
,
'error'
)
data/b6_spd3_core_business_flow_database_check/data
View file @
c0c6972a
...
...
@@ -482,4 +482,9 @@
"check_dept_info0": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "科室004", "cname": "科室004", "dept_level": 4, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 5, "ordinal": None, "short_pinyin": "ks004", "address": "三级科室004", "contact_way": "三级科室004", "scm_code": None, "erp_code": "004", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info1": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "三级检测组003", "cname": "三级检测组003", "dept_level": 3, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "sjjcz003", "address": "三级检测组003", "contact_way": "12401003250", "scm_code": None, "erp_code": "003", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info2": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "二级检验科002", "cname": "二级检验科002", "dept_level": 2, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "ejjyk002", "address": "二级检验科002", "contact_way": "13401003250", "scm_code": None, "erp_code": "002", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info3": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 1, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}'
\ No newline at end of file
"check_dept_info3": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 1, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}'
#库房数据
"check_mcms_stock_info0": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "三级检测组003库房", "stock_fzr": None, "stock_phone": "12401003250", "dept_id": "%s", "stock_level": "3", "short_pinyin": "sjjcz003", "address": "三级检测组003", "mgr_type": 1, "remark": None, "version": 1, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
"check_mcms_stock_info1": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "二级检验科002库房", "stock_fzr": None, "stock_phone": "13401003250", "dept_id": "%s", "stock_level": "2", "short_pinyin": "ejjyk002", "address": "二级检验科002", "mgr_type": 1, "remark": None, "version": 1, "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": "东土城路院区wSIoT中心库房", "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}'
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