airgun.views.audit

Module Contents

Classes

AuditEntry

View is a kind of abstract widget that can hold another widgets. Remembers the order,

AuditsView

Base view for Satellite pages

class airgun.views.audit.AuditEntry(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 or widgetastic.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.

ROOT = .//div[@id='audit-list']/div/div[contains(@class, 'list-group-item')]
user
action_type
resource_type
resource_name
created_at
expander
affected_organization
affected_location
action_summary
comment
property expanded
read()

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

Returns

A dict of widget_name: widget_read_value where the values are retrieved using the Widget.read().

fill(values)

Implementation of form filling.

This method goes through all widgets defined on this view one by one and calls their fill methods appropriately.

None values will be ignored.

It will log any skipped fill items. It will log a warning if you pass any extra values for filling.

It will store the fill value in last_fill_data. The data will be “deflattened” to ensure uniformity.

Parameters

values – A dictionary of widget_name: value_to_fill.

Returns

bool if the fill changed any value.

class airgun.views.audit.AuditsView(parent, logger=None, **kwargs)

Base view for Satellite pages

title
searchbox
entry
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

bool

search(query)