From 1abcc3db4eb0e18f31382a42a7265c2ec223048c Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Mon, 8 Apr 2024 13:37:50 +0530 Subject: [PATCH] redhat_repositories search box & button xpath, add wait_for in search --- airgun/entities/redhat_repository.py | 1 + airgun/views/redhat_repository.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/airgun/entities/redhat_repository.py b/airgun/entities/redhat_repository.py index 38e55508b..100c4932e 100644 --- a/airgun/entities/redhat_repository.py +++ b/airgun/entities/redhat_repository.py @@ -18,6 +18,7 @@ def search(self, value, category='Available', types=None): eg: RPM, OSTree ... """ view = self.navigate_to(self, 'All') + wait_for(lambda: view.search_box.is_displayed, timeout=10, delay=1) return view.search(value, category=category, types=types) def read(self, entity_name=None, category='Available', recommended_repo=None): diff --git a/airgun/views/redhat_repository.py b/airgun/views/redhat_repository.py index 2a96b04ba..80d5f8c9d 100644 --- a/airgun/views/redhat_repository.py +++ b/airgun/views/redhat_repository.py @@ -208,8 +208,12 @@ class RedHatRepositoriesView(BaseLoggedInView): title = Text("//h1[contains(., 'Red Hat Repositories')]") search_category = RepositorySearchCategory(".//div[button[@id='search-list-select']]") - search_box = TextInput(locator=".//input[@aria-label='Search input']") - search_button = Text(".//button[@aria-label='Search']") + search_box = TextInput( + locator='//*[@id="redhatRepositoriesPage"]//following::input[@aria-label="Search input"]' + ) + search_button = Text( + '//*[@id="redhatRepositoriesPage"]//following::button[@aria-label="Search"]' + ) search_types = RepositorySearchTypes(".//div[button[@data-id='formControlsSelectMultiple']]") search_clear = Text(".//span[@class = 'fa fa-times']") recommended_repos = Text(".//div[contains(@class, 'bootstrap-switch wrapper')]")