Skip to content

Commit

Permalink
Rebase (of #939 New CV UI work)
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Oct 9, 2024
1 parent db1c8d1 commit e33ff5c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,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 @@ -33,6 +34,12 @@ def create(self, values, composite=False):
view.fill(values)
view.submit.click()

def delete(self, entity_name):
"""Deletes the supplied content view"""

def delete_version(self, entity_name, version):
"""Deletes the supplied version of the content view"""

def search(self, value):
"""Search for content view"""
view = self.navigate_to(self, 'All')
Expand Down Expand Up @@ -172,6 +179,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')
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 @@ -251,6 +251,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 @@ -323,8 +326,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

0 comments on commit e33ff5c

Please sign in to comment.