diff --git a/airgun/entities/provisioning_template.py b/airgun/entities/provisioning_template.py index f70c6bb62..3a9422ef8 100644 --- a/airgun/entities/provisioning_template.py +++ b/airgun/entities/provisioning_template.py @@ -1,4 +1,5 @@ from navmazing import NavigateToSibling +from widgetastic.exceptions import NoSuchElementException from airgun.entities.base import BaseEntity from airgun.navigation import NavigateStep, navigator @@ -59,10 +60,24 @@ def unlock(self, entity_name): def is_locked(self, entity_name): """Check if provisioning template is locked for editing""" view = self.navigate_to(self, 'All') - view.search(entity_name) - return "This template is locked for editing." in view.table.row(name=entity_name)[ - 'Locked' - ].widget.browser.element('.').get_property('innerHTML') + view.search(f'name="{entity_name}"') + try: + return "This template is locked for editing." in view.table.row(name=entity_name)[ + 'Locked' + ].widget.browser.element('.').get_property('innerHTML') + except NoSuchElementException: + return False + + def is_supported(self, entity_name): + """Check if provisioning template is supported or not""" + view = self.navigate_to(self, 'All') + view.search(f'name="{entity_name}"') + try: + return "Supported by Red Hat" in view.table.row(name=entity_name)[ + 'Name' + ].widget.browser.element('./img').get_attribute('title') + except NoSuchElementException: + return False def update(self, entity_name, values): """Update provisioning template""" diff --git a/airgun/views/provisioning_template.py b/airgun/views/provisioning_template.py index 51f2ec3e8..fc05b9f8c 100644 --- a/airgun/views/provisioning_template.py +++ b/airgun/views/provisioning_template.py @@ -31,7 +31,7 @@ class ProvisioningTemplatesView(BaseLoggedInView, SearchableViewMixinPF4): table = Table( './/table', column_widgets={ - 'Name': Text('./a'), + 'Name': Text('.'), 'Locked': Text('.'), 'Actions': ActionsDropdown("./div[contains(@class, 'btn-group')]"), },