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

Added entity that returns counts of the errata types #1337

Merged
Merged
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
24 changes: 24 additions & 0 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,30 @@ def get_errata_by_type(self, entity_name, type):
view.content.errata.table.wait_displayed()
return view.read(widget_names="content.errata.table")

def get_errata_type_counts(self, entity_name):
"""
Get errata counts for each type of errata on selected host.

Args:
entity_name: Name of the host.
Returns:
errata_counts (dict): Dictionary with counts of each type of errata.
"""

errata_types = ['Security', 'Bugfix', 'Enhancement']
errata_counts = {type: 0 for type in errata_types}
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
view.content.errata.select()
for type in errata_types:
view.content.errata.wait_displayed()
view.content.errata.pagination.set_per_page(50)
view.content.errata.type_filter.fill(type)
self.browser.plugin.ensure_page_safe()
view.content.errata.table.wait_displayed()
errata_counts[type] = view.content.errata.table.row_count
return errata_counts

def apply_erratas(self, entity_name, search=None):
"""Apply available errata on selected host based on searchbar result.

Expand Down
Loading