Keteparaha
[](https://gitter.im/aychedee/keteparaha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](http://badge.fury.io/py/keteparaha) [](https://travis-ci.org/aychedee/keteparaha) [](https://coveralls.io/r/aychedee/keteparaha?branch=master)
Keteparaha is a collection of tools to help when functional testing
It contains utilities that assist with tasks like running a browser in a headless environment, or checking that emails have been sent, or a file has been uploaded to a server, or common testing flow control like retrying or ignoring certain errors.
- copyright:
2015 by Hansel Dunlop.
- license:
GPLv3, see LICENSE for more details
BrowserTestCase
A browser test case for testing web applications. Subclass it and call the start_browser method with the name of the browser you want to test with. Closing the browser is handled automatically. For example:
from test_helpers import BrowserTestCase
class YourTestCase(BrowserTestCase):
- def setUp(self):
self.browser = self.start_browser(“Firefox”)
- def test_page_loads(self):
self.browser.get(‘127.0.0.1:8080’)
self.assertIn(“Hello, World”, self.body_text)
HeadlessBrowserTestCase
Requires XvFB to be installed (sudo apt-get install xvfb).
Designed for testing web applications on a headless server, probably running as part of continuous integration. Usage is exactly like the BrowserTestCase except that you won’t see a browser window open, everything should be done inside a virtual display.
The example below would run Firefox inside a virtual display with a width of 1200px and height of 900px.
from test_helpers import HeadlessBrowserTestCase
class YourTestCase(HeadlessBrowserTestCase):
- def setUp(self):
self.browser = self.start_browser(“Firefox”, size=(1200, 900))
Remaining keyword arguments to start browser will be passed down to the virtual display driver. But the other defaults are generally sensible.
Page
The Page class represents a page in your application and should be subclassed and extended. Pages are given urls. Whenever you click a component of your site and the URL changes the associated page will be returned. Creating an instance of a class will automatically visit that page.
from test_helpers import Page SERVER_URL = ‘http://your-site.com/{}’
- class LoginPage(Page):
url = SERVER_URL.format(‘login/’)
- def login(self, username, password):
self.click_button(“Login”) self.enter_text(“input[name=username]”, username) self.enter_text(“input[name=password]”, password) return self.click(“input[type=submit]”)
- class YourDashboard(Page):
url = SERVER_URL.format(‘dashboard/’)
- def assert_logged_in(self):
# Will raise an exception if component not present self.get_component(“.account-details”)
class YourTestCase(BrowserTestCase):
- def setUp(self):
self.start_browser()
- def test_login_works(self):
login_page = LoginPage(driver=self._driver) dashboard = login_page.login(‘username’, ‘password’)
dashboard.assert_logged_in()
The email module contains a imap client written to interact with gmail. This is especially useful if you use Google Apps and you’re running tests against it.
Flow Control
This module contains three functions that are intended to make flow control in testing situations less painful. They can be used as decorators. They are:
retry
ignore
fallback
Metadata
Release files for keteparaha 0.0.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| keteparaha-0.0.24.tar.gz | 11.6 kB | Without provenance | Details for keteparaha-0.0.24.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keteparaha-0.0.24-py2-none-any.whl | Python 2 | none | any | Details for keteparaha-0.0.24-py2-none-any.whl |
Total release size: 27.5 kB
Release files / keteparaha-0.0.24.tar.gz
| Download URL | keteparaha-0.0.24.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
134f5037c3f1efa6b86cc51dc0804f17da66865d7f93cc1d7e2a968150250694
|
|
BLAKE2b-256 checksum How to use checksums |
f236f533480c7cafd0fb4b6b102dad90b0e343cef15e5f661b2733d010f47e72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / keteparaha-0.0.24-py2-none-any.whl
| Download URL | keteparaha-0.0.24-py2-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
a2c484fa2fa86ec02db0441c357adf0f69a2e534cec7b1546c31579134e6f6ad
|
|
BLAKE2b-256 checksum How to use checksums |
05f07e9473bff17456c878f69690ee9425807afa861401023594eb5718be3f44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for keteparaha 0.0.24
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.