Skip to content

Commit 1a3b6db

Browse files
committed
removing updated value with default
1 parent 7a4c7b0 commit 1a3b6db

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

airgun/entities/host_new.py

+17
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,23 @@ def refresh_applicability(self, entity_name):
975975
self.browser.plugin.ensure_page_safe()
976976
view.dropdown.item_select('Refresh applicability')
977977

978+
def read_updated_value(self, entity_name, key, value):
979+
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
980+
wait_for(lambda: view.ansible.variables.table.is_displayed, timeout=10)
981+
# Index [5] essentially refers to the button used to edit the value. The same index is then applied to either 'Yes' or 'No' options to update the value
982+
view.ansible.variables.table.row(name=key)[5].widget.click()
983+
view.ansible.variables.table.row(name=key)['Value'].click()
984+
view.ansible.variables.table.row(name=key)['Value'].widget.fill(value)
985+
view.ansible.variables.table1.row(name=key)[5].widget.click()
986+
return view.ansible.variables.table.row(name=key)['Value'].read()
987+
988+
def read_value_after_del(self, entity_name, key):
989+
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
990+
view.ansible.variables.actions.click()
991+
view.ansible.variables.delete.click()
992+
view.ansible.variables.confirm.click()
993+
return view.ansible.variables.table.row(name=key)['Value'].read()
994+
978995

979996
@navigator.register(NewHostEntity, 'NewDetails')
980997
class ShowNewHostDetails(NavigateStep):

airgun/views/host_new.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -513,20 +513,30 @@ class roles(Tab):
513513
class variables(Tab):
514514
TAB_NAME = 'Variables'
515515
ROOT = './/div[@class="ansible-host-detail"]'
516+
517+
actions = Button(locator='//tbody/tr/td[7]//button')
518+
delete = Button(locator='//button[@role="menuitem"]')
519+
confirm = Button(locator='//button[@data-ouia-component-id="btn-modal-confirm"]')
516520
table = Table(
517521
locator='.//table[contains(@class, "pf-c-table")]',
518522
column_widgets={
519523
'Name': Text('.//a'),
520524
'Ansible role': Text('./span'),
521525
'Type': Text('./span'),
522526
# the next field can also be a form group
523-
'Value': Text('./span'),
527+
'Value': TextInput(locator='//textarea[contains(@class, "pf-c-form")]'),
524528
'Source attribute': Text('./span'),
525529
# The next 2 buttons are hidden by default, but appear in this order
526-
5: Button(locator='.//button[@aria-label="Cancel editing override button"]'),
527-
6: Button(locator='.//button[@aria-label="Submit override button"]'),
530+
6: Button(locator='.//button[@aria-label="Cancel editing override button"]'),
531+
7: Button(locator='.//button[@aria-label="Submit override button"]'),
528532
# Clicking this button hides it, and displays the previous 2
529-
7: Button(locator='.//button[@aria-label="Edit override button"]'),
533+
5: Button(locator='.//button[@aria-label="Edit override button"]'),
534+
},
535+
)
536+
table1 = Table(
537+
locator='.//table[contains(@class, "pf-c-table")]',
538+
column_widgets={
539+
5: Button(locator='.//button[@aria-label="Submit editing override button"]'),
530540
},
531541
)
532542
pagination = PF4Pagination()

0 commit comments

Comments
 (0)