Skip to content

Commit

Permalink
fixes of puppet-related entities/views
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik authored and mshriver committed Apr 13, 2022
1 parent 2e047e8 commit 519a36a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions airgun/entities/configgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def delete(self, entity_name):
view = self.navigate_to(self, 'All')
view.searchbox.search(entity_name)
view.table.row(name=entity_name)['Actions'].widget.click(handle_alert=True)
view.dialog.confirm()
view.flash.assert_no_error()
view.flash.dismiss()

Expand Down
4 changes: 2 additions & 2 deletions airgun/entities/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_puppet_class_parameter_value(self, entity_name, name):
:param name: the parameter name.
"""
view = self.navigate_to(self, 'Edit', entity_name=entity_name) # type: HostEditView
return view.parameters.puppet_class_parameters.row(name=name)['Value'].widget.read()
return view.puppet_enc.puppet_class_parameters.row(name=name)['Value'].widget.read()

def set_puppet_class_parameter_value(self, entity_name, name, value):
"""Set Puppet class parameter value
Expand All @@ -233,7 +233,7 @@ def set_puppet_class_parameter_value(self, entity_name, name, value):
:param dict value: The parameter value
"""
view = self.navigate_to(self, 'Edit', entity_name=entity_name) # type: HostEditView
view.parameters.puppet_class_parameters.row(name=name).fill({'Value': value})
view.puppet_enc.puppet_class_parameters.row(name=name).fill({'Value': value})
view.submit.click()
view.validations.assert_no_errors()
view.flash.assert_no_error()
Expand Down
2 changes: 1 addition & 1 deletion airgun/entities/puppet_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def delete(self, value):
view = self.navigate_to(self, 'All')
view.search(value)
view.table.row(name=value)['Actions'].widget.fill('Delete')
self.browser.handle_alert()
view.dialog.confirm()
view.flash.assert_no_error()
view.flash.dismiss()

Expand Down
19 changes: 10 additions & 9 deletions airgun/views/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class host(SatTab):
inherit_puppet_environment = ToggleButton(
locator=".//div[label[@for='environment_id']]//button"
)
puppet_environment = FilteredDropdown(id='host_environment')
puppet_environment = FilteredDropdown(id='host_puppet_attributes_environment')
puppet_master = FilteredDropdown(id='host_puppet_proxy')
puppet_ca = FilteredDropdown(id='host_puppet_ca_proxy')
openscap_capsule = FilteredDropdown(id='host_openscap_proxy')
Expand Down Expand Up @@ -378,20 +378,21 @@ def before_fill(self, values=None):
)

@View.nested
class puppet_classes(SatTab):
TAB_NAME = 'Puppet Classes'
class puppet_enc(SatTab):
TAB_NAME = 'Puppet ENC'

config_groups = ConfigGroupMultiSelect(locator='.')
classes = PuppetClassesMultiSelect(locator='.')

@View.nested
class parameters(SatTab):
"""Host parameters tab"""

puppet_class_parameters = Table(
".//div[@id='inherited_puppetclasses_parameters']/table",
".//table[@id='puppet_klasses_parameters_table']",
column_widgets={'Value': PuppetClassParameterValue()},
)

@View.nested
class parameters(SatTab):
"""Host parameters tab"""

@View.nested
class global_params(SatTable):
def __init__(self, parent, **kwargs):
Expand Down Expand Up @@ -649,7 +650,7 @@ def is_displayed(self):
delete = Text("//a[@id='delete-button']")
audits_details = Text("//a[text()='Audits']")
facts_details = Text("//a[text()='Facts']")
yaml_dump = Text("//a[text()='YAML']")
yaml_dump = Text("//a[text()='Puppet YAML']")
yaml_output = Text("//pre")
content_details = Text("//a[text()='Content']")
recommendations = Text("//a[text()='Recommendations']")
Expand Down
2 changes: 1 addition & 1 deletion airgun/views/hostgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class host_group(SatTab):
lce = FilteredDropdown(id='hostgroup_lifecycle_environment')
content_view = FilteredDropdown(id='hostgroup_content_view')
content_source = FilteredDropdown(id='s2id_content_source_id')
puppet_environment = FilteredDropdown(id='hostgroup_environment')
puppet_environment = FilteredDropdown(id='hostgroup_puppet_attributes_environment')
deploy = FilteredDropdown(id='hostgroup_compute_resource')
puppet_master = FilteredDropdown(id='hostgroup_puppet_proxy')
puppet_ca = FilteredDropdown(id='hostgroup_puppet_ca_proxy')
Expand Down
2 changes: 1 addition & 1 deletion airgun/views/puppet_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PuppetEnvironmentTableView(BaseLoggedInView, SearchableViewMixin):
locator='.//table',
column_widgets={
'Name': Text(
".//a[starts-with(@href, '/environments/') and \
".//a[starts-with(@href, '/foreman_puppet/environments/') and \
contains(@href,'/edit')]"
),
'Actions': ActionsDropdown('./div[contains(@class, "btn-group")]'),
Expand Down

0 comments on commit 519a36a

Please sign in to comment.