Extension for page factory.
Project description
An extension for PageFactory class (selenium-page-factory)
Main class:
ExtendedPageFactory(AssertPageMixin, NavLocatorsMixin, FormButtonsMixin, PageFactory)
Mixins:
AssertPageMixin (title) -> Checks if the current page has the same title as given.
NavLocatorsMixin (nav_locators) -> Provides a class attribute to be added to PageFactory attribute locators. This is a convenient way to add common navbar locators to several Page classes.
FormButtonsMixin (form_buttons) -> Provides a list of form inputs such as save (value='Save'), save_and_new (
value='Save & New'), delete (value='Delete') etc. as a class attribute (form_buttons=[save, save_and_new, delete]). If
a tuple is given the second value indicates the locator. For example if the cancel button is in reality a
link: <a href="">Cancel</a>
, add (cancel, "LINK_TEXT") to form_buttons.
This class provides click methods for each input or link according to form_buttons list: click_save(), click_save_and_new(), click_delete() and click_cancel() would be the click methods in our example case. Other methods with scrolling down before clicking a button (scroll_down_and_click_...) are also available for each form button. click_ and scroll_down_and_click_ methods accept a time argument for setting time.sleep before clicking. For example scroll_down_and_click_save(time=3) does following actions: 1. maximizing the window 2. scrolling down to bottom of the window 3. sleep for 3 seconds (important if scrolling down to bottom takes a while ...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for extended-selenium-page-factory-0.4b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 437a4704520611da58a5c0960eaa9bde8b488a18f4f5c3144bbc009c6fcf793d |
|
MD5 | 19c26d89c94485fc6ebeab78d397f204 |
|
BLAKE2b-256 | 21bc877cb719a99f0ddd6906f4be40710f3a19dd15e8a29a1a63805783502541 |
Hashes for extended_selenium_page_factory-0.4b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c3e1e584f081ca8d2653c31b3bcaa55a6de5401f863e64d1c6cf188242ff438 |
|
MD5 | b0b8ea9f11673cc67de48047ed05acd5 |
|
BLAKE2b-256 | 554ee3c3aca6a5a22840e94ef4cf8d46e83f40867034d8c1cb9ad18a80804514 |