We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`from poium import Page, PageElement from selenium import webdriver
class BaiduIndexPage(Page):
search_input = PageElement(css="#kw", describe="搜索框") search_button = PageElement(css="#su", describe="搜索按钮")
class CPCLoginPage(Page): login = PageElement(id_='id', describe='登录') pass
class ToutolPage(BaiduIndexPage, CPCLoginPage): pass
class WebAction(object):
page = ToutolPage(webdriver.Chrome()) # 动态传入类属性 @classmethod def with_click(cls, click_element): if hasattr(cls.page, click_element): getattr(cls.page, click_element).click() return cls @classmethod def with_input(cls): cls.page.search_input.send_keys('poium') return cls @classmethod def with_open(cls): cls.page.get('https://www.baidu.com') return cls
if name == 'main': weba = WebAction() weba.with_open().with_input().with_click('search_button')`
The text was updated successfully, but these errors were encountered:
感谢你提供的范例,请使用markdown 编写你的代码,这样更容易被别人看懂!😸
Sorry, something went wrong.
No branches or pull requests
`from poium import Page, PageElement
from selenium import webdriver
class BaiduIndexPage(Page):
class CPCLoginPage(Page):
login = PageElement(id_='id', describe='登录')
pass
class ToutolPage(BaiduIndexPage, CPCLoginPage):
pass
class WebAction(object):
if name == 'main':
weba = WebAction()
weba.with_open().with_input().with_click('search_button')`
The text was updated successfully, but these errors were encountered: