airgun.views.redhat_repository

Module Contents

Classes

AvailableRepositoryItem

The widget representation of Available repository item of an Available repository set.

AvailableRepositorySetWidget

The widget representation of Available repository set item.

EnabledRepositoryWidget

The widget representation of Enabled repository item.

RepositorySearchCategory

The category search selector, eg: Available, Enabled or Both.

RepositorySearchTypes

Repository content types dropdown for repository search.

RepositoryCategoryView

The base class view that represent the Available or Enabled Repository

RedHatRepositoriesView

The main Red Hat repositories view.

Functions

_wait_for_spinner(widget)

Wait for any spinner to disappear from widget

airgun.views.redhat_repository._wait_for_spinner(widget)

Wait for any spinner to disappear from widget

class airgun.views.redhat_repository.AvailableRepositoryItem(parent, locator, logger=None)

The widget representation of Available repository item of an Available repository set.

ENABLE_BUTTON = .//button
TEXT = .//span
property text

Return the text representation of this repository eg: architecture + OS version if available.

read()

Read this widget by return it’s text representation.

enable()

Enable this repository.

class airgun.views.redhat_repository.AvailableRepositorySetWidget(parent, locator, logger=None)

The widget representation of Available repository set item.

ITEM
EXPAND_BUTTON = .//div[contains(@class, 'expand')]
NAME = .//div[contains(@class, 'item-heading')]
LABEL = .//div[contains(@class, 'item-text')]
ITEMS = .//div[contains(@class, 'list-item-with-divider')]
property expand_button

Return the expand button element.

property expanded

Check whether this repository set is expanded or not.

expand()

Expand the repository set item section.

property name

Return the name displayed for this repository item

property label

Return the label displayed for this repository item

property items

Return all the items (available repositories) of this repository set.

read_items()

Read all the items (repositories) of this repository set

read()

Return the name and label of this repository.

enable(item)

Enable a repository of this repository set.

Parameters

item (str) – The arch and version (if available) of the repository.

class airgun.views.redhat_repository.EnabledRepositoryWidget(parent, locator, logger=None)

The widget representation of Enabled repository item.

ITEM
DISABLE_BUTTON = .//button
disable()

Disable this repository.

class airgun.views.redhat_repository.RepositorySearchCategory(parent, locator, logger=None)

The category search selector, eg: Available, Enabled or Both.

button
fill(item)

Selects Search Repository Category.

class airgun.views.redhat_repository.RepositorySearchTypes(parent, locator, logger=None)

Repository content types dropdown for repository search.

button
close()

Closes the dropdown list.

property selected_items

Returns a list of all dropdown selected items as strings.

select(items)

Selects Search Repository content types.

Parameters

items – The Repository content types required

fill(items)

Selects Search Repository content types

class airgun.views.redhat_repository.RepositoryCategoryView(parent, logger=None, **kwargs)

The base class view that represent the Available or Enabled Repository

Example html representation:

<div class="enabled-repositories-container">
    <h2>Enabled Repositories</h2>
    <div class="list-group list-view-pf list-view-pf-view">
        <div class="sticky-pagination sticky-pagination-grey">
        <div class="list-group-item list-view-pf-stacked">
            ...
        </div>
    </div>
ITEMS = ./div/div[contains(@class, 'list-group-item')]
ITEM_WIDGET
items(name=None, label=None)
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().

class airgun.views.redhat_repository.RedHatRepositoriesView(parent, logger=None, **kwargs)

The main Red Hat repositories view.

class available(parent, logger=None, **kwargs)

The base class view that represent the Available or Enabled Repository

Example html representation:

<div class="enabled-repositories-container">
    <h2>Enabled Repositories</h2>
    <div class="list-group list-view-pf list-view-pf-view">
        <div class="sticky-pagination sticky-pagination-grey">
        <div class="list-group-item list-view-pf-stacked">
            ...
        </div>
    </div>
ROOT = //div[contains(@class, 'available-repositories-container')]
ITEM_WIDGET
class enabled(parent, logger=None, **kwargs)

The base class view that represent the Available or Enabled Repository

Example html representation:

<div class="enabled-repositories-container">
    <h2>Enabled Repositories</h2>
    <div class="list-group list-view-pf list-view-pf-view">
        <div class="sticky-pagination sticky-pagination-grey">
        <div class="list-group-item list-view-pf-stacked">
            ...
        </div>
    </div>
ROOT = //div[contains(@class, 'enabled-repositories-container')]
ITEM_WIDGET
title
search_category
search_box
search_button
search_types
search_clear
recommended_repos
search(value, category='Available', types=None)

Search repositories.

Parameters
  • value (str) – The string to search by.

  • category (str) – The repository category to search, options: Available, Enabled, Both

  • types (list[str]) – (optional) The repository content types to refine the search

Returns

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