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
e11be9ae
Commit
e11be9ae
authored
Nov 15, 2024
by
xiao-hesheng
Browse files
流程一脚本提交
parent
d3992804
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/b6_spd3_core_business_flow_database_check/a_a1_流程一外网企业注册审批_数据库验证.air/a_a1_流程一外网企业注册审批_数据库验证.py
View file @
e11be9ae
...
@@ -227,28 +227,21 @@ def check_sys_user():
...
@@ -227,28 +227,21 @@ def check_sys_user():
def
check_sys_user_role
():
def
check_sys_user_role
():
print
(
'检查sys_user_role数据'
)
print
(
'检查sys_user_role数据'
)
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
sql1
=
"select * from spd
_ybtest_hdi
.sys_user_role order by create_time desc limit 1;"
sql1
=
"select * from spd
3_platform_test2
.sys_user_role order by create_time desc limit 1;"
actual
=
check_mcms_pur_sql
(
sql1
)
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_role order by create_time desc limit 1;"
)
id
=
get_id
(
"select id from spd3_platform_test2.sys_user_role order by create_time desc limit 1;"
)
hos_id
=
get_id
(
"select hos_id from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
mgr_range_id
=
get_id
(
"select mgr_range_id from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
prov_id
=
get_prov_id
()
user_id
=
get_id
(
"select user_id from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
sub_prov_id
=
get_id
(
"select sub_prov_id from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
role_code
=
get_id
(
"select role_code from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
contact_way
=
get_id
(
"select contact_way from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
create_user
=
get_id
(
"select create_user from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
contact_user
=
get_id
(
"select contact_user from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
last_modified_user
=
get_id
(
"select last_modified_user from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
# last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id)
last_modified
=
get_create_time
(
"select last_modified from spd3_platform_test2.sys_user_role where id='%s';"
%
id
)
# username = commonFuc().get_business_data('b2_herp3_bs', "username")
auditor
=
get_id
(
"select auditor from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
])
last_modified_user
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_role where user_code='test_1';"
)
audit_time
=
get_create_time
(
"select audit_time from spd_ybtest_hdi.sys_user_role where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';"
%
id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'sys_user_role2'
,
id
,
hos_id
,
prov_id
,
sub_prov_id
,
contact_way
'check_sys_user_role'
,
id
,
mgr_range_id
,
user_id
,
role_code
,
create_user
,
contact_user
,
auditor
,
audit_time
,
create_user
,
create_time
,
,
create_time
,
last_modified_user
,
last_modified
)
last_modified_user
,
last_modified
)
actual_value1
=
get_process_list2
(
actual
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
expected_value1
=
get_process_list2
(
expected
)
...
@@ -270,28 +263,27 @@ def check_sys_user_role():
...
@@ -270,28 +263,27 @@ def check_sys_user_role():
def
check_sys_user_org
():
def
check_sys_user_org
():
print
(
'检查sys_user_org数据'
)
print
(
'检查sys_user_org数据'
)
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
sql1
=
"select * from spd
_ybtest_hdi
.sys_user_org order by create_time desc limit 1;"
sql1
=
"select * from spd
3_platform_test2
.sys_user_org order by create_time desc limit 1;"
actual
=
check_mcms_pur_sql
(
sql1
)
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_org order by create_time desc limit 1;"
)
id
=
get_id
(
"select id from spd3_platform_test2.sys_user_org order by create_time desc limit 1;"
)
hos_id
=
get_id
(
"select hos_id from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
user_id
=
get_id
(
"select user_id from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
prov_id
=
get_prov_id
()
org_id
=
get_id
(
"select org_id from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
sub_prov_id
=
get_id
(
"select sub_prov_id from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
org_code
=
get_id
(
"select org_code from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
contact_way
=
get_id
(
"select contact_way from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
ename
=
get_id
(
"select ename from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
contact_user
=
get_id
(
"select contact_user from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
cname
=
ename
create_time
=
get_create_time
(
"select create_time from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
email
=
cname
# last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id)
uxid
=
get_id
(
"select uxid from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
# username = commonFuc().get_business_data('b2_herp3_bs', "username")
last_update_datetime
=
get_create_time
(
"select last_update_datetime from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
auditor
=
get_id
(
"select auditor from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
create_user
=
get_login_user_uxid_bydb
(
create_user
=
get_id
(
"select create_user from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
])
last_modified
=
get_create_time
(
"select last_modified from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
last_modified_user
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_org where user_code='test_1';"
)
last_modified_user
=
create_user
audit_time
=
get_create_time
(
"select audit_time from spd_ybtest_hdi.sys_user_org where id='%s';"
%
id
)
corp_id
=
get_id
(
"select corp_id from spd3_platform_test2.sys_user_org where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';"
%
id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'sys_user_org
2
'
,
id
,
hos
_id
,
prov
_id
,
sub_prov_id
,
contact_way
'
check_
sys_user_org'
,
id
,
user
_id
,
org
_id
,
org_code
,
contact_user
,
auditor
,
audit_time
,
create_user
,
cre
ate
_
time
,
,
ename
,
cname
,
email
,
uxid
,
last_update_d
atetime
,
last_modified
_user
,
last_modified
)
create_time
,
create_user
,
last_modified
,
last_modified
_user
,
corp_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
)
...
@@ -315,28 +307,22 @@ def check_sys_user_org():
...
@@ -315,28 +307,22 @@ def check_sys_user_org():
def
check_sys_user_login
():
def
check_sys_user_login
():
print
(
'检查sys_user_login数据'
)
print
(
'检查sys_user_login数据'
)
branch_id
=
get_branch_id
()
branch_id
=
get_branch_id
()
sql1
=
"select * from spd
_ybtest_hdi
.sys_user_login order by create_time desc limit 1;"
sql1
=
"select * from spd
3_platform_test2
.sys_user_login order by create_time desc limit 1;"
actual
=
check_mcms_pur_sql
(
sql1
)
actual
=
check_mcms_pur_sql
(
sql1
)
print
(
'actual'
,
actual
)
print
(
'actual'
,
actual
)
id
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_login order by create_time desc limit 1;"
)
id
=
get_id
(
"select id from spd3_platform_test2.sys_user_login order by create_time desc limit 1;"
)
hos_id
=
get_id
(
"select hos_id from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
uxid
=
get_id
(
"select uxid from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
prov_id
=
get_prov_id
()
user_login_code
=
get_id
(
"select user_login_code from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
sub_prov_id
=
get_id
(
"select sub_prov_id from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
last_update_datetime
=
get_create_time
(
"select last_update_datetime from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
contact_way
=
get_id
(
"select contact_way from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
pwd_encryption
=
get_id
(
"select pwd_encryption from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
contact_user
=
get_id
(
"select contact_user from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
create_time
=
get_create_time
(
"select create_time from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
create_user
=
get_id
(
"select create_user from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
# last_modified = get_create_time("select last_modified from spd_ybtest_hdi.supply_relation where id='%s';" % id)
last_modified
=
get_create_time
(
"select last_modified from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
# username = commonFuc().get_business_data('b2_herp3_bs', "username")
last_modified_user
=
create_user
auditor
=
get_id
(
"select auditor from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
corp_id
=
get_id
(
"select corp_id from spd3_platform_test2.sys_user_login where id='%s';"
%
id
)
create_user
=
get_login_user_uxid_bydb
(
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'供货关系申请2'
,
'message'
)[
"e_username"
])
last_modified_user
=
get_id
(
"select id from spd_ybtest_hdi.sys_user_login where user_code='test_1';"
)
audit_time
=
get_create_time
(
"select audit_time from spd_ybtest_hdi.sys_user_login where id='%s';"
%
id
)
last_modified
=
get_create_time
(
"select last_modified from spd_ybtest_hdi.company_regist_bill where id='%s';"
%
id
)
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
expected
=
commonFuc
().
get_business_data
(
'b6_spd3_core_business_flow_database_check'
,
'sys_user_login2'
,
id
,
hos_id
,
prov_id
,
sub_prov_id
,
contact_way
'check_sys_user_login'
,
id
,
uxid
,
user_login_code
,
last_update_datetime
,
pwd_encryption
,
contact_user
,
auditor
,
audit_time
,
create_user
,
create_time
,
,
create_time
,
create_user
,
last_modified
,
last_modified_user
,
corp_id
)
last_modified_user
,
last_modified
)
actual_value1
=
get_process_list2
(
actual
)
actual_value1
=
get_process_list2
(
actual
)
expected_value1
=
get_process_list2
(
expected
)
expected_value1
=
get_process_list2
(
expected
)
...
@@ -362,15 +348,17 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企
...
@@ -362,15 +348,17 @@ using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企
from
a_a1_流程一外网企业注册审批
import
test1
,
test2
,
test3
from
a_a1_流程一外网企业注册审批
import
test1
,
test2
,
test3
def
main
():
def
main
():
test1
()
#企业注册
# test1()#企业注册
time
.
sleep
(
6
)
# time.sleep(6)
check_company_regist_bill
(
1
)
# check_company_regist_bill(1)
check_bas_company_info
()
# check_bas_company_info()
test2
()
#企业审核
# test2()#企业审核
time
.
sleep
(
6
)
# time.sleep(6)
check_sys_org
()
# check_sys_org()
check_sys_user
()
# check_sys_user()
check_company_regist_bill
(
2
)
# check_sys_user_role()
# check_sys_user_org()
check_sys_user_login
()
test3
()
test3
()
try
:
try
:
main
()
main
()
...
...
data/b6_spd3_core_business_flow_database_check/data
View file @
e11be9ae
...
@@ -538,4 +538,8 @@
...
@@ -538,4 +538,8 @@
"company_regist_bill": '{"id": "%s", "user_login_code": "%s", "user_login_psw": "%s", "user_name": "%s", "cname": "%s", "short_name": "", "up_company_id": "", "comp_kind": 0, "comp_function": "%s", "province": None, "city": None, "area": "", "area_code": None, "legal": "", "address": "", "is_abroad": 1, "nation": None, "regist_contact_user": "", "regist_contact_way": "", "email": "%s@sina.com", "hos_property": None, "hos_level": None, "erp_code": "%s", "reg_code": None, "jyxk_code": None, "jyxkba_code": None, "scxkz_code": None, "scbapz_code": None, "is_locked": 0, "audit_status": 10, "audit_start_time": None, "audit_end_time": %s, "auditor": None, "audit_comment": None, "regist_source_project": "%s", "data_entrance": "注册", "import_task_mfrs_id": None, "version": 0, "create_user_corp_id": None, "create_user": None, "create_time": %s, "last_modified_user": null, "last_modified": %s, "hos_spd_type": None, "organization_code": None, "spd_project_code": null, "admin_role": null, "client_type": null, "prov_id": None, "is_drug_prov": None, "is_drug_lic": None, "is_apparatus_prov": None, "is_apparatus_register": None, "user_role": null, "supply_relation_id": %s}'
"company_regist_bill": '{"id": "%s", "user_login_code": "%s", "user_login_psw": "%s", "user_name": "%s", "cname": "%s", "short_name": "", "up_company_id": "", "comp_kind": 0, "comp_function": "%s", "province": None, "city": None, "area": "", "area_code": None, "legal": "", "address": "", "is_abroad": 1, "nation": None, "regist_contact_user": "", "regist_contact_way": "", "email": "%s@sina.com", "hos_property": None, "hos_level": None, "erp_code": "%s", "reg_code": None, "jyxk_code": None, "jyxkba_code": None, "scxkz_code": None, "scbapz_code": None, "is_locked": 0, "audit_status": 10, "audit_start_time": None, "audit_end_time": %s, "auditor": None, "audit_comment": None, "regist_source_project": "%s", "data_entrance": "注册", "import_task_mfrs_id": None, "version": 0, "create_user_corp_id": None, "create_user": None, "create_time": %s, "last_modified_user": null, "last_modified": %s, "hos_spd_type": None, "organization_code": None, "spd_project_code": null, "admin_role": null, "client_type": null, "prov_id": None, "is_drug_prov": None, "is_drug_lic": None, "is_apparatus_prov": None, "is_apparatus_register": None, "user_role": null, "supply_relation_id": %s}'
"check_bas_company_info": '{"id": "%s", "code": "%s", "cname": "%s", "another_name": "", "short_pinyin": "%s", "reg_code": None, "jyxk_code": None, "nsrsb_code": None, "kind": "4", "legal": "", "address": "", "linkman": "", "contact_way": "", "contact_fax": None, "logo": None, "post_code": None, "email": "%s@sina.com", "remark": None, "erp_code": "%s", "is_supply": None, "is_three_in_one": None, "master_code": None, "flag": "1", "nation": None, "province": None, "city": None, "area": "", "area_code": None, "mfrs_kind": None, "uxid": None, "fill_date": %s, "last_update_datetime": %s, "version": 2, "ygcode": None, "agent_name": None, "record_card": None, "product_code": None, "business_scope": None, "new_business_scope": None, "two_business_scope": None, "new_two_business_scope": None, "three_business_scope": None, "new_three_business_scope": None, "audit_remark": None, "changed_remark": None, "status": None, "create_user": None, "create_time": None, "last_modified": %s, "last_modified_user": "%s"}'
"check_bas_company_info": '{"id": "%s", "code": "%s", "cname": "%s", "another_name": "", "short_pinyin": "%s", "reg_code": None, "jyxk_code": None, "nsrsb_code": None, "kind": "4", "legal": "", "address": "", "linkman": "", "contact_way": "", "contact_fax": None, "logo": None, "post_code": None, "email": "%s@sina.com", "remark": None, "erp_code": "%s", "is_supply": None, "is_three_in_one": None, "master_code": None, "flag": "1", "nation": None, "province": None, "city": None, "area": "", "area_code": None, "mfrs_kind": None, "uxid": None, "fill_date": %s, "last_update_datetime": %s, "version": 2, "ygcode": None, "agent_name": None, "record_card": None, "product_code": None, "business_scope": None, "new_business_scope": None, "two_business_scope": None, "new_two_business_scope": None, "three_business_scope": None, "new_three_business_scope": None, "audit_remark": None, "changed_remark": None, "status": None, "create_user": None, "create_time": None, "last_modified": %s, "last_modified_user": "%s"}'
"check_sys_org": '{"id":"%s","pid":"/","code":"%s:001","self_code":null,"corp_id":"%s","corp_kind":"4","ename":"配送机构","cname":"配送机构","ordinal":1,"short_pinyin":"psjg","address":null,"contact_way":null,"scm_code":null,"erp_code":null,"remark":null,"node_kind":null,"flag":"1","last_update_datetime":%s,"version":0,"branch_id":null,"dept_kind":null,"create_time":%s,"create_user":"%s","last_modified_user":"%s","last_modified":%s,"dept_cate":null,"user_leader_id":null,"dept_level":null,"dept_type":null,"ext1":null,"ext2":null,"ext3":null,"ext4":null,"ext5":null}'
"check_sys_org": '{"id":"%s","pid":"/","code":"%s:001","self_code":null,"corp_id":"%s","corp_kind":"4","ename":"配送机构","cname":"配送机构","ordinal":1,"short_pinyin":"psjg","address":null,"contact_way":null,"scm_code":null,"erp_code":null,"remark":null,"node_kind":null,"flag":"1","last_update_datetime":%s,"version":0,"branch_id":null,"dept_kind":null,"create_time":%s,"create_user":"%s","last_modified_user":"%s","last_modified":%s,"dept_cate":null,"user_leader_id":null,"dept_level":null,"dept_type":null,"ext1":null,"ext2":null,"ext3":null,"ext4":null,"ext5":null}'
"check_sys_user": '{"id":"%s","user_code":"%s","kind":"0","enable_flag":1,"create_datetime":null,"create_user_id":null,"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":null,"create_user_id":null,"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_sys_user_role": '{"id": "%s", "mgr_range_id": "%s", "user_id": "%s", "role_id": None, "uxid": None, "mt": None, "role_code": "%s", "version": 0, "create_user": "%s", "create_time": %s, "last_modified_user": "%s", "last_modified": %s}'
"check_sys_user_org": '{"id": "%s", "user_id": "%s", "org_id": "%s", "org_code": "%s", "ename": "%s", "ordinal": None, "cname": "%s", "tel": None, "email": "%s@sina.com", "qq": None, "job": None, "erp_code": None, "scm_code": None, "others": None, "uxid": "%s", "signature": None, "status": "1", "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_login": '{"id": "%s", "uxid": "%s", "user_login_code": "%s", "login_count": 0, "error_count": 0, "last_login_datetime": None, "last_error_datetime": None, "flag": "0", "hash": None, "web_salt": None, "salt": None, "last_update_datetime": %s, "pwd_encryption": "%s", "version": 0, "create_time": %s, "create_user": "%s", "last_modified": %s, "last_modified_user": "%s", "ip": None, "corp_id": "%s"}'
\ 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