airgun.views.common

Module Contents

class airgun.views.common.BaseLoggedInView

Bases: widgetastic.widget.View

menu
taxonomies
flash
validations
current_user
read(self, widget_names=None)

Reads the contents of the view and presents them as a dictionary.

widget_names: If specified , will read only the widgets which names is in the list.

Returns:
A dict of widget_name: widget_read_value where the values are retrieved using the Widget.read().
class airgun.views.common.WrongContextAlert

Bases: widgetastic.widget.View

Alert screen which appears when switching organization while organization-specific entity is opened.

message
back
is_displayed
class airgun.views.common.SatTab

Bases: widgetastic_patternfly.Tab

Regular primary level Tab.

Usage:

@View.nested
class mytab(SatTab):
    TAB_NAME = 'My Tab'

Note that TAB_NAME is optional and if it’s absent - capitalized class name is used instead, which is useful for simple tab names like ‘Subscriptions’:

@View.nested
class subscriptions(SatTab):
    # no need to specify 'TAB_NAME', it will be set to 'Subscriptions'
    # automatically
    pass
ROOT
is_displayed
read(self)

Do not attempt to read hidden tab contents

class airgun.views.common.SatVerticalTab

Bases: airgun.views.common.SatTab

Represent vertical tabs that usually used in location and organization entities

Usage:

@View.nested
class mytab(SatVerticalTab):
    TAB_NAME = 'My Tab'
TAB_LOCATOR
class airgun.views.common.SatTabWithDropdown

Bases: widgetastic_patternfly.TabWithDropdown

Regular primary level Tab with dropdown.

Usage:

@View.nested
class mytab(SatTabWithDropdown):
    TAB_NAME = 'My Tab'
    SUB_ITEM = 'My Tab Dropdown Item'
ROOT
is_displayed
read(self)

Do not attempt to read hidden tab contents

class airgun.views.common.SatSecondaryTab

Bases: airgun.views.common.SatTab

Secondary level Tab, typically ‘List/Remove’ or ‘Add’ sub-tab inside some primary tab.

Usage:

@View.nested
class listremove(SatSecondaryTab):
    TAB_NAME = 'List/Remove'
ROOT
TAB_LOCATOR
class airgun.views.common.LCESelectorGroup

Bases: widgetastic.widget.ParametrizedView

Group of airgun.widgets.LCESelector, typically present on page for selecting desired lifecycle environment.

Usage:

lce = View.nested(LCESelectorGroup)

#or

@View.nested
class lce(LCESelectorGroup):
    pass
ROOT = .//*[self::div or self::span][@path-selector='environments' or @path-selector='availableEnvironments']
PARAMETERS = ['lce_name']
LAST_ENV = .//div[contains(@class, 'path-selector')]/ul/li[last()]
lce
classmethod all(cls, browser)

Helper method which returns list of tuples with all LCESelector names (last available environment is used as a name). It’s required for read() to work properly.

fill(self, values=None)

Shortcut to pass the value to included lce airgun.widgets.LCESelector widget. Usage remains the same as airgun.widgets.LCESelector and widgetastic.widget.ParametrizedView required param is filled automatically from passed lifecycle environment’s name.

Example:

my_view.lce.fill({'PROD': True})

Value True or False means to set corresponding checkbox value to the last checkbox available in widget (last lifecycle environment). If you want to select different lifecycle environment within the same route - pass its name as a value instead:

my_view.lce.fill({'PROD': 'Library'})
read(self)

Shortcut which returns value of included lce airgun.widgets.LCESelector widget.

Note that returned result will be wrapped in extra dict due to widgetastic.widget.ParametrizedView nature:

{
    'DEV': {'Library': False, 'DEV': True},
    'QA': {'Library': False, 'IT': True},
    'PROD': {'Library': False, 'PROD': True},
}
class airgun.views.common.ListRemoveTab

Bases: airgun.views.common.SatSecondaryTab

