Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fetching of all errata entries from new host page, fix search of errata on legacy chost page #1374

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions airgun/entities/contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,18 @@ def install_errata(self, entity_name, errata_id, install_via='rex'):
return view.read()

def search_errata(self, entity_name, errata_id, environment=None):
"""Search for specific errata applicable for content host.
"""Search for specific errata applicable to content host.
Check the legacy Contenthost page -> Details -> Errata tab.

:param str entity_name: the content hosts name.
:param str errata_id: errata id or title, e.g. 'RHEA-2012:0055'
:param str optional environment: lifecycle environment to filter by.
"""
view = self.navigate_to(self, 'Edit', entity_name=entity_name)
view = self.navigate_to(self, 'LegacyDetails', entity_name=entity_name)
view.wait_displayed()
view.errata.search(errata_id, lce=environment)
view.errata.table.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.errata.table.read()

def read_errata_details(self, entity_name, errata_id, environment=None):
Expand Down
40 changes: 40 additions & 0 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,46 @@ def apply_package_action(self, entity_name, package_name, action):
view.flash.assert_no_error()
view.flash.dismiss()

def get_errata_table(
self,
entity_name,
installable=None,
severity=None,
search=None,
type=None,
):
"""Return the table of all errata entries, from Errata tab on selected host.
param: entity_name str: hostname to search for errata table

Optional: Filter by passing args (string):
param: installable str: filter errata by installability ('Yes' or 'No').
param: severity str: filter errata by severity.
param: search str: pass a search query to the searchbar, prior to reading.
param: type str: filter errata search by type.

note: all of the optional params being None, will result in no filtering.
"""
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
view.content.errata.select()
# optional: filter by params that are not None
if installable is not None:
assert installable == 'Yes' or 'No', (
'installable_filter expected None or str, "Yes" or "No".'
f' Got: {installable}, ({type(installable)}).'
)
view.content.errata.installable_filter.fill(installable)
if type is not None:
view.content.errata.type_filter.fill(type)
if severity is not None:
view.content.errata.severity_filter.fill(severity)
if search is not None:
view.content.errata.searchbar.fill(search)
# displayed the table with or without filters
view.content.errata.table.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.content.errata.table.read()

def get_errata_by_type(self, entity_name, type):
"""List errata based on type and return table"""
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
Expand Down
Loading