airgun.views.common
¶
Module Contents¶
Classes¶
Base view for Satellite pages |
|
Alert screen which appears when switching organization while organization-specific entity is |
|
Regular primary level |
|
Represent vertical tabs that usually used in location and organization |
|
Regular primary level |
|
Secondary level Tab, typically 'List/Remove' or 'Add' sub-tab inside |
|
Group of |
|
'List/Remove' tab, part of |
|
Secondary level Tab, typically 'List/Remove' or 'Add' sub-tab inside |
|
View which allows assigning/unassigning some resources to entity. |
|
A variant of |
|
Default view for template entity editor that can be present for example |
|
Mixin which adds |
|
Mixin which adds |
|
Common view for task details screen. Can be found for most of tasks for |
|
Bookmark creation modal window, available via searchbox dropdown -> |
|
Template Input item view |
- class airgun.views.common.BaseLoggedInView(parent, logger=None, **kwargs)¶
Base view for Satellite pages
- taxonomies¶
- flash¶
- validations¶
- dialog¶
- logout¶
- current_user¶
- permission_denied¶
- select_logout()¶
logout from satellite
- class airgun.views.common.WrongContextAlert(parent, logger=None, **kwargs)¶
Alert screen which appears when switching organization while organization-specific entity is opened.
- message¶
- back¶
- class airgun.views.common.SatTab(parent, logger=None, **kwargs)¶
Regular primary level
Tab
.Usage:
@View.nested class mytab(SatTab): TAB_NAME = 'My Tab' @View.nested class subscriptions(SatTab): # no need to specify 'TAB_NAME', it will be set to 'Subscriptions' # automatically pass
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’- ROOT¶
- property is_displayed¶
Overrides the
Widget.is_displayed()
. The difference is that if the view does not have the root locator, it assumes it is displayed.- Returns
- read()¶
Do not attempt to read hidden tab contents
- class airgun.views.common.SatVerticalTab(parent, logger=None, **kwargs)¶
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(parent, logger=None, **kwargs)¶
Regular primary level
Tab
with dropdown.Usage:
@View.nested class mytab(SatTabWithDropdown): TAB_NAME = 'My Tab' SUB_ITEM = 'My Tab Dropdown Item'
- ROOT¶
- property is_displayed¶
Overrides the
Widget.is_displayed()
. The difference is that if the view does not have the root locator, it assumes it is displayed.- Returns
- read()¶
Do not attempt to read hidden tab contents
- class airgun.views.common.SatSecondaryTab(parent, logger=None, **kwargs)¶
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(parent, logger=None, **kwargs)¶
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(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(values=None)¶
Shortcut to pass the value to included
lce
airgun.widgets.LCESelector
widget. Usage remains the same asairgun.widgets.LCESelector
andwidgetastic.widget.ParametrizedView
required param is filled automatically from passed lifecycle environment’s name.Usage:
my_view.lce.fill({'PROD': True}) my_view.lce.fill({'PROD': 'Library'})
Value
True
orFalse
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
- read()¶
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(parent, logger=None, **kwargs)¶
‘List/Remove’ tab, part of
AddRemoveResourcesView
.- TAB_NAME = List/Remove¶
- searchbox¶
- remove_button¶
- table¶
- search(value)¶
Search for specific associated resource and return the results
- remove(value)¶
Remove specific associated resource
- fill(values)¶
Remove associated resource(s).
- read()¶
Return a list of associated resources
- class airgun.views.common.AddTab(parent, logger=None, **kwargs)¶
Secondary level Tab, typically ‘List/Remove’ or ‘Add’ sub-tab inside some primary tab.
Usage:
@View.nested class listremove(SatSecondaryTab): TAB_NAME = 'List/Remove'
- TAB_NAME = Add¶
- searchbox¶
- add_button¶
- table¶
- search(value)¶
Search for specific available resource and return the results
- add(value)¶
Associate specific resource
- fill(values)¶
Associate resource(s)
- read()¶
Return a list of available resources
- class airgun.views.common.AddRemoveResourcesView(parent, logger=None, **kwargs)¶
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(values)¶
Assign some resource(s).
- remove(values)¶
Unassign some resource(s).
- read()¶
Read all table values from both resource tables
- class airgun.views.common.AddRemoveSubscriptionsView(parent, logger=None, **kwargs)¶
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(parent, logger=None, **kwargs)¶
‘List/Remove’ tab, part of
AddRemoveResourcesView
.- table¶
- class airgun.views.common.TemplateEditor(parent, logger=None, **kwargs)¶
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¶
Mixin which adds
airgun.widgets.Search
widget andairgun.widgets.Search.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()¶
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
- class airgun.views.common.SearchableViewMixinPF4¶
Mixin which adds
airgun.widgets.Search
widget andairgun.widgets.Search.search()
to your view. It’s useful for _most_ entities list viewswhere searchbox and results table are present. Note that class which uses this mixin should have :attr: table attribute.
- searchbox¶
- blank_page¶
- is_searchable()¶
Verify that search procedure can be executed against specific page that is not blank
- class airgun.views.common.TaskDetailsView(parent, logger=None, **kwargs)¶
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(parent, logger=None, **kwargs)¶
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¶
- error_message¶
- public¶
- submit¶
- cancel¶
- class airgun.views.common.TemplateInputItem(parent, locator, logger=None)¶
Template Input item view
- class UserInputForm(parent, logger=None, **kwargs)¶
View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.
It looks like this:
class Login(View): user = SomeInputWidget('user') password = SomeInputWidget('pass') login = SomeButtonWidget('Log In') def a_method(self): do_something()
The view is usually instantiated with an instance of
widgetastic.browser.Browser
, which will then enable resolving of all of the widgets defined.- Parameters
parent – A parent
View
orwidgetastic.browser.Browser
additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the
additional_context
to pass in required variables that will allow you to detect this.
- advanced¶
- options¶
- description¶
- class FactValueForm(parent, logger=None, **kwargs)¶
View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.
It looks like this:
class Login(View): user = SomeInputWidget('user') password = SomeInputWidget('pass') login = SomeButtonWidget('Log In') def a_method(self): do_something()
The view is usually instantiated with an instance of
widgetastic.browser.Browser
, which will then enable resolving of all of the widgets defined.- Parameters
parent – A parent
View
orwidgetastic.browser.Browser
additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the
additional_context
to pass in required variables that will allow you to detect this.
- fact_name¶
- description¶
- class VariableValueForm(parent, logger=None, **kwargs)¶
View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.
It looks like this:
class Login(View): user = SomeInputWidget('user') password = SomeInputWidget('pass') login = SomeButtonWidget('Log In') def a_method(self): do_something()
The view is usually instantiated with an instance of
widgetastic.browser.Browser
, which will then enable resolving of all of the widgets defined.- Parameters
parent – A parent
View
orwidgetastic.browser.Browser
additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the
additional_context
to pass in required variables that will allow you to detect this.
- variable_name¶
- description¶
- class PuppetParameterForm(parent, logger=None, **kwargs)¶
View is a kind of abstract widget that can hold another widgets. Remembers the order, so therefore it can function like a form with defined filling order.
It looks like this:
class Login(View): user = SomeInputWidget('user') password = SomeInputWidget('pass') login = SomeButtonWidget('Log In') def a_method(self): do_something()
The view is usually instantiated with an instance of
widgetastic.browser.Browser
, which will then enable resolving of all of the widgets defined.- Parameters
parent – A parent
View
orwidgetastic.browser.Browser
additional_context – If the view needs some context, for example - you want to check that you are on the page of user XYZ but you can also be on the page for user FOO, then you shall use the
additional_context
to pass in required variables that will allow you to detect this.
- puppet_class_name¶
- puppet_parameter_name¶
- description¶
- remove_button¶
- name¶
- required¶
- input_type¶
- input_content¶