widgetastic_patternfly4.donutchart module

class widgetastic_patternfly4.donutchart.DonutChart(parent, id=None, locator=None, logger=None)

Bases: widgetastic.widget.base.View

Represents the Donut Chart from Patternfly 4 (https://www.patternfly.org/v4/documentation/react/charts/chartdonut)

BASE_LOCATOR = './/div[@id={}]'
ROOT

ParametrizedString modified to return instances of smartloc.Locator

donut

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

legend

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class widgetastic_patternfly4.donutchart.DonutCircle(parent, logger=None, **kwargs)

Bases: widgetastic.widget.base.View

LABELS_LOCATOR = "./*[name()='svg']/*[name()='text']/*[name()='tspan']"
ROOT = ".//div[*[name()='svg'][*[name()='text'] and not(*[name()='rect'])]]"
labels

Returns a list of labels

class widgetastic_patternfly4.donutchart.DonutLegend(parent, logger=None, **kwargs)

Bases: widgetastic.widget.base.View

ROOT = ".//*[name()='g'][2]"
all_items

value}

Type:Returns a list of all items, arranged as {label
item

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class widgetastic_patternfly4.donutchart.DonutLegendItem(parent, logger=None, **kwargs)

Bases: widgetastic.widget.base.ParametrizedView, widgetastic.widget.base.ClickableMixin

ALL_ITEMS = ".//*[name()='text']/*[name()='tspan']"
LEGEND_ITEM_REGEX = re.compile('(.*?): ([\\d]+)')
PARAMETERS = ('label_text',)
ROOT

ParametrizedString modified to return instances of smartloc.Locator

classmethod all(browser)

Returns a list of all items

label

Returns the label of a DonutLegendItem as a string

value

Returns the value of a DonutLegendItem as a string