arjuna.tpi.helper.arjtype module

Arjuna Types

Contains many general purpose type abstractions.

class arjuna.tpi.helper.arjtype.CIStringDict(pydict={})

Bases: arjuna.tpi.helper.arjtype._ArDict

Dictionary with case-insensitive keys.

Parameters

pydict – (Optional) A dict object.

class arjuna.tpi.helper.arjtype.Dictable

Bases: object

Abstract class. Any object which has a method as_dict is a Dictable.

as_dict() dict

Dictionary representation of this object.

Returns

A dict object.

class arjuna.tpi.helper.arjtype.NetworkPacketInfo(label, request, response, sub_network_packets)

Bases: tuple

label

Alias for field number 0

request

Alias for field number 1

response

Alias for field number 2

sub_network_packets

Alias for field number 3

class arjuna.tpi.helper.arjtype.Node(*, type, **nvpairs)

Bases: arjuna.tpi.helper.arjtype.nvpairs

property ntype
class arjuna.tpi.helper.arjtype.NotFound

Bases: object

To differentiate a not found object from Python’s None.

Always evalutes to False in a boolean context.

class arjuna.tpi.helper.arjtype.NotSet

Bases: object

To differentiate a not set object from Python’s None.

Always evalutes to False in a boolean context.

class arjuna.tpi.helper.arjtype.Offset(x, y)

Bases: arjuna.tpi.helper.arjtype.Point

Represents an offset from current Point on Screen in terms of XY coordinates.

Parameters
  • x – X co-ordinate

  • y – Y co-ordinate

class arjuna.tpi.helper.arjtype.OnceOnlyKeyCIStringDict(d={})

Bases: arjuna.tpi.helper.arjtype.CIStringDict

Dictionary with case-insensitive keys that allows for immutable key-value pairs.

Parameters
  • processor – A callable for processing the dictionary key.

  • pydict – (Optional) A dict object.

class arjuna.tpi.helper.arjtype.Point(x, y)

Bases: arjuna.tpi.helper.arjtype.Dictable

Represents an XY coordinate.

Parameters
  • x – X co-ordinate

  • y – Y co-ordinate

property location

Get XY co-ordinates as a tuple -> (x,y)

property x
property y
class arjuna.tpi.helper.arjtype.ProcessedKeyDict(*, processor: Callable, pydict: dict = {})

Bases: arjuna.tpi.helper.arjtype._ArDict

Dictionary with case-insensitive keys.

Parameters
  • processor – A callable for processing the dictionary key.

  • pydict – (Optional) A dict object.

class arjuna.tpi.helper.arjtype.Screen

Bases: object

Represents Gui Screen in terms of its XY coordinates.

static offset(x, y) arjuna.tpi.helper.arjtype.Offset

Create a Offset on Gui Screen in terms of its XY coordinates.

static xy(x: int, y: int) arjuna.tpi.helper.arjtype.Point

Create a Point on Gui Screen in terms of its XY coordinates.

class arjuna.tpi.helper.arjtype.attr(**attr_name_value)

Bases: arjuna.tpi.helper.arjtype.nvpair

A name-value pair with an associated optional tag name. It is an implementation of Dictable.

Keyword Arguments

attr_name_value – (Mandatory) Key-Value pair representing name and value of attribute.

Note

In case the attribute name conflicts with a Python language keyword, you can prefix it with ‘__’ i.e. two underscores. These underscores are removed while processing the attribute name.

For example, ‘__for’ will become ‘for’ to avoid conflict with Python’s for keyword.

class arjuna.tpi.helper.arjtype.axes(start)

Bases: object

Represents a DOM axes with a starting node and then as per axis objects sequence.

Parameters

start – Starting point as a node object

down(node)

Move towards node definition in the direction of Descendants.

left(node)

Move towards node definition in the direction of Previous Siblings.

right(node)

Move towards node definition in the direction of Forward Siblings.

up(node)

Move towards node definition in the direction of Ancestors.

class arjuna.tpi.helper.arjtype.bnode(**nvpairs)

Bases: arjuna.tpi.helper.arjtype.Node

class arjuna.tpi.helper.arjtype.fnode(**nvpairs)

Bases: arjuna.tpi.helper.arjtype.Node

class arjuna.tpi.helper.arjtype.node(**nvpairs)

Bases: arjuna.tpi.helper.arjtype.Node

class arjuna.tpi.helper.arjtype.nvpair(name, value)

Bases: arjuna.tpi.helper.arjtype.Dictable

Encapsulates a name-value pair. It is an implementation of Dictable.

Parameters
  • name – Name of this object

  • value – Value of this object

property name

Name of this object.

property value

Value of this object.

class arjuna.tpi.helper.arjtype.nvpairs(**nvpairs)

Bases: arjuna.tpi.helper.arjtype.Dictable

Encapsulates arbitrary name-value pairs. It is an implementation of Dictable.

Keyword Arguments

**nvpairs – Arbitrary name-value pairs passed as keyword arguments.

class arjuna.tpi.helper.arjtype.oneof(*choices)

Bases: object

Represents the given sequence as choices.

Parameters

choices – Arbitrary objects as choices.

as_list()
class arjuna.tpi.helper.arjtype.withx(**nvpairs)

Bases: arjuna.tpi.helper.arjtype.nvpairs

Encapsulates arbitrary name-value pairs. It is an implementation of Dictable.

This is to be used when using withx locators progammaitcally.

Keyword Arguments

**nvpairs – Arbitrary name-value pairs passed as keyword arguments.