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

fixed in method for discovery rule and updated it's entities #1480

Merged
merged 1 commit into from
Aug 26, 2024
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
12 changes: 8 additions & 4 deletions airgun/entities/discoveryrule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ def read(self, entity_name, widget_names=None):
return view.read(widget_names=widget_names)

def read_all(self):
"""Reads the whole discovery rules table.
"""Reads the entire discovery rules page

:return: list of table rows, each row is dict,
attribute as key with correct value
:return:
1) list of table rows, each row is dict, attribute as key with correct value
2) After deleting the rule, the page context is displayed
"""
view = self.navigate_to(self, 'All')
return view.table.read()
if view.table.is_displayed:
return view.table.read()
elif view.page_info.is_displayed:
return view.page_info.read()

def update(self, entity_name, values):
"""Update existing Discovery rule
Expand Down
8 changes: 4 additions & 4 deletions airgun/views/discoveryrule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from widgetastic.widget import Checkbox, Text, TextInput, View
from widgetastic.widget import Checkbox, Table, Text, TextInput, View
from widgetastic_patternfly import BreadCrumb
from widgetastic_patternfly4 import Button as PF4Button

Expand All @@ -8,18 +8,18 @@
AutoCompleteTextInput,
FilteredDropdown,
MultiSelect,
SatTable,
)


class DiscoveryRulesView(BaseLoggedInView, SearchableViewMixinPF4):
title = Text("//h1[normalize-space(.)='Discovery Rules']")
page_info = Text("//foreman-react-component[contains(@name, 'DiscoveryRules')]/div/div")
new = Text("//a[contains(@href, '/discovery_rules/new')]")
new_on_blank_page = PF4Button('Create Rule')
table = SatTable(
table = Table(
'.//table',
column_widgets={
'Name': Text('./a'),
'Name': Text('.//a'),
'Actions': ActionsDropdown("./div[contains(@class, 'btn-group')]"),
},
)
Expand Down
Loading