'''
@Project ：test_guke 
@File    ：test_transfer_02in.py
@IDE     ：PyCharm 
@Author  ：何凯
@Date    ：2023/3/17 15:58 
'''
import os
import logging
import allure
import pytest as pytest
from ddt import ddt, file_data

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.Transfer.transfer_in import TransferIn
from page.GuKeYiTiHua.Public.common import CommonElement
from unit.public.DataDic import DataDic
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_delivery import WarehouseDelivery
from component.GuKeYiTiHua.StorageManage.StorageOut.warehouse_pick import WarehousePick
log = logging.getLogger(__name__)

@pytest.mark.incremental
@ddt
class TestBoundOrder(object):
    def setup_class(self):
        self.dd = DataDic()
        self.dr = TransferIn()
        self.so = StorageOut()
        self.wd = WarehouseDelivery()
        self.wp = WarehousePick()
        self.wc = WarehouseCheck()
        self.common = CommonElement()
        self.wt = WarehouseTake()
        self.wa = WarehouseVerify()
        self.wu = WarehouseUp()

    @allure.feature('入库')
    @allure.story('调拨入库单')
    @allure.title('调拨出库单提交')
    # @pytest.mark.skip(reason='调试通过')
    @allure.description('打开调拨入库单->提交')
    @pytest.mark.transferin
    @pytest.mark.run(order=10)
    def test_Inboundorder(self):
        # 调拨入库单提交
        # transfer_out_code = self.dd.get_value('transfer_out_code')
        self.dr.open_menu_transfer_in()
        self.dr.transfer_in_code_create('ST2023031400006')
        transfer_in_code = self.dd.get_value('transfer_in_code')
        self.dd.set_value('test_data_info', {'goods': ['10005528']})
        self.dr.transfer_in_code_cancel('ST2023031400006')
        self.common.close_tap()

        # # 收货
        # self.wt.take_menu_open()
        # self.wt.take_pool_take(transfer_in_code)
        # self.wt.take_confirm(transfer_in_code)
        # self.common.close_tap()
        # # 验收
        # self.wa.open_verify_menu()
        # self.wa.verify_edit_and_confirm(transfer_in_code)
        # self.common.close_tap()
        # # 上架
        # self.wu.open_up_menu()
        # self.wu.up_confirm(transfer_in_code)
        # self.common.close_tap()
