from widgetastic_manageiq import (ManageIQTree, SummaryTable, ItemsToolBarViewSelector,
BaseEntitiesView)
from widgetastic_patternfly import Dropdown, Accordion, FlashMessages, Button
from widgetastic.widget import View, Text
from cfme.base.login import BaseLoggedInPage
[docs]class NetworkProviderEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class NetworkProviderView(BaseLoggedInPage):
""" Represents whole All NetworkProviders page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkProviderToolBar)
sidebar = View.nested(NetworkProviderSideBar)
including_entities = View.include(NetworkProviderEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.entities.title.text == 'Network Managers')
[docs]class NetworkProviderDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkProviderDetailsToolBar)
sidebar = View.nested(NetworkProviderDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
status = SummaryTable(title="Status")
overview = SummaryTable(title="Overview")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class BalancerEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class BalancerView(BaseLoggedInPage):
""" Represents whole All NetworkProviders page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(BalancerToolBar)
sidebar = View.nested(BalancerSideBar)
including_entities = View.include(NetworkProviderEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Load Balancers'] and
self.entities.title.text == 'Load Balancers')
[docs]class BalancerDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(BalancerDetailsToolBar)
sidebar = View.nested(BalancerDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Load Balancers'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class CloudNetworkEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class CloudNetworkView(BaseLoggedInPage):
""" Represents whole All Cloud network page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(CloudNetworkToolBar)
sidebar = View.nested(CloudNetworkSideBar)
including_entities = View.include(NetworkProviderEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Networks'] and
self.entities.title.text == 'Cloud Networks')
[docs]class CloudNetworkDetailsView(BaseLoggedInPage):
""" Represents detail view of cloud network """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkProviderDetailsToolBar)
sidebar = View.nested(NetworkProviderDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Networks'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class NetworkPortEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class NetworkPortView(BaseLoggedInPage):
""" Represents whole All NetworkPorts page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkPortToolBar)
sidebar = View.nested(NetworkPortSideBar)
including_entities = View.include(NetworkPortEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Network Ports'] and
self.entities.title.text == 'Network Ports')
[docs]class NetworkPortDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkPortDetailsToolBar)
sidebar = View.nested(NetworkPortDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Network Ports'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class NetworkRouterEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class NetworkRouterView(BaseLoggedInPage):
""" Represents whole All NetworkRouters page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkRouterToolBar)
sidebar = View.nested(NetworkRouterSideBar)
including_entities = View.include(NetworkRouterEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Network Routers'] and
self.entities.title.text == 'Network Routers')
[docs]class NetworkRouterDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(NetworkRouterDetailsToolBar)
sidebar = View.nested(NetworkRouterDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class SecurityGroupEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class SecurityGroupView(BaseLoggedInPage):
""" Represents whole All SecurityGroups page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(SecurityGroupToolBar)
sidebar = View.nested(SecurityGroupSideBar)
including_entities = View.include(SecurityGroupEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Security Groups'] and
self.entities.title.text == 'Security Groups')
[docs]class SecurityGroupDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(SecurityGroupDetailsToolBar)
sidebar = View.nested(SecurityGroupDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class SubnetEntities(BaseEntitiesView):
""" Represents central view where all QuadIcons, etc are displayed """
pass
[docs]class SubnetView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(SubnetToolBar)
sidebar = View.nested(SubnetSideBar)
including_entities = View.include(SubnetEntities, use_parent=True)
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Subnets'] and
self.entities.title.text == 'Cloud Subnets')
[docs]class SubnetDetailsView(BaseLoggedInPage):
""" Represents detail view of network provider """
title = Text('//div[@id="main-content"]//h1')
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(SubnetDetailsToolBar)
sidebar = View.nested(SubnetDetailsSideBar)
@View.nested
class entities(View): # noqa
""" Represents details page when it's switched to Summary/Table view """
properties = SummaryTable(title="Properties")
relationships = SummaryTable(title="Relationships")
smart_management = SummaryTable(title="Smart Management")
@property
def is_displayed(self):
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Subnets'] and
self.title.text == '{name} (Summary)'.format(name=self.context['object'].name))
[docs]class OneProviderSubnetView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(SubnetSideBar)
including_entities = View.include(SubnetEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Cloud Subnets)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)
[docs]class OneProviderBalancerView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(BalancerSideBar)
including_entities = View.include(BalancerEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Balancers)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)
[docs]class OneProviderNetworkPortView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(NetworkPortSideBar)
including_entities = View.include(NetworkPortEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Network Ports)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)
[docs]class OneProviderCloudNetworkView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(CloudNetworkSideBar)
including_entities = View.include(CloudNetworkEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Cloud Networks)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)
[docs]class OneProviderNetworkRouterView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(NetworkRouterSideBar)
including_entities = View.include(NetworkRouterEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Network Routers)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)
[docs]class OneProviderSecurityGroupView(BaseLoggedInPage):
""" Represents whole All Subnets page """
flash = FlashMessages('.//div[@div="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")]')
toolbar = View.nested(OneProviderComponentsToolbar)
sidebar = View.nested(SecurityGroupSideBar)
including_entities = View.include(SecurityGroupEntities, use_parent=True)
@property
def is_displayed(self):
title = '{name} (All Security Groups)'.format(name=self.context['object'].name)
return (super(BaseLoggedInPage, self).is_displayed and
self.navigation.currently_selected == ['Networks', 'Providers'] and
self.title.text == title)