def test_outputs_link_url(stack): try: view = navigate_to(stack, 'RelationshipOutputs') except CandidateNotFound: # Assert there is a non-clickable anchor view = navigate_to(stack, 'Details') assert view.sidebar.relationships.nav.is_disabled('Outputs (0)') else: # Outputs is a table with clickable rows # TODO: Need to come back to this one table = Table('//div[@id="list_grid"]//table[contains(@class, "table-selectable")]') table.click_row_by_cells({'Key': 'WebsiteURL'}, 'Key') assert sel.is_displayed_text("WebsiteURL")
def test_outputs_link_url(appliance, stack): try: view = navigate_to(stack, 'RelationshipOutputs') except CandidateNotFound: # Assert there is a non-clickable anchor view = navigate_to(stack, 'Details') assert view.sidebar.relationships.nav.is_disabled('Outputs (0)') else: # Outputs is a table with clickable rows # TODO: Need to come back to this one table = Table('//div[@id="list_grid"]//table[contains(@class, "table-selectable")]') table.click_row_by_cells({'Key': 'WebsiteURL'}, 'Key') loc = "//*[normalize-space(text())={}]".format(quoteattr("WebsiteURL")) assert appliance.browser.widgetastic.selenium.is_displayed(loc)
class MySettingsEntities(View): table = Table('//div[@id="main_div"]//table') breadcrumb = BreadCrumb() title = Text('//div[@id="main-content"]//h3')
class schema(Tab): # noqa schema_title = Text('//div[@id="class_fields_div"]/h3') table = Table('//div[@id="class_fields_div"]/table')
class TimeProfileEntities(View): table = Table('//div[@id="main_div"]//table') breadcrumb = BreadCrumb() title = Text('//div[@id="main-content"]//h3')
class AvailabilityZoneEntities(View): """View containing the widgets for the main content pane""" title = Text('//div[@id="main-content"]//h1') table = Table("//div[@id='gtl_div']//table") search = View.nested(Search)
class instances(Tab): # noqa table = Table('#class_instances_grid')
class StackOutputsEntities(View): """The entities of the resources page""" breadcrumb = BreadCrumb() title = Text('//div[@id="main-content"]//h1') outputs = Table('//div[@id="gtl_div"]//table')
class properties(Tab): # noqa table = Table('//table[./preceding-sibling::h3[normalize-space(.)="Properties"]][1]') overrides = Table( '//table[./preceding-sibling::h3[normalize-space(.)="Domain Overrides (by priority)"]]')
class VMPropertyDetailView(View): title = Text('//div[@id="main-content"]//h1//span[@id="explorer_title_text"]') table = Table('//div[@id="gtl_div"]//table') paginator = PaginationPane()
class myothertasks(WaitTab): # noqa TAB_NAME = 'My Tasks' table = Table('//div[@id="gtl_div"]//table')
class ConfigManagementEntities(BaseEntitiesView): """The entities on the page""" table = Table('//div[@id="main_div"]//div[@id="list_grid"]/table')
class configured_systems(Tab): # noqa TAB_NAME = 'Configured Systems' table = Table('//div[@id="main_div"]//div[@id="list_grid"]/table')
class ProvisionView(BaseLoggedInPage): """ The provisioning view, with nested ProvisioningForm as `form` attribute. Handles template selection before Provisioning form with `before_fill` method """ title = Text('#explorer_title_text') breadcrumb = BreadCrumb() image_table = Table('//div[@id="pre_prov_div"]//table') paginator = PaginationPane() @View.nested class sidebar(View): # noqa increase_button = Text( locator='//div[contains(@class, "resize-right")]') decrease_button = Text( locator='//div[contains(@class, "resize-left")]') @View.nested class form(BasicProvisionFormView): # noqa """First page of provision form is image selection Second page of form is tabbed with nested views """ continue_button = Button( 'Continue') # Continue button on 1st page, image selection submit_button = Button('Submit') # Submit for 2nd page, tabular form cancel_button = Button('Cancel') def _select_template(self, template_name, provider_name): try: self.parent.paginator.find_row_on_pages( self.parent.image_table, name=template_name, provider=provider_name).click() # image was not found, therefore raise an exception except IndexError: raise ItemNotFound( 'Cannot find template "{}" for provider "{}"'.format( template_name, provider_name)) def before_fill(self, values): # Provision from image is a two part form, # this completes the image selection before the tabular parent form is filled template_name = values.get('template_name') provider_name = values.get('provider_name') if template_name is None or provider_name is None: logger.error( 'template_name "{}", or provider_name "{}" not passed to ' 'provisioning form', template_name, provider_name) # try to find the template anyway, even if values weren't passed self._select_template(template_name, provider_name) # workaround for provision table template select(template was not clicked) if self.continue_button.disabled: self.parent.sidebar.decrease_button.click() self._select_template(template_name, provider_name) self.continue_button.click() wait_for(self.browser.plugin.ensure_page_safe, delay=.1, num_sec=10) def after_fill(self, was_change): wait_for(self.browser.plugin.ensure_page_safe, delay=.1, num_sec=10) is_displayed = displayed_not_implemented
class saved_reports(Tab): # noqa TAB_NAME = "Saved Reports" table = Table(".//div[@id='records_div']/table") paginator = PaginationPane()
class configured_systems(Tab): # noqa TAB_NAME = 'Configured Systems' elements = Table( '//div[@id="main_div"]//div[@id="list_grid" or @id="gtl_div"]//table' )
class StackSecurityGroupsEntities(View): """The entities of the resources page""" breadcrumb = BreadCrumb() title = Text('//div[@id="main-content"]//h1') security_groups = Table('//div[@id="list_grid"]//table')
class alltasks(WaitTab): # noqa TAB_NAME = 'All Tasks' table = Table('//div[@id="gtl_div"]//table')
class StackParametersEntities(View): """The entities of the resources page""" breadcrumb = BreadCrumb() title = Text('//div[@id="main-content"]//h1') parameters = Table('//div[@id="list_grid"]//table')
class allothertasks(WaitTab): # noqa TAB_NAME = "All Other Tasks" table = Table('//div[@id="gtl_div"]//table')
class FlavorEntities(View): title = Text('//div[@id="main-content"]//h1') table = Table("//div[@id='gtl_div']//table") search = View.nested(Search)
class DeploymentRoleComparisonEntities(View): """The entities on compare Deployment role page""" breadcrumb = BreadCrumb() table = Table('//*[@id="compare-grid"]/table')
class saved_reports(WaitTab): # noqa TAB_NAME = "Saved Reports" table = Table(".//div[@id='records_div' or @class='miq-data-table']/table") paginator = PaginationPane()
class StorageManagerEntities(View): """The entities on the main list Storage Manager or Provider page""" table = Table(".//div[@id='list_grid' or @class='miq-data-table']/table")
class AvailabilityZoneEntities(BaseEntitiesView): """View containing the widgets for the main content pane""" table = Table("//div[@id='gtl_div']//table")
class VolumeEntities(View): title = Text('//div[@id="main-content"]//h1') table = Table("//div[@id='list_grid']//table") search = View.nested(Search) flash = FlashMessages('.//div[starts-with(@id, "flash_text_div")]')
class methods(Tab): # noqa table = Table('#class_methods_grid')
class alltasks(Tab): # noqa TAB_NAME = "All VM and Container Analysis Tasks" table = Table(table_loc)
class TimeProfilesView(BaseLoggedInPage): table = Table("//div[@id='main_div']//table") help_block = Text("//span[contains(@class, 'help-block')]") configuration = Dropdown('Configuration')
class StackEntities(BaseEntitiesView): """The entities on the main list page""" table = Table("//div[@id='gtl_div']//table")
class TenantEntities(BaseEntitiesView): """The entities on the main list page""" table = Table('//div[@id="gtl_div"]//table')
class allothertasks(Tab): # noqa TAB_NAME = "All Other Tasks" table = Table(table_loc)