#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @File : test_base_page.py @Time : 2024/12/03 08:27:43 @Author : dulip3ng @Version : 1.0 @Desc : None ''' from common.condition_row import ConditionRow def test_get_error_message(head_page, filter_page, list_page, push_page, home_page): home_page.search_bill("销售订单列表") list_page.click_button("过滤") cond1 = ConditionRow(1, "单据编号", "XSDD2411020024") filter_page.filter(cond1) list_page.check_line_by_rows(1) list_page.click_button("下推") push_page.push_draw_bill("出口合同") assert "不符合下推条件" in list_page.get_error_message() def test_get_error_message_detail(head_page, filter_page, list_page, push_page): list_page.click_button("下推") push_page.push_draw_bill("出口合同") assert "1、不能选择内销订单!" in list_page.get_error_message_detail() def test_get_hint_message(list_page, head_page): list_page.open_bill_by_row(1) head_page.click_button("保存") assert "单据编号为“XSDD2411020024”的销售订单,保存成功!" == head_page.get_hint_message("确定") def test_get_multi_error_message(head_page, home_page): home_page.search_bill("销售订单") head_page.click_button("保存") assert "[基本信息.贸易国别] 是必填项,不能为空!" in head_page.get_multi_error_message() home_page.close_all_opening_bills() def test_get_multi_error_message2(list_page, head_page, home_page, filter_page): home_page.search_bill("销售订单列表") list_page.click_button("过滤") cond1 = ConditionRow(1, "单据编号", "XSDD2411020023", logic="或者") cond2 = ConditionRow(2, "单据编号", "XSDD2411020024") filter_page.filter(cond1, cond2) list_page.check_line_by_rows(1, 7) list_page.click_button("删除") list_page.get_hint_message("是") assert "删除:XSDD2411020023不允许删除已经下推的数据行" in list_page.get_multi_error_message()