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

Add leapp preupgrade remidiation view #1677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading