Skip to content

Commit

Permalink
check links in EOL banner
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored and pondrejk committed Nov 22, 2024
1 parent 7a4c7b0 commit 3971f98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions airgun/entities/eol_banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 12 additions & 0 deletions airgun/views/eol_banner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

0 comments on commit 3971f98

Please sign in to comment.