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 timeout argument for setting Page.timeout before clicking. For example scroll_down_and_click_save(timeout=3) does following actions: 1. maximizing the window 2. scrolling down to bottom of the window 3. set explicit wait for the save button for 3 seconds (default timeout of Page is 10)
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.6b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3d9431ef9b42fa3d0f2e1e3f4b2645bc085d9ee095f1779d3d5a29b0c73cfe |
|
MD5 | 02237cfe8fb99c3d8498825e52555092 |
|
BLAKE2b-256 | c12857748c6044cd1476bd262fb36eef0701b16356d6bc4f5dc30e96d8e201b2 |
Hashes for extended_selenium_page_factory-0.6b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9db0bef795acaf7df5f8ab57715066cba8f08ccb53e7e83fb9191befc35669be |
|
MD5 | e992ec8c3dc039b844857766ecbb7727 |
|
BLAKE2b-256 | 89537be7471c2205128629b55f0f069d8fbe56b8c6c547f121931caf59f8e866 |