From 417155b64982ba8d0684a2c40adc4d213cfddff6 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:15:30 -0400 Subject: [PATCH] [6.14.z]: Add Legacy content host UI support #850 (#950) (#963) (cherry picked from commit f220146803ff1575049d5532c3a57e7e0e225ac0) Co-authored-by: yanpliu --- airgun/entities/contenthost.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/airgun/entities/contenthost.py b/airgun/entities/contenthost.py index f81cc5992..320a6c73d 100644 --- a/airgun/entities/contenthost.py +++ b/airgun/entities/contenthost.py @@ -7,6 +7,7 @@ from airgun.views.contenthost import ContentHostTaskDetailsView from airgun.views.contenthost import ErrataDetailsView from airgun.views.contenthost import SyspurposeBulkActionView +from airgun.views.host_new import NewHostDetailsView from airgun.views.job_invocation import JobInvocationCreateView from airgun.views.job_invocation import JobInvocationStatusView @@ -41,6 +42,13 @@ def read(self, entity_name, widget_names=None): view = self.navigate_to(self, 'Edit', entity_name=entity_name) return view.read(widget_names=widget_names) + def read_legacy_ui(self, entity_name, widget_names=None): + """Read host values from Host Details page, optionally only the widgets in widget_names + will be read. + """ + view = self.navigate_to(self, 'LegacyDetails', entity_name=entity_name) + return view.read(widget_names=widget_names) + def execute_package_action(self, entity_name, action_type, value, installed_via='rex'): """Execute remote package action on a content host. @@ -270,3 +278,26 @@ def step(self, *args, **kwargs): environment = kwargs.get('environment') self.parent.errata.search(errata_id, lce=environment) self.parent.errata.table.row(id=errata_id)['Id'].widget.click() + + +@navigator.register(ContentHostEntity, 'LegacyDetails') +class ShowContentHostDetails(NavigateStep): + """Navigate to Host Details page by clicking on necessary host name in the + table + Args: + entity_name: name of the host + """ + + VIEW = ContentHostDetailsView + + def prerequisite(self, *args, **kwargs): + return self.navigate_to(self.obj, 'All') + + def step(self, *args, **kwargs): + entity_name = kwargs.get('entity_name') + self.parent.search(entity_name) + self.parent.table.row(name=entity_name)['Name'].widget.click() + host_view = NewHostDetailsView(self.parent.browser) + host_view.wait_displayed() + host_view.dropdown.wait_displayed() + host_view.dropdown.item_select('Legacy content host UI')