# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils

__author__ = "xiaohesheng"

"""
case_tag:api,b6_spd3_core_business_flow_database_check,a_a2_流程二供货关系申请提交审批,id2303,id2303-2,sit,on
主数据平台:a_a2_流程二供货关系申请提交审批 
python runner_test.py tag id2303-2 debug mdm3
"""

from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using
import sys

pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air')
from a_a2_流程二供货关系申请提交审批 import h_login, e_login, supply_and_marketing_apply, submitSupplyRelation_pass, \
    supply_and_marketing_apply2

try:
    module = "b5_spd3_core_business_flow"
    h_login()  # 医院登录
    e_login(1)  # 企业登录
    # 供应关系申请-客户类型医院
    FileUtils().w_info1(supply_and_marketing_apply(), module, '供货关系申请')
    submitSupplyRelation_pass()
    # 供应关系申请-客户类型厂商
    FileUtils().w_info1(supply_and_marketing_apply2(), module, '供货关系申请2')
    submitSupplyRelation_pass()
    commonFuc().check_text_exist_result_text('succees', 'succees')
    print('=================流程二结束=================')
except Exception as e:
    # 打印错误信息
    print(f"发生错误: {e}")
    print('a_a2_流程二供货关系申请提交审批,出现异常,请检查')
