diff --git a/airgun/entities/host_new.py b/airgun/entities/host_new.py index 67bfa2197..0f54829a2 100644 --- a/airgun/entities/host_new.py +++ b/airgun/entities/host_new.py @@ -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, @@ -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): diff --git a/airgun/views/fact.py b/airgun/views/fact.py new file mode 100644 index 000000000..c0081993a --- /dev/null +++ b/airgun/views/fact.py @@ -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')