#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@File    :   test_push_page.py
@Time    :   2024/11/28 16:47:19
@Author  :   dulip3ng
@Version :   1.0
@Desc    :   None
'''
import time

import pytest
from playwright.sync_api import Page


@pytest.fixture(scope="module", autouse=True)
def open_bill(page: Page, login_page, home_page, list_page):
    page.goto("http://10.200.0.222/k3cloud/html5/")
    login_page.login('正式数据库', '杜立朋', 'lt_k31233')
    home_page.search_bill("销售订单列表")

def test_push_bill(page: Page, list_page, push_page, home_page):
    list_page.check_line_by_rows(1)
    list_page.click_button("下推")
    push_page.push_draw_bill("生产订单", "犀牛销售订单2生产订单", "直接入库-普通生产", "制衣事业部")
    home_page.close_bill_by_name("生产订单")
    home_page.get_warning_message("否")

def test_push_bill_no_param(page, list_page, push_page, home_page):
    list_page.click_button("下推")
    push_page.push_draw_bill("生产订单")

