Selenium/appium-based Page Objects test library.


Keywords
appium, pageobjects, playwright, python, selenium
License
BSD-3-Clause
Install
pip install poium==1.2.0

Documentation

Page Objects design pattern test library; support selenium、appium、playwright, etc

Page Objects 设计模式测试库;支持 selenium、appium、playwright 等。

Features

  • 极简的Page层的元素定义
  • 对原生 API 无损
  • 支持 logger 日志

支持库:

Installation

pip install:

> pip install poium

If you want to keep up with the latest version, you can install with github repository url:

> pip install -U git+https://github.com/SeldomQA/poium.git@master

Demo

通过下面的例子,体会Page Objects 设计模式如此简单。

from poium import Page, Element
from selenium import webdriver


class BaiduIndexPage(Page):
    search_input = Element(name='wd')
    search_button = Element(id_='su')


driver = webdriver.Chrome()
page = BaiduIndexPage(driver)
page.open("https://www.baidu.com")

page.search_input.send_keys("poium") 
page.search_button.click()

driver.quit()

更多例子,请点击这里

Documentation

在开使用poium前,请快速阅读下面的文档。

other:

Old version

  • poium < 0.6.0

参考文档

  • poium>=0.6.0, <1.0.0

参考文档

Project History

poium 参考page-objects,他项目已经不再维护,原项目代码虽然只有100多行,但设计非常精妙。本项目在此基础上进行开发。

selenium-page-objects是poium的前身,为了简化项目名称,改名为poium。po 取自 Page Object 首字母, ium 取自selenium/appium 共同后缀。