• Stars
    star
    127
  • Rank 272,720 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created over 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Page Objects web testing pattern for Python

Page Objects for Python

Page Objects are a testing pattern for websites. Page Objects model a page on your site to provide accessors and methods for interacting with this page, both to reduce boilerplate and provide a single place for element locators.

This project is an implementation of this pattern for Python using Selenium webdriver. It is agnostic to test harnesses and designed to help you build up libraries of code to test your sites.

https://travis-ci.org/eeaston/page-objects.svg?branch=master

Documentation

https://page-objects.readthedocs.org

Quick Example

>>> from page_objects import PageObject, PageElement
>>> from selenium import webdriver
>>>
>>> class LoginPage(PageObject):
        username = PageElement(id_='username')
        password = PageElement(name='password')
        login = PageElement(css='input[type="submit"]')
>>>
>>> driver = webdriver.PhantomJS()
>>> driver.root_uri = "http://example.com"
>>> page = LoginPage(driver)
>>> page.get("/login")
>>> page.username = 'secret'
>>> page.password = 'squirrel'
>>> assert page.username.text == 'secret'
>>> page.login.click()

Installation

$ pip install page_objects

Project History

This was originally part of the pkglib project at http://github.com/ahlmss/pkglib, it has been forked to retain history.

More Repositories

1

dtale

Visualizer for pandas data structures
TypeScript
4,491
star
2

arctic

High performance datastore for time series and tick data
Python
3,031
star
3

ArcticDB

ArcticDB is a high performance, serverless DataFrame database built for the Python Data Science ecosystem.
C++
1,097
star
4

notebooker

Productionise & schedule your Jupyter Notebooks as easily as you wrote them.
Python
834
star
5

pytest-plugins

A grab-bag of nifty pytest plugins
Python
545
star
6

PythonTrainingExercises

Code to exercise your Python knowledge.
Python
254
star
7

dapr-sidekick-dotnet

Dapr Sidekick for .NET - a lightweight lifetime management component for Dapr
C#
172
star
8

mdf

Data-flow programming toolkit for Python
Python
161
star
9

PyBloqs

Python
146
star
10

pynorama

Natural Language Processing Visualization in Python
JavaScript
107
star
11

partialtesting

Run only the tests that are relevant for your changes
Python
74
star
12

jupyterlab-autoplot

Magical Plotting in JupyterLab
Python
63
star
13

okcli

An Oracle-DB command line client
Python
49
star
14

adaero

A platform for managing peer-to-peer feedback
Python
43
star
15

pkglib

Company-centric Python packaging and testing library
Python
39
star
16

prometheus-flashblade-exporter

Export metrics from Pure Storage FlashBlade to Prometheus
Go
29
star
17

openstack_load_leveller

Openstack Load Leveller / Load Balancer
Python
28
star
18

mockextras

Addon library for the python Mock library
Python
25
star
19

hubot-servicenow-tickets

a servicenow plugin for hubot
JavaScript
20
star
20

jenkins-blueprint-plugin

Build Jenkins projects according to a .jenkins.yml file in the repository.
Java
17
star
21

ftp-coredump

FTP core dump script and related Ansible roles
Shell
13
star
22

servicenow-lite

utility library for interacting with servicenow
JavaScript
11
star
23

hiveminder

Python
8
star
24

hexplode

Python
8
star
25

microbit

Information and examples about the BBC micro:bit
Python
5
star
26

pydata2022

3
star