Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8283 from aljazkosir/test-nuage-automation-class
Browse files Browse the repository at this point in the history
[1LP][RFR] Ensure Nuage AE Class contains auth attributes in AE Schema
  • Loading branch information
mshriver committed Dec 19, 2018
2 parents 66cbbc3 + 1428426 commit cad1c61
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cfme/automate/explorer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cfme.base.login import BaseLoggedInPage
from cfme.base.ui import automate_menu_name
from cfme.utils.appliance.implementations.ui import navigator, CFMENavigateStep
from widgetastic_manageiq import Accordion, ManageIQTree
from widgetastic_manageiq import Accordion, ManageIQTree, Splitter


class AutomateExplorerView(BaseLoggedInPage):
Expand All @@ -26,6 +26,7 @@ def is_displayed(self):
@View.nested
class datastore(Accordion): # noqa
tree = ManageIQTree()
splitter = Splitter()

configuration = Dropdown('Configuration')

Expand Down
8 changes: 8 additions & 0 deletions cfme/automate/explorer/klass.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,16 @@ class Details(CFMENavigateStep):
prerequisite = NavigateToAttribute('appliance.server', 'AutomateExplorer')

def step(self):
# Because click is performed on the middle of the element and at the middle there is a
# chevron button for expanding tree (if there are instances inside class), this navigation
# then fails to navigate to details. We make use of the splitter to make explorer
# larger, so chevron button is not exactly at the middle
self.prerequisite_view.datastore.splitter.pull_right()
self.prerequisite_view.datastore.tree.click_path(*self.obj.tree_path)

def resetter(self, *args, **kwargs):
self.prerequisite_view.datastore.splitter.reset()


@navigator.register(Class)
class Edit(CFMENavigateStep):
Expand Down
14 changes: 14 additions & 0 deletions cfme/tests/networks/nuage/test_automation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def test_auth_attributes_of_nuage_ae_class(appliance):
"""
Ensure Nuage AE Class contains auth attributes in AE Schema
"""
expected_fields = ['nuage_password', 'nuage_username', 'nuage_enterprise', 'nuage_url',
'nuage_api_version']
manageiq_domain = appliance.collections.domains.instantiate(name='ManageIQ')
system_namespace = manageiq_domain.namespaces.instantiate(name='System')
event_namespace = system_namespace.namespaces.instantiate(name='Event')
ems_event_namespace = event_namespace.namespaces.instantiate(name='EmsEvent')
nuage_class = ems_event_namespace.classes.instantiate(name='Nuage')
schema_fields = nuage_class.schema.schema_field_names

assert all(expected in schema_fields for expected in expected_fields)

0 comments on commit cad1c61

Please sign in to comment.