Skip to content

Commit

Permalink
Add leapp preupgrade remidiation view
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Dec 15, 2024
1 parent 7b279d5 commit 868d6ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 13 additions & 0 deletions airgun/entities/job_invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ def read_dynflow_output(self, entity_name, host_name):
self.browser.close_window(self.browser.window_handles[1])
return result

def leapp_fix_inhibitor(self, entity_name, host_name, expected_state='Success'):
"""Fix inhibitors in leapp preupgrade report"""
view = self.navigate_to(self, 'Job Status', entity_name=entity_name, host_name=host_name)
view.Leapp_preupgrade_report.leapp_report_title.click()
wait_for(lambda: view.leapp_preupgrade_report.fix_selected.is_displayed, timeout=10)
view.Leapp_preupgrade_report.fix_selected.click()
wait_for(
lambda: view.overview.read()['job_status'] == expected_state,
timeout=300,
delay=10,
logger=view.logger,
)


@navigator.register(JobInvocationEntity, 'All')
class ShowAllJobs(NavigateStep):
Expand Down
13 changes: 12 additions & 1 deletion airgun/views/job_invocation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from wait_for import wait_for
from widgetastic.widget import Text, TextInput, View
from widgetastic.widget import Checkbox, Text, TextInput, View
from widgetastic_patternfly import BreadCrumb
from widgetastic_patternfly4 import Button, ChipGroup, DescriptionList, Radio, Select
from widgetastic_patternfly4.donutchart import DonutCircle, DonutLegend
Expand Down Expand Up @@ -181,6 +181,17 @@ class overview(SatTab):
"//h2[contains(., 'Total hosts')]/span[@class='card-pf-aggregate-status-count']"
)

@View.nested
class leapp_preupgrade_report(SatTab):
ROOT = '//div[@id="content"]//ul/li/a[contains(text(), "Leapp preupgrade report")][@href="#leapp_preupgrade_report"]'
TAB_NAME = 'Leapp preupgrade report'

leapp_report_title = Checkbox(
locator='//*[@id="preupgrade-report-entries-list-view"]//input[@type="checkbox"]'
)
fix_selected = Text('//*[@id="leapp_preupgrade_report"]//button[text()="Fix Selected"]')
run_upgrade = Text('//*[@id="leapp_preupgrade_report"]//button[text()="Run Upgrade"]')

def wait_for_result(self, timeout=600, delay=1):
"""Wait for invocation job to finish"""
wait_for(
Expand Down

0 comments on commit 868d6ae

Please sign in to comment.