Skip to content

Commit

Permalink
Cherry-picking Ansible UI fixes (#815)
Browse files Browse the repository at this point in the history
Signed-off-by: Adarsh Dubey <[email protected]>
(cherry picked from commit d09210d)
  • Loading branch information
adarshdubey-star authored and web-flow committed Mar 7, 2023
1 parent 6ea8098 commit 8ac2f2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions airgun/entities/ansible_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ def imported_roles_count(self):
view = self.navigate_to(self, 'All')
# Before any roles have been imported, no table or pagination widget are
# present on the page
if not view.pagination.is_displayed:
return 0
else:
return int(view.total_imported_roles.read())
# Applying wait_displayed for the page to get rendered properly
view.wait_displayed()
return int(view.total_imported_roles.read())

def import_all_roles(self):
"""Import all available roles and return the number of roles
Expand Down
4 changes: 2 additions & 2 deletions airgun/views/ansible_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class AnsibleRolesView(BaseLoggedInView, SearchableViewMixin):
is present, without the search widget or table.
"""

title = Text("//h1")
title = Text("//h1[contains(normalize-space(.),'Ansible Roles')]")
import_button = Text("//a[contains(@href, '/ansible_roles/import')]")
submit = Button('Submit')
total_imported_roles = Text("//span[@class='pf-c-options-menu__toggle-text']/b[2]")
total_imported_roles = Text("//span[@class='pf-c-options-menu__toggle-text']//b[2]")
table = Table(
'.//table',
column_widgets={
Expand Down
4 changes: 2 additions & 2 deletions airgun/views/ansible_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
class AnsibleVariablesView(BaseLoggedInView, SearchableViewMixin):
"""Main Ansible Variables view"""

title = Text("//h1[contains(., text()='Ansible Variables')")
title = Text("//h1[contains(normalize-space(.),'Ansible Variables')]")
new_variable = Text("//a[contains(@href, '/ansible/ansible_variables/new')]")
total_variables = Text("//span[@class='pf-c-options-menu__toggle-text']/b[2]")
total_variables = Text("//span[@class='pf-c-options-menu__toggle-text']//b[2]")
table = SatTable(
'.//table',
column_widgets={
Expand Down

0 comments on commit 8ac2f2c

Please sign in to comment.