# -*- coding:utf-8 -*-
# 作者：齐振鋆
# 日期：2023/3/14
# 描述:

import os

from datetime import datetime

import pytest
import allure
import logging

from ddt import ddt, file_data

from cases.UI.GuKeYiTiHua import PROJECTNAME
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_accept import WarehouseVerify
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_take import WarehouseTake
from component.GuKeYiTiHua.StorageManage.StorageIn.warehouse_up import WarehouseUp
from component.GuKeYiTiHua.StorageManage.StorageOut.storage_out_integration import StorageOut
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_check import WarehouseCheck
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_back import ApolegamyBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.apolegamy_out import ApolegamyOut
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.orthopedic_take import OrthopedicTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryBack.surgery_back import SurgeryBack
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_borrow import ApolegamyBorrow
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.apolegamy_take import ApolegamyTake
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.orthopedic_lend import OrthopedicLend
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.out_ledger import OutLedger
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_distribute import SurgeryDistribute
from component.GuKeYiTiHua.SurgeryFollow.SurgeryLend.surgery_require import SurgeryRequire

from page.GuKeYiTiHua.DBQuery.db_query import DBQuery
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic

log = logging.getLogger(__name__)


@pytest.mark.incremental
@ddt
@allure.epic(PROJECTNAME)
@allure.feature('Debug模块')
class TestDebug(object):
    dd = DataDic()

    def setup_class(self):
        self.dbq = DBQuery()
        self.common = CommonElement()
        self.sr = SurgeryRequire()
        self.sd = SurgeryDistribute()
        self.ol = OrthopedicLend()
        self.wp = WarehousePick()
        self.so = StorageOut()
        self.ole = OutLedger()
        self.ab = ApolegamyBorrow()
        self.at = ApolegamyTake()
        self.sb = SurgeryBack()
        self.ot = OrthopedicTake()
        self.wc = WarehouseCheck()
        self.abk = ApolegamyBack()
        self.aot = ApolegamyOut()
        self.wt = WarehouseTake()
        self.wv = WarehouseVerify()
        self.wu = WarehouseUp()

    @allure.description('测试时间：{}'.format(datetime.now()))
    @allure.story('调试专用')
    @allure.severity(allure.severity_level.BLOCKER)
    @pytest.mark.run(order=10)
    @pytest.mark.debug
    @file_data('{}/data/purchaseTestData.yaml'.format(os.getcwd()))
    def test_debug1(self, **kwargs):
        self.dd.set_value('test_data_info', kwargs)
        order_code = 'OP230529000012'
        # log.info(kwargs)
        # self.wt.take_menu_open()
        # self.wt.take_pool_take(order_code=order_code)
        # self.wt.take_confirm(order_code=order_code)
        self.wv.open_verify_menu()
        self.wv.verify_edit_and_confirm(order_code=order_code)
        # self.wu.open_up_menu()
        # self.wu.up_confirm(order_code=order_code)
