#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@File    :   login_page.py
@Time    :   2024/11/21 08:56:19
@Author  :   dulip3ng
@Version :   1.0
@Desc    :   None
'''

import pytest
from playwright.sync_api import Page

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

def test_check_line_by_rows(page, list_page):
    list_page.check_line_by_rows(1)
    list_page.check_line_by_rows(2,3)

def test_get_value(page, list_page):
    value = list_page.get_value("衬衣订单号", 1)
    assert value is not None

def test_get_bill_no(page, list_page):
    value = list_page.get_bill_no(1)
    assert value is not None

def test_get_row_count(page, list_page):
    value = list_page.get_row_count()
    assert value is not None

def test_field_filter(page, list_page):
    list_page.field_filter("销售类别", "外销")

def test_check_line_by_field_value(page, list_page):
    list_page.check_line_by_field_value("销售类别", "外销")

def test_open_bill_by_row(page, list_page):
    list_page.open_bill_by_row(1)

def test_click_button(page, list_page, head_page, home_page):
    home_page.change_bill_tab("销售订单列表")
    list_page.click_button("刷新")
    list_page.click_button("业务查询", "预收查询")
