web-automation


Nameweb-automation JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryFramework built on top of Selenium framework for easy setup and config
upload_time2022-12-22 07:12:39
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2022 The Bored Genius Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords automation web framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Web Automation Framework

This is a project designed to minimize the setup and config of selenium and actions performed on elements

To use this library, create a snippet like below and populate the actions in the `run` method (remove the `pass` keyword)

```python
from web_automation.framework import Framework, Browser, By

class CustomClass(Framework):
    def run(self):
        pass

CustomClass(
    browser=Browser.CHROME,
    wait=10,
    headless=False,
    download_path=''
)
```

The Constructor accepts 4 params (only one mandatory: browser) which is applied across the automation session
- `browser: Browser` - The type of browser that you want to use, based on the [`Browser`](#browser-class) class
- `wait: int` - The wait time for an element before throwing `NoSuchElementException` exception, default value is `30` seconds
- `headless: bool` - Boolean option to set the automation to use the browser in headless mode (runs in background and no visible browser window), default value is `False`
- `download-path: str` - the path to store the downloaded files, default value is the system download folder

---

### Browser Class

The `Browser` enum from the module will provide the target browser required to run the automation.

The supported browsers are
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
- Safari

---

### Element selection

The HTML elements in the browser can be selected using one of the below attributes

- id
- name
- tag name
- class name
- css selector
- xpath
- link text
- partial link text

These selectors are provided using the `By` class (Selenium Class)

---

### SelectBy Class

There are different ways to select an option in the dropdown menu. The `SelectBy` enum has the below listed options to select the item in the dropdown

- Index
- Text
- Value

---

### Actions Available

The below methods are available in the Framework Class and should be used inside the run method prefixing `self.`


- `type(elem_type, elem_id, value, clear)` - used to type the `value` in the element
  - `elem_type: By` - one of the options from `By`
  - `elem_id: str` - element ID value based on the `elem_type`
  - `value: str` - value to be typed in the component
  - `clear: bool` - Boolean value to clear the element before typing


- `click(elem_type, elem_id)` - used to click the element
  - `elem_type: By` - one fo the options from `By`
  - `elem_id: str` - element ID value based on the `elem_type`


- `select(elem_type, elem_id, select_by, value)` - used to select an options from the dropdown input
  - `elem_type: By` - one of the options from `By`
  - `elem_id: str` - element ID value based on the `elem_type`
  - `select_by: SelectBy` - one of the options from `SelectBy`
  - `value: str` - value for the `SelectBy` option type


- `deselect(elem_type, elem_id)` - used to deselect a dropdown list
  - `elem_type: By` - one of the options from `By`
  - `elem_id: str` - element ID value based on the `elem_type`


- `check_if_exists(elem_type, elem_id)` - used to check if the mentioned element exists in the page
  - `elem_type: By` - one of the options from `By`
  - `elem_id: str` - element ID value based on the `elem_type`


- `navigate_to(url)` - used to navigate to the mentioned url
  - `url: str` - Target url to be navigated to


- `wait(wait_time)` - wait for mentioned time
  - `wait_time: int` - wait for the mentioned number of seconds

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "web-automation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "automation,web,framework",
    "author": "",
    "author_email": "The Bored Genius <th3b0redgenius@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1b/ba/95641cd9e8e1f2c42e1a31e4e0b76ae7ec2e5310aaac5c6f90d904c8d0be/web-automation-1.0.1.tar.gz",
    "platform": null,
    "description": "# Web Automation Framework\r\n\r\nThis is a project designed to minimize the setup and config of selenium and actions performed on elements\r\n\r\nTo use this library, create a snippet like below and populate the actions in the `run` method (remove the `pass` keyword)\r\n\r\n```python\r\nfrom web_automation.framework import Framework, Browser, By\r\n\r\nclass CustomClass(Framework):\r\n    def run(self):\r\n        pass\r\n\r\nCustomClass(\r\n    browser=Browser.CHROME,\r\n    wait=10,\r\n    headless=False,\r\n    download_path=''\r\n)\r\n```\r\n\r\nThe Constructor accepts 4 params (only one mandatory: browser) which is applied across the automation session\r\n- `browser: Browser` - The type of browser that you want to use, based on the [`Browser`](#browser-class) class\r\n- `wait: int` - The wait time for an element before throwing `NoSuchElementException` exception, default value is `30` seconds\r\n- `headless: bool` - Boolean option to set the automation to use the browser in headless mode (runs in background and no visible browser window), default value is `False`\r\n- `download-path: str` - the path to store the downloaded files, default value is the system download folder\r\n\r\n---\r\n\r\n### Browser Class\r\n\r\nThe `Browser` enum from the module will provide the target browser required to run the automation.\r\n\r\nThe supported browsers are\r\n- Google Chrome\r\n- Microsoft Edge\r\n- Mozilla Firefox\r\n- Safari\r\n\r\n---\r\n\r\n### Element selection\r\n\r\nThe HTML elements in the browser can be selected using one of the below attributes\r\n\r\n- id\r\n- name\r\n- tag name\r\n- class name\r\n- css selector\r\n- xpath\r\n- link text\r\n- partial link text\r\n\r\nThese selectors are provided using the `By` class (Selenium Class)\r\n\r\n---\r\n\r\n### SelectBy Class\r\n\r\nThere are different ways to select an option in the dropdown menu. The `SelectBy` enum has the below listed options to select the item in the dropdown\r\n\r\n- Index\r\n- Text\r\n- Value\r\n\r\n---\r\n\r\n### Actions Available\r\n\r\nThe below methods are available in the Framework Class and should be used inside the run method prefixing `self.`\r\n\r\n\r\n- `type(elem_type, elem_id, value, clear)` - used to type the `value` in the element\r\n  - `elem_type: By` - one of the options from `By`\r\n  - `elem_id: str` - element ID value based on the `elem_type`\r\n  - `value: str` - value to be typed in the component\r\n  - `clear: bool` - Boolean value to clear the element before typing\r\n\r\n\r\n- `click(elem_type, elem_id)` - used to click the element\r\n  - `elem_type: By` - one fo the options from `By`\r\n  - `elem_id: str` - element ID value based on the `elem_type`\r\n\r\n\r\n- `select(elem_type, elem_id, select_by, value)` - used to select an options from the dropdown input\r\n  - `elem_type: By` - one of the options from `By`\r\n  - `elem_id: str` - element ID value based on the `elem_type`\r\n  - `select_by: SelectBy` - one of the options from `SelectBy`\r\n  - `value: str` - value for the `SelectBy` option type\r\n\r\n\r\n- `deselect(elem_type, elem_id)` - used to deselect a dropdown list\r\n  - `elem_type: By` - one of the options from `By`\r\n  - `elem_id: str` - element ID value based on the `elem_type`\r\n\r\n\r\n- `check_if_exists(elem_type, elem_id)` - used to check if the mentioned element exists in the page\r\n  - `elem_type: By` - one of the options from `By`\r\n  - `elem_id: str` - element ID value based on the `elem_type`\r\n\r\n\r\n- `navigate_to(url)` - used to navigate to the mentioned url\r\n  - `url: str` - Target url to be navigated to\r\n\r\n\r\n- `wait(wait_time)` - wait for mentioned time\r\n  - `wait_time: int` - wait for the mentioned number of seconds\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 The Bored Genius  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Framework built on top of Selenium framework for easy setup and config",
    "version": "1.0.1",
    "split_keywords": [
        "automation",
        "web",
        "framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0e18a39b172150ad8b35054914275e1e",
                "sha256": "5dd9c84b10269574b02d4dd71292e9cd1e88af410dfbef4da2afca1f8a014fdb"
            },
            "downloads": -1,
            "filename": "web_automation-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e18a39b172150ad8b35054914275e1e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6447,
            "upload_time": "2022-12-22T07:12:37",
            "upload_time_iso_8601": "2022-12-22T07:12:37.529025Z",
            "url": "https://files.pythonhosted.org/packages/bb/5b/9e095a5bb8aaeaaa69536e9f3f79df8af9c4661ab2e1d26408451643cbcb/web_automation-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a1c5cacdadb5aaea500552d5cf236055",
                "sha256": "bb1856949a1bee377dd9d8f336e376119fbed47c59b3247b77b98c3b6bc8f4bc"
            },
            "downloads": -1,
            "filename": "web-automation-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a1c5cacdadb5aaea500552d5cf236055",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6133,
            "upload_time": "2022-12-22T07:12:39",
            "upload_time_iso_8601": "2022-12-22T07:12:39.287668Z",
            "url": "https://files.pythonhosted.org/packages/1b/ba/95641cd9e8e1f2c42e1a31e4e0b76ae7ec2e5310aaac5c6f90d904c8d0be/web-automation-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-22 07:12:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "web-automation"
}
        
Elapsed time: 0.02050s