Pre-release
This release is a pre-release and may not be stable for production use.
Grey Matter
Grey Matter reduces the time it takes to get up and running with Selenium.
Installation
Use pip to install greymatter as follows:
pip install greymatter
Usage (Examples)
Instantiating ChromeDriver
from greymatter import By, ChromeDriver, Keys
class Website(ChromeDriver):
def __init__(self):
super().__init__()
Finding WebElements
Arguments:
- by — a selenium locator strategy
- criteria — the search criteria to the locator strategy
foo = self.element_is_present(By.TAG_NAME, "input")
bar = self.element_is_clickable(By.XPATH, '//button[text()="bar"]')
Getting Field Values
Arguments:
- field — the name of the field
@property
def email_address(self):
return self.get_field_value("Email:")
Pressing Keys
Arguments:
- key — a selenium Keys object
- number_of_times — the number of times to press the key
self.press_key(Keys.TAB, 3)
Setting Field Values
Arguments:
- field — the name of the field
- value — the value to set the field to
def login(self, username, password):
self.set_field_value("Username:", "foo")
self.set_field_value("Password:", "bar")
Exceptions
Selenium's ElementNotInteractable, StaleElementReference, and Timeout exceptions can be imported from thursday as follows:
from greymatter.exceptions import ElementNotInteractableException, StaleElementReferenceException, TimeoutException
License
Release files for greymatter 0.1a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| greymatter-0.1a1.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| greymatter-0.1a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.4 kB
Release files / greymatter-0.1a1.tar.gz
| Download URL | greymatter-0.1a1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f7f734a0db7d8ea905ca3f980b26d642472963940fd445a04a574bb2168ea12
|
|
BLAKE2b-256 checksum How to use checksums |
217cc1048f9b777f83fa223fbdfe438ee4adf6249b2be86f49c90d4ca84fa2a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|
Release files / greymatter-0.1a1-py3-none-any.whl
| Download URL | greymatter-0.1a1-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62b6267280241f6801a87d4658d0126f29a2c7ff6595534c2613a48b150a1928
|
|
BLAKE2b-256 checksum How to use checksums |
3cb8df230a42a9ce02d41d5d547aab0a10916c409243cfab2d6e60714b53be32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|