123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- '''
- @File : generate_bill_page.py
- @Time : 2025/01/04 08:52:10
- @Author : dulip3ng
- @Version : 1.0
- @Desc : None
- '''
- from playwright.sync_api import Page
- from pages.base_page import BasePage
- from pages.body_page import BodyPage
- from pages.head_page import HeadPage
- class GenerateBillPage(BasePage):
- """
- 生成单据页面对象(单据分单下推时弹出)
- """
- def __init__(self, page: Page, locator, head_page:HeadPage, body_page:BodyPage):
- super().__init__(page)
- self.locator = locator
- self.head_page = head_page
- self.body_page = body_page
- def click_button(self, button_name:str):
- """
- 点击菜单按钮,如”生成单据“
- :param button_name: 按钮名称
- :return:
- """
- self.page.locator(self.locator.BUTTON_ARGS_LOC % button_name).click()
- def click_line(self, row_no:int):
- """
- 点击行,以便切换生成的单据信息
- :param row_no: 行号,从1开始
- :return:
- """
- self.page.locator(self.locator.LINE_NO_ARGS_LOC % (row_no-1)).click()
|