test_base_page.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @File : test_base_page.py
  5. @Time : 2024/12/03 08:27:43
  6. @Author : dulip3ng
  7. @Version : 1.0
  8. @Desc : None
  9. '''
  10. from common.condition_row import ConditionRow
  11. def test_get_error_message(head_page, filter_page, list_page, push_page, home_page):
  12. home_page.search_bill("销售订单列表")
  13. list_page.click_button("过滤")
  14. cond1 = ConditionRow(1, "单据编号", "XSDD2411020024")
  15. filter_page.filter(cond1)
  16. list_page.check_line_by_rows(1)
  17. list_page.click_button("下推")
  18. push_page.push_draw_bill("出口合同")
  19. assert "不符合下推条件" in list_page.get_error_message()
  20. def test_get_error_message_detail(head_page, filter_page, list_page, push_page):
  21. list_page.click_button("下推")
  22. push_page.push_draw_bill("出口合同")
  23. assert "1、不能选择内销订单!" in list_page.get_error_message_detail()
  24. def test_get_hint_message(list_page, head_page):
  25. list_page.open_bill_by_row(1)
  26. head_page.click_button("保存")
  27. assert "单据编号为“XSDD2411020024”的销售订单,保存成功!" == head_page.get_hint_message("确定")
  28. def test_get_multi_error_message(head_page, home_page):
  29. home_page.search_bill("销售订单")
  30. head_page.click_button("保存")
  31. assert "[基本信息.贸易国别] 是必填项,不能为空!" in head_page.get_multi_error_message()
  32. home_page.close_all_opening_bills()
  33. def test_get_multi_error_message2(list_page, head_page, home_page, filter_page):
  34. home_page.search_bill("销售订单列表")
  35. list_page.click_button("过滤")
  36. cond1 = ConditionRow(1, "单据编号", "XSDD2411020023", logic="或者")
  37. cond2 = ConditionRow(2, "单据编号", "XSDD2411020024")
  38. filter_page.filter(cond1, cond2)
  39. list_page.check_line_by_rows(1, 7)
  40. list_page.click_button("删除")
  41. list_page.get_hint_message("是")
  42. assert "删除:XSDD2411020023不允许删除已经下推的数据行" in list_page.get_multi_error_message()