Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.14.z] Add check to verify supported provisioning templates #1061

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions airgun/entities/provisioning_template.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"""
Expand Down
2 changes: 1 addition & 1 deletion airgun/views/provisioning_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')]"),
},
Expand Down
Loading