Skip to content

Commit

Permalink
Ansible UI fixes (#790)
Browse files Browse the repository at this point in the history
* add repository sets entities (#770)

* Ansible UI fixes

Signed-off-by: Adarsh Dubey <addubey@redhat.com>

Signed-off-by: Adarsh Dubey <addubey@redhat.com>
Co-authored-by: Peter Dragun <43444182+peterdragun@users.noreply.github.com>
  • Loading branch information
adarshdubey-star and peterdragun authored Dec 19, 2022
1 parent 6a2e121 commit 9e93ca1
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
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 9e93ca1

Please sign in to comment.