Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check links in EOL banner #1644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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