Skip to content

Commit

Permalink
fixed in method for discovery rule and updated it's entities
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 committed Aug 8, 2024
1 parent e488c25 commit 314a17d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions airgun/entities/discoveryrule.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def read_all(self):
view = self.navigate_to(self, 'All')
return view.table.read()

def read_after_del(self):
"""Reads the page after deleting discovery rules table.
There should not be any discovery rules present
:return: Read the page and provide the values in a dict,
"""
view = self.navigate_to(self, 'All')
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

0 comments on commit 314a17d

Please sign in to comment.