From 3971f9844b73b1194bc5d14de137eb0e865bbe80 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:44:49 +0100 Subject: [PATCH] check links in EOL banner --- airgun/entities/eol_banner.py | 8 ++++++++ airgun/views/eol_banner.py | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/airgun/entities/eol_banner.py b/airgun/entities/eol_banner.py index af23a09d7..827628bf0 100644 --- a/airgun/entities/eol_banner.py +++ b/airgun/entities/eol_banner.py @@ -20,6 +20,14 @@ def is_danger(self): view = self.navigate_to(self, 'NavigateToEOLBanner') return view.danger + def lifecycle_link(self): + view = self.navigate_to(self, 'NavigateToEOLBanner') + return view.lifecycle_link.get_attribute('href') + + def helper_link(self): + view = self.navigate_to(self, 'NavigateToEOLBanner') + return view.helper_link.get_attribute('href') + @navigator.register(EOLBannerEntity) class NavigateToEOLBanner(NavigateStep): diff --git a/airgun/views/eol_banner.py b/airgun/views/eol_banner.py index cd3933efb..22427558b 100644 --- a/airgun/views/eol_banner.py +++ b/airgun/views/eol_banner.py @@ -4,6 +4,8 @@ class EOLBannerView(View, ClickableMixin): name = Text('//div[@id="satellite-eol-banner"]') dismiss_button = Text('//*[@id="satellite-oel-banner-dismiss-button"]') + LIFECYCLE_LINK = '//a[text()[normalize-space(.) = "Red Hat Satellite Product Life Cycle"]]' + HELPER_LINK = '//a[text()[normalize-space(.) = "Red Hat Satellite Upgrade Helper."]]' @property def warning(self): @@ -15,6 +17,16 @@ def danger(self): """Return whether the banner is displayed in danger style""" return 'danger' in " ".join(self.browser.classes(self.name)) + @property + def lifecycle_link(self): + """Return the result link element of this row""" + return self.browser.element(self.LIFECYCLE_LINK) + + @property + def helper_link(self): + """Return the result link element of this row""" + return self.browser.element(self.HELPER_LINK) + @property def is_displayed(self): return self.name.is_displayed