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 Aug 27, 2024
1 parent 1cba2bb commit 5aaa69d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 2 additions & 3 deletions airgun/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from widgetastic_patternfly4.ouia import (
BaseSelect,
Button as PF4Button,
ContextSelector as OUIAContextSelector,
Dropdown,
)

Expand Down Expand Up @@ -909,8 +908,8 @@ def read(self, *args, **kwargs):


class ContextSelector(Widget):
CURRENT_ORG = OUIAContextSelector('OUIA-Generated-ContextSelector-1')
CURRENT_LOC = OUIAContextSelector('OUIA-Generated-ContextSelector-2')
CURRENT_ORG = '//div[@data-ouia-component-id="taxonomy-context-selector-organization"]'
CURRENT_LOC = '//div[@data-ouia-component-id="taxonomy-context-selector-location"]'
ORG_LOCATOR = '//div[@id="organization-dropdown"]//li[button[contains(.,{})]]'
LOC_LOCATOR = '//div[@id="location-dropdown"]//li[button[contains(.,{})]]'

Expand Down

0 comments on commit 5aaa69d

Please sign in to comment.