Skip to content

Commit

Permalink
[6.14.z]: Add Legacy content host UI support #850 (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanpliu authored Sep 7, 2023
1 parent e702588 commit f220146
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions airgun/entities/contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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')

0 comments on commit f220146

Please sign in to comment.