airgun.navigation

AirGun’s implementation of base navigation and navigate steps.

Module Contents

Classes

NavigateStep

AirGun's version of navmazing.NavigateStep with custom

Navigate

Wrapper around navmazing.Navigate which adds airgun browser as

Attributes

navigator

class airgun.navigation.NavigateStep(obj, navigate_obj, logger=None)

AirGun’s version of navmazing.NavigateStep with 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 VIEW class 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.AirgunBrowser and airgun.session.Session set as instance attributes self.context['entity'], self.browser and self.extra.session correspondingly.

Parameters
  • view_class (widgetastic.widget.View) – class of view to create

  • additional_context (dict optional) – any additional context you want to include. entity is 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_displayed property to determine whether navigation succeeded. If positional argument entity_name was passed and view has BreadCrumb widget, 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

bool

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 VIEW is set or None otherwise

class airgun.navigation.Navigate(browser=None)

Wrapper around navmazing.Navigate which adds airgun browser as class attribute.

For more information about Navigate please refer to navmazing docs.

airgun.navigation.navigator