Skip to content

Commit

Permalink
Add Facts View (SatelliteQE#1427) (SatelliteQE#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Jun 19, 2024
1 parent 39c4f6d commit de4e8c1
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 @@ -949,6 +950,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 de4e8c1

Please sign in to comment.