‘List/Remove’ tab, part of AddRemoveResourcesView.

TAB_NAME = List/Remove
searchbox
remove_button
table
search(self, value)

Search for specific associated resource and return the results

remove(self, value)

Remove specific associated resource

fill(self, values)

Remove associated resource(s).

read(self)

Return a list of associated resources

class airgun.views.common.AddTab

Bases: airgun.views.common.SatSecondaryTab

TAB_NAME = Add
searchbox
add_button
table
search(self, value)

Search for specific available resource and return the results

add(self, value)

Associate specific resource

fill(self, values)

Associate resource(s)

read(self)

Return a list of available resources

class airgun.views.common.AddRemoveResourcesView

Bases: widgetastic.widget.View

View which allows assigning/unassigning some resources to entity. Contains two secondary level tabs ‘List/Remove’ and ‘Add’ with tables allowing managing resources for entity.

Usage:

@View.nested
class resources(AddRemoveResourcesView): pass
list_remove_tab
add_tab
add(self, values)

Assign some resource(s).

Parameters:or list values (str) – string containing resource name or a list of such strings.
remove(self, values)

Unassign some resource(s).

Parameters:or list values (str) – string containing resource name or a list of such strings.
read(self)

Read all table values from both resource tables

class airgun.views.common.AddRemoveSubscriptionsView

Bases: airgun.views.common.AddRemoveResourcesView

A variant of AddRemoveResourcesView for managing subscriptions. Subscriptions table has different structure - entity label is located in separate row apart from checkbox and other cells.

class list_remove_tab

Bases: airgun.views.common.ListRemoveTab

table
class add_tab

Bases: airgun.views.common.AddTab

table
class airgun.views.common.TemplateEditor

Bases: widgetastic.widget.View

Default view for template entity editor that can be present for example on provisioning template of partition table pages. It contains from different options of content rendering and ace editor where you can actually provide your inputs

Usage:

editor = View.nested(TemplateEditor)
ROOT = .//div[@id='editor-container']
rendering_options
import_template
fullscreen
editor
class airgun.views.common.SearchableViewMixin

Bases: widgetastic.widget.WTMixin

Mixin which adds airgun.widgets.Search widget and search() to your view. It’s useful for _most_ entities list views where searchbox and results table are present.

Note that class which uses this mixin should have :attr: table attribute.

searchbox
welcome_message
is_searchable(self)

Verify that search procedure can be executed against specific page. That means that we have search field present on the page and that page is not a welcome one

search(self, query)

Perform search using searchbox on the page and return table contents.

Parameters:query (str) – search query to type into search field. E.g. foo or name = "bar".
Returns:list of dicts representing table rows
Return type:list
class airgun.views.common.TaskDetailsView

Bases: airgun.views.common.BaseLoggedInView

Common view for task details screen. Can be found for most of tasks for various entities like Products, Repositories, Errata etc.

breadcrumb
action_type
user
started_at
finished_at
parameters
state
result
progressbar
details
class airgun.views.common.BookmarkCreateView

Bases: airgun.views.common.BaseLoggedInView

Bookmark creation modal window, available via searchbox dropdown -> Bookmark this search.

Has slightly different style for katello and foreman pages, thus some widgets have special locators.

ROOT = .//div[contains(@class, 'modal-dialog')]
title
name
query
public
submit
cancel
is_displayed
class airgun.views.common.TemplateInputItem

Bases: airgun.widgets.GenericRemovableWidgetItem

Template Input item view

class UserInputForm

Bases: widgetastic.widget.View

advanced
options
description
class FactValueForm

Bases: widgetastic.widget.View

fact_name
description
class VariableValueForm

Bases: widgetastic.widget.View

variable_name
description
class PuppetParameterForm

Bases: widgetastic.widget.View

puppet_class_name
puppet_parameter_name
description
remove_button
name
required
input_type
input_content