Skip to content

Commit

Permalink
add/update host_new entities & views (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 authored Oct 18, 2024
1 parent c64c8b0 commit 3a41047
Show file tree
Hide file tree
Showing 2 changed files with 18 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
5 changes: 5 additions & 0 deletions airgun/views/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ class roles(Tab):

assignedRoles = Text('.//a[contains(@href, "roles/all")]')
edit = Button(locator='.//button[@aria-label="edit ansible roles"]')
noRoleAssign = Text('.//h5[contains(@class, "pf-c-title pf-m-4xl")]')
table = Table(
locator='.//table[contains(@class, "pf-c-table")]',
column_widgets={'Name': Text('.//a')},
Expand Down Expand Up @@ -801,7 +802,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 3a41047

Please sign in to comment.