Skip to content

Commit

Permalink
Update get_host_facts to read a nested value (#1437)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9fef01a)
  • Loading branch information
shweta83 authored and web-flow committed Jun 25, 2024
1 parent 1c541d4 commit 5766074
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,13 +951,17 @@ def remediate_with_insights(
view = RemediationView(self.browser)
view.remediate.click()

def get_host_facts(self, entity_name):
def get_host_facts(self, entity_name, fact=None):
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)
if fact:
host_facts_view.searchbox.search(fact)
if host_facts_view.expand_fact_value.is_displayed:
host_facts_view.expand_fact_value.click()
return host_facts_view.table.read()


Expand Down
1 change: 1 addition & 0 deletions airgun/views/fact.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class HostFactView(BaseLoggedInView, SearchableViewMixinPF4):
'Name': Text("./a"),
},
)
expand_fact_value = Text("//div/a[contains(span/@class, 'glyphicon-plus')]")

@property
def is_displayed(self):
Expand Down

0 comments on commit 5766074

Please sign in to comment.