# author:qinguanglei
# ddate:2023/11/14 16:47
# 购买多个序列号商品

import time

import allure
import pytest
from test_buy.steps_buy import StepsBuy


@allure.feature('采购模块')
class TestBuySeqCommodities(object):
    @pytest.fixture(scope='function', autouse=True)
    def housework(self, driver_fixture):
        # 驱动器从fixture传来
        self.driver = driver_fixture

    @allure.story('购买多个序列号商品')
    def test_buy_seq_commodities(self):
        # 载入步骤集合
        steps_buy = StepsBuy(self.driver)
        # 打开浏览器
        steps_buy.open_browser()
        # 登录
        steps_buy.login()
        # 进入普通采购单页面
        steps_buy.enter_buy_op_page()
        # 进入新建单据界面
        steps_buy.enter_new_op_frame()
        # 输入供应商
        steps_buy.input_supplier()
        # 输入仓库
        steps_buy.input_warehouse()
        # 输入合同协议
        steps_buy.input_protocol()
        # 输入业务员员
        steps_buy.input_businessman()
        # 添加商品
        steps_buy.add_merchandise()
        # 商品明细处理
        steps_buy.detail_proc()
        # 订单保存处理
        steps_buy.save_proc()
        # 订单提交
        steps_buy.submit_proc()
        time.sleep(15)