Skip to content

Commit

Permalink
add/update host_new entities & views
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 committed Oct 18, 2024
1 parent c64c8b0 commit cc6df9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,19 @@ def get_ansible_roles_modal(self, entity_name):
self.browser.plugin.ensure_page_safe()
return view.table.read()

def remove_single_ansible_role(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
view.ansible.roles.edit.click()
wait_for(lambda: view.ansible.roles.edit.click(), timeout=5)
edit_view = EditAnsibleRolesView(self.browser)
edit_view.wait_displayed()
actions = [edit_view.hostAssignedAnsibleRoles, edit_view.unselectRoles, edit_view.confirm]
for action in actions:
action.click()
wait_for(lambda: view.ansible.roles.noRoleAssign.is_displayed, timeout=5)

def enable_tracer(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
Expand Down
4 changes: 4 additions & 0 deletions airgun/views/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,11 @@ class EditAnsibleRolesView(View):
'.//span[contains(text(),"RedHatInsights.insights-client") or contains(text(),"theforeman.foreman_scap_client")]'
)
confirm = Button(locator='.//button[@aria-label="submit ansible roles"]')
hostAssignedAnsibleRoles = Text(
'.//button[@class="pf-c-dual-list-selector__item"]/span[1]//span[2]'
)
selectRoles = Button(locator='.//button[@aria-label="Add selected"]')
unselectRoles = Button(locator='.//button[@aria-label="Remove selected"]')


class ModuleStreamDialog(Pf4ConfirmationDialog):
Expand Down

0 comments on commit cc6df9b

Please sign in to comment.