Skip to content

Commit

Permalink
Remove pytest reference and change is_displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Jul 10, 2024
1 parent 47dbf0d commit 468943d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 5 additions & 9 deletions airgun/entities/contentview_new.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from navmazing import NavigateToSibling
import pytest
from widgetastic.exceptions import NoSuchElementException
from widgetastic_patternfly4.dropdown import DropdownItemDisabled

Expand Down Expand Up @@ -143,15 +142,12 @@ def republish_metadata_error(self, entity_name, version):
view = self.navigate_to(self, 'Version', entity_name=entity_name, version=version)
self.browser.plugin.ensure_page_safe(timeout='5s')
view.wait_displayed()
with pytest.raises(DropdownItemDisabled) as error:
try:
view.version_dropdown.item_select('Republish repository metadata')
if (
'Item "Republish repository metadata" of dropdown ".//div[@data-ouia-component-id="cv-version-header-actions-dropdown"]" is disabled'
in error.value.args[0]
):
return True
else:
return 'No error was found, metadata unexpectedly was able to be published.'
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.'


@navigator.register(NewContentViewEntity, 'All')
Expand Down
3 changes: 2 additions & 1 deletion airgun/views/contentview_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ 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'
and self.promoteButton.is_displayed
)


Expand Down

0 comments on commit 468943d

Please sign in to comment.