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 versions dropdown #1411

Open
wants to merge 5 commits 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
20 changes: 20 additions & 0 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from navmazing import NavigateToSibling
from widgetastic.exceptions import NoSuchElementException
from widgetastic_patternfly4.dropdown import DropdownItemDisabled

from airgun.entities.base import BaseEntity
from airgun.navigation import NavigateStep, navigator
Expand Down Expand Up @@ -181,6 +182,25 @@ def read_french_lang_cv(self):
view.wait_displayed()
return view.table.read()

def click_version_dropdown(self, entity_name, version, dropdown_option):
"""Clicks a specific dropdown option for a CV Version"""
view = self.navigate_to(self, 'Version', entity_name=entity_name, version=version)
self.browser.plugin.ensure_page_safe(timeout='5s')
sambible marked this conversation as resolved.
Show resolved Hide resolved
view.wait_displayed()
return view.version_dropdown.item_select(dropdown_option)

def republish_metadata_error(self, entity_name, version):
"""Clicks a specific dropdown option for a CV Version, that will throw an error"""
view = self.navigate_to(self, 'Version', entity_name=entity_name, version=version)
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
try:
view.version_dropdown.item_select('Republish repository metadata')
except DropdownItemDisabled as error:
if 'Item "Republish repository metadata"' and 'is disabled' in error.args[0]:
return True
return 'No error was found, metadata unexpectedly was able to be published.'

def promote(self, entity_name, version_name, lce_name):
"""Promotes the selected version of content view to given environment.
:return: dict with new content view version table row; contains keys
Expand Down
5 changes: 5 additions & 0 deletions airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ class ContentViewVersionDetailsView(BaseLoggedInView):
promoteButton = PF4Button(
locator='.//button[@data-ouia-component-id="cv-details-publish-button"]'
)
version_dropdown = Dropdown(
locator='.//div[@data-ouia-component-id="cv-version-header-actions-dropdown"]'
)
editDescription = PF4Button(
locator='.//button[@data-ouia-component-id="edit-button-description"]'
)
Expand Down Expand Up @@ -327,8 +330,10 @@ class errata(Tab):
@property
def is_displayed(self):
breadcrumb_loaded = self.browser.wait_for_element(self.breadcrumb, exception=False)
title_loaded = self.browser.wait_for_element(self.version, exception=False)
return (
breadcrumb_loaded
and title_loaded
and len(self.breadcrumb.locations) > LOCATION_NUM
and self.breadcrumb.locations[0] == 'Content views'
and self.breadcrumb.locations[2] == 'Versions'
Expand Down