Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/selenium-4.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ogajduse authored Dec 12, 2024
2 parents c764fa3 + 1ba0f30 commit 9f96b44
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 11 deletions.
18 changes: 13 additions & 5 deletions airgun/entities/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,30 @@ def complete_sync(self, capsule_name):

self.sync(capsule_name, 'Complete Sync')

def refresh_lce_counts(self, capsule_name, lce_name):
def refresh_lce_counts(self, capsule_name, lce_name, cv_name=None):
"""
Function that refreshes LCE counts of given capsule
Function that refreshes the content counts of given capsule
Args:
capsule_name (str): Name of capsule to be refreshed
lce_name (str): Name of LCE to be refreshed
cv_name (str, optional): Name of CV within LCE to be refreshed only
"""

view = self.navigate_to(self, 'Capsules')
view.wait_displayed()
view.table.row(name=capsule_name)['Name'].click()
view = CapsuleDetailsView(self.browser)
view.wait_displayed()
view.content.top_content_table.row(Environment=lce_name)[3].widget.item_select(
'Refresh counts'
)
if not cv_name:
view.content.top_content_table.row(Environment=lce_name)[3].widget.item_select(
'Refresh counts'
)
else:
view.content.top_content_table.row(Environment=lce_name)[0].click()
view.content.mid_content_table.row(content_view=cv_name)[5].widget.item_select(
'Refresh counts'
)


@navigator.register(CapsuleEntity, 'Capsules')
Expand Down
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 @@ -229,6 +230,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
7 changes: 6 additions & 1 deletion airgun/views/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ class content(SatTab):
mid_content_table = ExpandableTable(
component_id='expandable-content-views',
column_widgets={
'cv_info_list': ItemsList(locator='//ul'),
0: Button(locator='./button[@aria-label="Details"]'),
'Content view': Text('./span/a'),
'Version': Text('./a'),
'Last published': Text('./span'),
'Synced': Text('./svg'),
5: Dropdown(locator='.//div[contains(@class, "pf-c-dropdown")]'),
},
)

Expand Down
1 change: 1 addition & 0 deletions airgun/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ class TemplateEditor(View):
rendering_options = ItemsList(".//div[contains(@class,'navbar-editor')]/ul")
import_template = Button(id='import-btn')
fullscreen = Button(id='fullscreen-btn')
error = Text(".//div[@id='preview_error_toast']")
editor = ACEEditor()


Expand Down
2 changes: 0 additions & 2 deletions airgun/views/contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
ConfirmationDialog,
EditableEntry,
EditableEntryCheckbox,
EditableEntryMultiCheckbox,
EditableEntrySelect,
Pagination,
ReadOnlyEntry,
Expand Down Expand Up @@ -147,7 +146,6 @@ class details(SatTab):
service_level = EditableEntrySelect(name='Service Level (SLA)')
usage_type = EditableEntrySelect(name='Usage Type')
role = EditableEntrySelect(name='Role')
addons = EditableEntryMultiCheckbox(name='Add ons')
# Content Host Properties
os = ReadOnlyEntry(
locator=".//dt[.='OS']/following-sibling::dd[not(contains(@class, 'ng-hide'))]"
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 @@ -268,6 +268,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 @@ -347,8 +350,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
2 changes: 0 additions & 2 deletions airgun/views/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
ExpandableTable,
FormSelect as OUIAFormSelect,
PatternflyTable,
Select as OUIASelect,
)

from airgun.views.common import BaseLoggedInView
Expand Down Expand Up @@ -772,7 +771,6 @@ class EditSystemPurposeView(View):
sla = OUIAFormSelect('service-level-select')
usage = OUIAFormSelect('usage-select')
release_version = OUIAFormSelect('release-version-select')
add_ons = OUIASelect('syspurpose-addons-select')

save = OUIAButton('save-syspurpose')
cancel = OUIAButton('cancel-syspurpose')
Expand Down
2 changes: 1 addition & 1 deletion airgun/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ def fill(self, values):
"""Check or uncheck one of the checkboxes
:param value: string with specification of fields' values
Example: value={'details.addons': {'Test addon 1': True, 'Test addon 2': False}}
Example: value={'details.role': {'Test role 1': True, 'Test role 2': False}}
"""
for name, value in values.items():
self.checkboxes[name].fill(value)
Expand Down

0 comments on commit 9f96b44

Please sign in to comment.