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

Add support for viewing the needs_publish banner in the cv index page… #1653

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
15 changes: 15 additions & 0 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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

Comment on lines +68 to +80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
view = self.navigate_to(self, 'Publish', entity_name=cv_name)
return view.publish_alert.is_displayed

@sambible could you try this and see if it does the same thing as you want to do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, this is targeting a version of the publish popup that comes up when using the dropdown menu from the cv index page, 'Publish' navigates to a different version of this page.

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
Loading