cfme.utils.browser module

Core functionality for starting, restarting, and stopping a selenium browser.

class cfme.utils.browser.BrowserFactory(webdriver_class, browser_kwargs)[source]

Bases: object

close(browser)[source]
create(url_key)[source]
processed_browser_args()[source]
class cfme.utils.browser.BrowserManager(browser_factory)[source]

Bases: object

add_cleanup(callback)[source]
coerce_url_key(key)[source]
ensure_open(url_key=None)[source]
classmethod from_conf(browser_conf)[source]
open_fresh(url_key=None)[source]
quit()[source]
start(url_key=None)[source]
class cfme.utils.browser.Wharf(wharf_url)[source]

Bases: object

checkin()[source]
checkout()[source]
docker_id = None
class cfme.utils.browser.WharfFactory(webdriver_class, browser_kwargs, wharf)[source]

Bases: cfme.utils.browser.BrowserFactory

close(browser)[source]
create(url_key)[source]
processed_browser_args()[source]
class cfme.utils.browser.WithZoom(level)[source]

Bases: object

This class is a decorator that used to wrap function with zoom level. this class perform zoom by <level>, call the target function and exit by zooming back to the original zoom level.

Parameters:level (*) – int, the zooming value (i.e. -2 -> 2 clicks out; 3 -> 3 clicks in)
cfme.utils.browser.browser()[source]

callable that will always return the current browser instance

If None, no browser is running.

Returns:The current browser instance.
cfme.utils.browser.ensure_browser_open(url_key=None)[source]

Ensures that there is a browser instance currently open

Will reuse an existing browser or start a new one as-needed

Returns:The current browser instance.
cfme.utils.browser.quit()[source]

Close the current browser

Will silently fail if the current browser can’t be closed for any reason.

Note

If a browser can’t be closed, it’s usually because it has already been closed elsewhere.

cfme.utils.browser.start(url_key=None)[source]

Starts a new web browser

If a previous browser was open, it will be closed before starting the new browser

Args: