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

added new support for feature manifest expires soon #1385

Merged
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
36 changes: 36 additions & 0 deletions airgun/entities/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,42 @@ def read_delete_manifest_message(self):
manage_view.close_button.click()
return delete_message

def read_subscription_manifest_header_message_and_date(self):
"""Read message displayed about 'manifest expiration' at Subscription Manifest section"""
view = self.navigate_to(self, 'Manage Manifest')
view.wait_animation_end()
# Read manifest expiration header & message
if view.manifest.alert_message.is_displayed:
expire_manifest_header = view.manifest.expire_header.read()
expire_manifest_message = view.manifest.expire_message.read()
else:
# Subscription Manifest header & message is not present
raise Exception('Manifest expire alert not found')
# Read manifest expiration date
if view.manifest.expire_date.is_displayed:
expire_manifest_date = view.manifest.expire_date.read()
else:
raise Exception('Manifest expire date not found')
# close opened modal dialogs views
manage_view = ManageManifestView(self.browser)
if manage_view.is_displayed:
manage_view.close_button.click()
return {
'header': expire_manifest_header,
'message': expire_manifest_message,
'date': expire_manifest_date,
}

def read_subscription_manifest_expiration_date_only(self):
"""Returns the expiration date from 'Manage Manifest' modal box"""
view = self.navigate_to(self, 'Manage Manifest')
view.wait_animation_end()
manifest_expiration_date = view.manifest.expire_date.read()
manage_view = ManageManifestView(self.browser)
if manage_view.is_displayed:
manage_view.close_button.click()
return manifest_expiration_date

def add(self, entity_name, quantity=1):
"""Attach new subscriptions
:param entity_name: Name of subscription to attach
Expand Down
10 changes: 10 additions & 0 deletions airgun/views/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ class ManageManifestView(BaseLoggedInView):

@View.nested
class manifest(SatTab):
alert_message = Text(
'//div[@id="manifest-history-tabs-pane-1"]/div/h3//following-sibling::div[@aria-label="Warning Alert" or @aria-label="Danger Alert"]'
)
expire_header = Text('//div[@id="manifest-history-tabs-pane-1"]/div/div/h4')
expire_message = Text(
'//div[@id="manifest-history-tabs-pane-1"]/div/div/h4//following-sibling::div'
)
expire_date = Text(
'//div[@id="manifest-history-tabs-pane-1"]/div/hr//following-sibling::div[2]/div[2]'
)
red_hat_cdn_url = TextInput(id='cdnUrl')
manifest_file = FileInput(id='usmaFile')
refresh_button = Button('Refresh')
Expand Down