Skip to content

DOM Loading Fixtures

conatus.utils.browser.dom.fixtures

Fixtures for DOM types.

These are useful for code snippets in docstrings.

example_chrome_dom

example_chrome_dom() -> ChromeDOM

Get an example Chrome DOM.

RETURNS DESCRIPTION
ChromeDOM

The example Chrome DOM.

Source code in conatus/utils/browser/dom/fixtures/__init__.py
def example_chrome_dom() -> ChromeDOM:
    """Get an example Chrome DOM.

    Returns:
        The example Chrome DOM.
    """
    this_directory = Path(__file__).parent
    file = this_directory / "example.com_dom.json"
    return ChromeDOM.from_json(file)

example_chrome_dom_inputtypes

example_chrome_dom_inputtypes() -> ChromeDOM

Get an example Chrome DOM with input and clickable elements.

RETURNS DESCRIPTION
ChromeDOM

The example Chrome DOM.

Source code in conatus/utils/browser/dom/fixtures/__init__.py
def example_chrome_dom_inputtypes() -> ChromeDOM:
    """Get an example Chrome DOM with input and clickable elements.

    Returns:
        The example Chrome DOM.
    """
    this_directory = Path(__file__).parent
    file = this_directory / "inputtypes.com_dom.json"
    return ChromeDOM.from_json(file)