From 3d3f4b179c95bbb68708f45586dc97f3429d90c4 Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Fri, 17 Jan 2025 02:57:11 -0600 Subject: [PATCH] Add support for viewing the needs_publish banner in the cv index page publish widget (#1653) --- airgun/entities/contentview_new.py | 15 +++++++++++++++ airgun/views/contentview_new.py | 2 ++ 2 files changed, 17 insertions(+) diff --git a/airgun/entities/contentview_new.py b/airgun/entities/contentview_new.py index 4cc2b45a9..9801ee81f 100644 --- a/airgun/entities/contentview_new.py +++ b/airgun/entities/contentview_new.py @@ -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) diff --git a/airgun/views/contentview_new.py b/airgun/views/contentview_new.py index 3e826e62a..be8395d89 100644 --- a/airgun/views/contentview_new.py +++ b/airgun/views/contentview_new.py @@ -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")]'), }, ) @@ -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')