Giter Site home page Giter Site logo

poium's Introduction

基于 selenium/appium 的 Page Objects 设计模式测试库。

  • 极大的简化了Page层的元素定义。
  • 同时支持selenium和appium
  • 通过JavaScript扩展了selenium API
  • 对原生 API 无损

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

旧版本说明

poium < 0.6.0版本,主要提供了PagePageElementPageElementPageSelectPageWait等类。

参考文档

poium>=0.6.0, <1.0.0 版本,新增了NewPageElement类,用新的方式重新实现了PageElement类的大部分功能。 推荐使用NewPageElement 类。

参考文档

Sample

通过下面的例子,体会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.get("https://www.baidu.com")

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

driver.quit()

更多例子,请点击这里

Documentation

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

Project usage

  • 在基于pytest的自动化项目中的应用,请点击这里

  • 在基于seldom自动化测试框架的应用,请点击这里

Project History

参考项目:https://github.com/eeaston/page-objects

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

原项目名:https://pypi.org/project/selenium-page-objects/

本项目的核心是 Page Objects设计模式, 于是取了 PO,同时支持selenium/appium,于是取了 ium,那么新的项目命名为:poium

poium's People

Contributors

fnngj avatar defnngj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.