test_body_page.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @File : login_page.py
  5. @Time : 2024/11/13 20:47:19
  6. @Author : dulip3ng
  7. @Version : 1.0
  8. @Desc : None
  9. '''
  10. import pytest
  11. from playwright.sync_api import Page
  12. @pytest.fixture(scope="module", autouse=True)
  13. def open_bill(page: Page, login_page, home_page):
  14. page.goto("http://10.200.0.222/k3cloud/html5/")
  15. login_page.login('正式数据库', '杜立朋', 'lt_k31233')
  16. home_page.search_bill("销售订单")
  17. def test_click_button(page, body_page):
  18. body_page.click_button("新增行")
  19. def test_click_sub_button(page, body_page):
  20. body_page.click_button("新增行", "插入行")
  21. def test_get_row_count(page, body_page):
  22. row_count = body_page.get_row_count()
  23. assert row_count == "3"
  24. def test_set_value(page, body_page):
  25. body_page.set_value("物料编码", "T15B-DX14000843", 1)
  26. body_page.set_value("客户款式号", "123123", 1)
  27. body_page.set_value("生产月份", "9", 1)
  28. def test_get_value(page, body_page):
  29. assert body_page.get_value("物料编码", 1) == "T15B-DX14000843"
  30. assert body_page.get_value("客户款式号", 1) == "123123"
  31. assert body_page.get_value("生产月份", 1) == "9"
  32. def test_click_line(page, body_page):
  33. body_page.click_line(2)
  34. def test_set_checked(page, body_page):
  35. body_page.set_checked("控制发货数量", 1)
  36. def test_change_sheet(page, body_page):
  37. body_page.change_sheet("物料数据")
  38. def test_set_text_in_body_head(page, body_page):
  39. body_page.set_text_in_body_head("面料规格", "123123")
  40. def test_set_select_in_body_head(page, body_page):
  41. body_page.set_select_in_body_head("货主类型", "供应商")
  42. def test_set_base_in_body_head(page, body_page):
  43. body_page.set_base_in_body_head("面料来源", "客供免费")
  44. def test_get_base_in_body_head(page, body_page):
  45. assert body_page.get_base_in_body_head("面料来源") == "客供免费"
  46. def test_get_text_in_body_head(page, body_page):
  47. assert body_page.get_text_in_body_head("面料规格") == "123123"
  48. def test_get_select_in_body_head(page, body_page):
  49. assert body_page.get_select_in_body_head("货主类型") == "供应商"