airgun.navigation¶
AirGun’s implementation of base navigation and navigate steps.
Module Contents¶
Classes¶
AirGun's version of |
|
Wrapper around |
Attributes¶
- class airgun.navigation.NavigateStep(obj, navigate_obj, logger=None)¶
AirGun’s version of
navmazing.NavigateStepwith custom implementations of navmazing.NavigateStep.am_i_here and navmazing.NavigateStep.go and ability to work with views.- VIEW¶
- view()¶
Cached property which returns instance of view, which was defined for current navigate step by
VIEWclass attribute.
- create_view(view_class, additional_context=None)¶
Method which creates an instance of view, defined by
view_class.Created instance will have references to
entity,airgun.browser.AirgunBrowserandairgun.session.Sessionset as instance attributesself.context['entity'],self.browserandself.extra.sessioncorrespondingly.- Parameters
view_class (widgetastic.widget.View) – class of view to create
additional_context (dict optional) – any additional context you want to include.
entityis set to current navigate step entity by default
- Returns
instance of view
- Return type
widgetastic.widget.View
- am_i_here(*args, **kwargs)¶
Describes if the navigation is already at the requested destination.
By default, airgun relies on view’s
is_displayedproperty to determine whether navigation succeeded. If positional argumententity_namewas passed and view hasBreadCrumbwidget, it will also ensure second location in breadcrumb is provided entity name.This method may be overridden on specific entity’s NavigateStep level for more complex logic if needed.
- Returns
whether navigator is at requested destination or not.
- Return type
- go(_tries=0, *args, **kwargs)¶
Wrapper around
navmazing.NavigateStep.go()which returns instance of view after successful navigation flow.- Returns
view instance if class attribute
VIEWis set orNoneotherwise
- class airgun.navigation.Navigate(browser=None)¶
Wrapper around
navmazing.Navigatewhich adds airgun browser as class attribute.For more information about
Navigateplease refer to navmazing docs.
- airgun.navigation.navigator¶