Dilium client¶
Client to request node and launch browser.
Dilium client¶
-
class
dilium_client.client.Client(dilium_url)[source]¶ Client for Dilium server to get node.
Parameters: dilium_url (str) – URL to dilium server. -
acquire_host(host, duration)[source]¶ Confirm host acquisition.
Parameters: - host (str) – Acquired host IP.
- duration (int) – Duration of acquisition in seconds.
-
browser_name¶ Name of browser on acquired host.
-
get_node(capabilities, duration=600)[source]¶ Get node with browser according to requested capabilities.
Parameters: - capabilities (dict) – Requested browser|node capabilities
- duration (int, optional) – Duration of acquisition in seconds.
Returns: Remote node with browser.
Return type:
-
host¶ Acquired host.
-
Dilium node¶
-
class
dilium_client.node.Node(client)[source]¶ Remote node with requested browser.
Parameters: client (Client) – Dilium client. -
capture_video(width, height)[source]¶ Capture video in context.
Parameters: - width (int) – Video width.
- height (int) – Video height.
-
download_video(file_path=None)[source]¶ Download captured video.
Parameters: file_path (str, optional) – Path to download video. Returns: Path of downloaded video. Return type: str
-
get_browser(*args, **kwgs)[source]¶ Get browser on node.
Parameters: - *args (optional) –
*argsof browser instantiation. - **kwgs (optional) –
**kwgsof browser instantiation.
- *args (optional) –
-
inside_xvfb(width, height)[source]¶ Launch virtual display in context.
Parameters: - width (int) – Screen width.
- height (int) – Screen height.
-
remote_exec¶ Remote ansible executor.
-
start_video(width, height)[source]¶ Start video capturing.
Parameters: - width (int) – Video width.
- height (int) – Video height.
-
start_xvfb(width, height)[source]¶ Start virtual display.
Parameters: - width (int) – Screen width.
- height (int) – Screen height.
-
video_path¶ Remote path to captured video.
-
webdriver_url¶ Launched webdriver url.
-
Dilium utils¶
Chrome wrapper¶
-
class
dilium_client._selenium.chrome.Chrome(node, chrome_options=None, desired_capabilities=None)[source]¶ Chrome wrapper for remote launching.
Parameters: - node (Node) – Remote node with chrome browser.
- chrome_options (object, optional) – Chrome options.
- desired_capabilities (dict, optional) – Desired chrome capabilities.
Dilium ansible executor¶
-
class
dilium_client._ansible.executor.Executor(*hosts, **options)[source]¶ Remote commands executor via ansible.
Parameters: - *hosts (optional) – Sequence of hosts where commands will be executed. As minimum one host should be passed
- **options (optional) – Options for ansible. Full sequence is described
in
Optionssection.
Dilium ansible options¶
-
class
dilium_client._ansible.options.Options(verbosity=None, inventory=None, listhosts=None, subset=None, module_paths=None, extra_vars=None, forks=None, ask_vault_pass=None, vault_password_files=None, new_vault_password_file=None, output_file=None, tags=None, skip_tags=None, one_line=None, tree=None, ask_sudo_pass=None, ask_su_pass=None, sudo=None, sudo_user=None, become=None, become_method=None, become_user=None, become_ask_pass=None, ask_pass=None, private_key_file=None, remote_user=None, connection=None, timeout=None, ssh_common_args=None, sftp_extra_args=None, scp_extra_args=None, ssh_extra_args=None, poll_interval=None, seconds=None, check=None, syntax=None, diff=None, force_handlers=None, flush_cache=None, listtasks=None, listtags=None, module_path=None)[source]¶ Options for ansible.
Dilium ansible callback¶
-
class
dilium_client._ansible.callback.Callback(bucket, display=None)[source]¶ Callback to process result of ansible execution.
Parameters: - bucket (list) – Bucket to put execution results.
- display (Display, optional) – Ansible Display.
-
class
dilium_client._ansible.callback.Response(host, status, task, payload)¶ -
__getnewargs__()¶ Return self as a plain tuple. Used by copy and pickle.
-
__getstate__()¶ Exclude the OrderedDict from pickling
-
__repr__()¶ Return a nicely formatted representation string
-
_asdict()¶ Return a new OrderedDict which maps field names to their values
-
classmethod
_make(iterable, new=<built-in method __new__ of type object at 0x9192c0>, len=<built-in function len>)¶ Make a new Response object from a sequence or iterable
-
_replace(_self, **kwds)¶ Return a new Response object replacing specified fields with new values
-
host¶ Alias for field number 0
-
payload¶ Alias for field number 3
-
status¶ Alias for field number 1
-
task¶ Alias for field number 2
-
Ansible module for avconv¶
Usage example:
task = {
'avconv': {
'rate': frame_rate,
'width': width,
'height': height,
'display': display,
'codec': codec,
'options': options,
'file': file_path
}
}
Ansible module for webdriver¶
Usage example:
task = {
'webdriver': {
'command': command,
'log_file': log_path,
'env': env
}
}
Ansible module for xvfb¶
Usage example:
task = {
'xvfb': {
'display': display,
'width': width,
'height': height,
'depth': depth,
'options': options
}
}