Skip to content

Commit

Permalink
Add Facts View (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 authored Jun 19, 2024
1 parent 77e8ef2 commit a6238d7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from airgun.entities.host import HostEntity
from airgun.navigation import NavigateStep, navigator
from airgun.views.fact import HostFactView
from airgun.views.host_new import (
AllAssignedRolesView,
EditAnsibleRolesView,
Expand Down Expand Up @@ -950,6 +951,15 @@ def remediate_with_insights(
view = RemediationView(self.browser)
view.remediate.click()

def get_host_facts(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
self.browser.plugin.ensure_page_safe()
view.wait_displayed()
self.browser.wait_for_element(view.dropdown, exception=False)
view.dropdown.item_select('Facts')
host_facts_view = HostFactView(self.browser)
return host_facts_view.table.read()


@navigator.register(NewHostEntity, 'NewDetails')
class ShowNewHostDetails(NavigateStep):
Expand Down
20 changes: 20 additions & 0 deletions airgun/views/fact.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from widgetastic.widget import Table, Text
from widgetastic_patternfly import BreadCrumb

from airgun.views.common import BaseLoggedInView, SearchableViewMixinPF4


class HostFactView(BaseLoggedInView, SearchableViewMixinPF4):
breadcrumb = BreadCrumb()

table = Table(
'.//table',
column_widgets={
'Name': Text("./a"),
},
)

@property
def is_displayed(self):
breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
return breadcrumb_loaded and self.breadcrumb.read().startswith('Facts Values')

0 comments on commit a6238d7

Please sign in to comment.