Skip to content

Commit

Permalink
added new support for feature manifest expires soon (SatelliteQE#1385)
Browse files Browse the repository at this point in the history
* added new support for feature  manifest expires soon

* add & update function from subscription entities

* new approach to read manifest expire message and date

* update xpath for manage manifest alert message

* update xpaths for subscription manager manifest modal box
  • Loading branch information
vijaysawant authored and damoore044 committed Jun 22, 2024
1 parent a484649 commit f05d9b8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
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 @@ -161,6 +161,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

0 comments on commit f05d9b8

Please sign in to comment.