From 12739eca8a667a63f0f64f88f16b5fe89c8d173c Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Thu, 10 Oct 2024 20:05:54 +0530 Subject: [PATCH] add airgun support for parsing package details page link (cherry picked from commit 36d08c82dcaa5a852e131a4b5880bfb44205ffb8) --- airgun/entities/package.py | 10 ++++++++++ airgun/views/package.py | 1 + 2 files changed, 11 insertions(+) diff --git a/airgun/entities/package.py b/airgun/entities/package.py index 23c798882..16b00c550 100644 --- a/airgun/entities/package.py +++ b/airgun/entities/package.py @@ -32,6 +32,16 @@ def read(self, entity_name, repository='All Repositories', widget_names=None): view = self.navigate_to(self, 'Details', entity_name=entity_name, repository=repository) return view.read(widget_names=widget_names) + def click_install_on_link(self, entity_name, repository='All Repositories'): + """Click on host link 'Installed On' which is present on Package detail tab + + :param str entity_name: the package name to read. + :param str repository: repository name to select when searching for the + package. + """ + view = self.navigate_to(self, 'Details', entity_name=entity_name, repository=repository) + view.install_on_host_link.click() + @navigator.register(PackageEntity, 'All') class ShowAllPackages(NavigateStep): diff --git a/airgun/views/package.py b/airgun/views/package.py index 0f795ce01..51e2260de 100644 --- a/airgun/views/package.py +++ b/airgun/views/package.py @@ -51,6 +51,7 @@ def is_displayed(self): class PackageDetailsView(BaseLoggedInView): breadcrumb = BreadCrumb() + install_on_host_link = Text(locator='*//span[contains(@ng-show, "installedPackageCount")]') @property def is_displayed(self):