diff --git a/airgun/entities/host_new.py b/airgun/entities/host_new.py index af914569e..667420e6d 100644 --- a/airgun/entities/host_new.py +++ b/airgun/entities/host_new.py @@ -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() diff --git a/airgun/views/fact.py b/airgun/views/fact.py index c0081993a..41685b8bb 100644 --- a/airgun/views/fact.py +++ b/airgun/views/fact.py @@ -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):