Skip to content

Commit

Permalink
Add support for viewing the needs_publish banner in the cv index page…
Browse files Browse the repository at this point in the history
… publish widget (#1653)
  • Loading branch information
sambible authored Jan 17, 2025
1 parent 1133e16 commit 3d3f4b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ def publish(self, entity_name, values=None, promote=False, lce=None):
view.wait_displayed()
return view.versions.table.read()

def check_publish_banner(self, cv_name):
"""Check if the needs_publish banner is displayed on the content view index page"""
view = self.navigate_to(self, 'All')
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
if not view.table.is_displayed:
# no table present, no CVs in this Org
return None
view.search(cv_name)
view.table[0][6].widget.item_select('Publish')
view = ContentViewVersionPublishView(self.browser)
is_displayed = view.publish_alert.is_displayed
view.cancel_button.click()
return is_displayed

def delete(self, entity_name):
"""Deletes the content view by name"""
view = self.navigate_to(self, 'Edit', entity_name=entity_name)
Expand Down
2 changes: 2 additions & 0 deletions airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ContentViewTableView(BaseLoggedInView, SearchableViewMixinPF4):
'Last Published': ('./a'),
'Last task': Text('.//a'),
'Latest version': Text('.//a'),
6: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'),
},
)

Expand Down Expand Up @@ -213,6 +214,7 @@ class ContentViewVersionPublishView(BaseLoggedInView):
# publishing view is a popup so adding all navigation within the same context
ROOT = './/div[contains(@class,"pf-c-wizard")]'
title = Text(".//h2[contains(., 'Publish') and contains(@aria-label, 'Publish')]")
publish_alert = Text(".//h4[contains(., 'No available repository or filter updates')]")
# publishing screen
description = TextInput(id='description')
promote = Switch('promote-switch')
Expand Down

0 comments on commit 3d3f4b1

Please sign in to comment.