gambit-bromine


Namegambit-bromine JSON
Version 0.4.3 PyPI version JSON
download
home_pagehttps://github.com/dvarrazzo/bromine
SummaryPythonic web testing
upload_time2023-05-23 13:36:58
maintainer
docs_urlNone
authorDaniele Varrazzo
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Bromine: pythonic web testing

Bromine is a wrapper around [selenium] to allow writing testing in a terse and
*pythonic* rather that *java-esque* way.

[selenium]: https://www.seleniumhq.org/

Selenium is cool: you register browser to a hub, you ask browsers from a hub,
you use the browser, and you put it back. It works like magic.

Except if you want to use https. But who needs https these days?

Anyway, enough dissing well intentioned web testing systems. Let's talk bad
about bad testing system. You know what you have to do to wait for a page to
load after a get, and then check if an element is visible? The selenium docs
[will tell you](https://selenium-python.readthedocs.io/waits.html#explicit-waits):

```python
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# ...
driver.get("http://example.com")
element = WebDriverWait(driver, 10).until(
	EC.presence_of_element_located((By.ID, "myDynamicElement"))
)
```

I've been kind and I've stripped some boilerplate. If you are happy about
importing three objects from 4 levels of namespaces and create a wait object
and pass a 2-element tuple to the "convenience method"
`selenium.webdriver.support.expected_conditions.visibility_of_element_located`
for a thing you have to do pretty much every time you click on a link, please
stop reading here: type `pip install selenium` and off you go. The following
paragraph is only for people who think the above is unsatisfactory in Python.

Still reading? Sure?

Well, I'll be honest: what I prefer to do is:

```python
import bromine
browser = bromine.Browser(driver)
element = browser.get("http://example.com/").wait(id='myDynamicElement')
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dvarrazzo/bromine",
    "name": "gambit-bromine",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Daniele Varrazzo",
    "author_email": "daniele.varrazzo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c5/60/3907c80bb3bb13b24761f16ef608c61cd91bb46123c0712bfefeb150be64/gambit-bromine-0.4.3.tar.gz",
    "platform": null,
    "description": "# Bromine: pythonic web testing\n\nBromine is a wrapper around [selenium] to allow writing testing in a terse and\n*pythonic* rather that *java-esque* way.\n\n[selenium]: https://www.seleniumhq.org/\n\nSelenium is cool: you register browser to a hub, you ask browsers from a hub,\nyou use the browser, and you put it back. It works like magic.\n\nExcept if you want to use https. But who needs https these days?\n\nAnyway, enough dissing well intentioned web testing systems. Let's talk bad\nabout bad testing system. You know what you have to do to wait for a page to\nload after a get, and then check if an element is visible? The selenium docs\n[will tell you](https://selenium-python.readthedocs.io/waits.html#explicit-waits):\n\n```python\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n# ...\ndriver.get(\"http://example.com\")\nelement = WebDriverWait(driver, 10).until(\n\tEC.presence_of_element_located((By.ID, \"myDynamicElement\"))\n)\n```\n\nI've been kind and I've stripped some boilerplate. If you are happy about\nimporting three objects from 4 levels of namespaces and create a wait object\nand pass a 2-element tuple to the \"convenience method\"\n`selenium.webdriver.support.expected_conditions.visibility_of_element_located`\nfor a thing you have to do pretty much every time you click on a link, please\nstop reading here: type `pip install selenium` and off you go. The following\nparagraph is only for people who think the above is unsatisfactory in Python.\n\nStill reading? Sure?\n\nWell, I'll be honest: what I prefer to do is:\n\n```python\nimport bromine\nbrowser = bromine.Browser(driver)\nelement = browser.get(\"http://example.com/\").wait(id='myDynamicElement')\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Pythonic web testing",
    "version": "0.4.3",
    "project_urls": {
        "Homepage": "https://github.com/dvarrazzo/bromine"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5603907c80bb3bb13b24761f16ef608c61cd91bb46123c0712bfefeb150be64",
                "md5": "a83ce85e5ec705794378f6a7ae57458b",
                "sha256": "9d631b3b97b0ae41b05fdc9136e9e426252cfea8f9c6260822b7bd8a126f4d71"
            },
            "downloads": -1,
            "filename": "gambit-bromine-0.4.3.tar.gz",
            "has_sig": true,
            "md5_digest": "a83ce85e5ec705794378f6a7ae57458b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9984,
            "upload_time": "2023-05-23T13:36:58",
            "upload_time_iso_8601": "2023-05-23T13:36:58.368723Z",
            "url": "https://files.pythonhosted.org/packages/c5/60/3907c80bb3bb13b24761f16ef608c61cd91bb46123c0712bfefeb150be64/gambit-bromine-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-23 13:36:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dvarrazzo",
    "github_project": "bromine",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gambit-bromine"
}
        
Elapsed time: 0.08993s