Metadata-Version: 2.1
Name: anna-lib
Version: 0.0.4
Summary: selenium interface
Home-page: https://github.com/patrikpihlstrom/anna-lib
Author: Patrik Pihlstrom
Author-email: patrik.pihlstrom@gmail.com
License: UNKNOWN
Description: ## anna-lib
        The purpose of this package is to simplify the use of selenium.
        
        ### requirements
        [selenium](https://pypi.org/project/selenium/),
        
        ### installation
        ```bash
        $ pip install anna-lib
        ```
        
        ### usage
        ```python
        from anna_lib.selenium import driver, events, assertions
        
        
        result = []
        firefox = driver.create(driver='firefox', headless=True)
        
        firefox.get('http://example.com/')
        events.click(driver=firefox, target='a[href="http://www.iana.org/domains/example"]')
        
        result.append(assertions.current_url_is(firefox, 'http://www.iana.org/domains/example'))
        ```
        
        #### driver
        Use this module to create a webdriver based on a set of options:
        
        | param  | type | required | values | default value |
        |--------|------|----------|-------|----------------|
        | driver | string | yes | 'firefox' or 'chrome' for now | 'firefox' |
        | headless | bool | no | True or False | False |
        | resolution | tuple | no | (width, height) | (1920, 1080) |
        
        #### events
        Use this module to interact with pages. Each event requires a driver & a target, with the exception being the ```send_keys``` event which also requires a value.
        The target is treated as a css selector unless it starts with ```'$xpath'```, in which case it is of course treated as an xpath selector.
        ```python
        from anna_lib.selenium import events, driver
        firefox = driver.create('firefox', headless=True)
        
        events.click(driver=firefox, target='#search')
        events.send_keys(driver=firefox, target='#search', value='search terms')
        events.submit(driver=firefox, target='#search')
        events.hover(driver=firefox, target='$xpath//div.result/a')
        events.scroll_to(driver=firefox, target='#thing')
        events.switch_to(driver=firefox, target='iframe')
        ```
        
        #### assertions
        
        
        
Platform: UNKNOWN
Description-Content-Type: text/markdown
