Skip to content

Commit

Permalink
changes to fetch the config report data (#1479) (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Aug 14, 2024
1 parent 5ac19aa commit 8441d80
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
7 changes: 7 additions & 0 deletions airgun/entities/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ def remove_host_collection(self, entity_name, hc_name):
view.flash.assert_no_error()
view.flash.dismiss()

def enable_repository(self, entity_name, repo_name):
view = self.navigate_to(self, 'Edit', entity_name=entity_name)
view.repository_sets.click()
view.repository_sets.search(repo_name)
view.repository_sets.check_box.click()
view.repository_sets.actions.fill('Override to Enabled')


@navigator.register(ActivationKeyEntity, 'All')
class ShowAllActivationKeys(NavigateStep):
Expand Down
9 changes: 8 additions & 1 deletion airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ def schedule_job(self, entity_name, values):
view.fill(values)
view.submit.click()

def run_job(self, entity_name):
"""Run a job on selected host"""
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.run_job.wait_displayed()
view.run_job.click()
view.select.click()

def get_packages(self, entity_name, search=""):
"""Filter installed packages on host"""
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
Expand Down Expand Up @@ -442,7 +449,7 @@ def add_single_ansible_role(self, entity_name):
self.browser.plugin.ensure_page_safe()
wait_for(lambda: view.ansible.roles.edit.is_displayed, timeout=5)
view.ansible.roles.edit.click()
wait_for(lambda: EditAnsibleRolesView(self.browser).addAnsibleRole.is_displayed, timeout=5)
wait_for(lambda: EditAnsibleRolesView(self.browser).addAnsibleRole.is_displayed, timeout=10)
edit_view = EditAnsibleRolesView(self.browser)
actions = [edit_view.addAnsibleRole, edit_view.selectRoles, edit_view.confirm]
for action in actions:
Expand Down
19 changes: 17 additions & 2 deletions airgun/views/activationkey.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from widgetastic.widget import ParametrizedView, Select, Table, Text, TextInput, View
from widgetastic.widget import (
Checkbox,
ParametrizedView,
Select,
Table,
Text,
TextInput,
View,
)
from widgetastic_patternfly import BreadCrumb

from airgun.views.common import (
Expand Down Expand Up @@ -83,10 +91,17 @@ class subscriptions(SatTab):
resources = View.nested(AddRemoveSubscriptionsView)

@View.nested
class repository_sets(SatTab):
class repository_sets(SatTab, SearchableViewMixin):
TAB_NAME = 'Repository Sets'
repo_type = Select(locator='.//select[@id="repositoryTypes"]')
actions = ActionsDropdown('//div[contains(@class, "btn-group ng-scope")]/div')
table = Table(locator=".//table")
repository_name = Text(
locator='//table[@class="table table-bordered table-striped"]/tbody/tr//td[2]'
)
check_box = Checkbox(
locator='//table[@class="table table-bordered table-striped"]/tbody/tr//td[1]'
)

@View.nested
class host_collections(SatTab):
Expand Down
9 changes: 8 additions & 1 deletion airgun/views/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from airgun.views.common import BaseLoggedInView
from airgun.widgets import (
Accordion,
ActionsDropdown,
CheckboxGroup,
ItemsList,
Pf4ActionsDropdown,
Expand Down Expand Up @@ -112,6 +113,10 @@ def is_displayed(self):
edit = OUIAButton('host-edit-button')
dropdown = Dropdown(locator='//button[@id="hostdetails-kebab"]/..')
schedule_job = Pf4ActionsDropdown(locator='.//div[div/button[@aria-label="Select"]]')
run_job = ActionsDropdown('//button[@data-ouia-component-id="schedule-a-job-dropdown-toggle"]')
select = Text(
'//ul[@class="pf-c-dropdown__menu pf-m-align-right"]/li/a/div[normalize-space(text())="Run Ansible roles"]'
)

@View.nested
class overview(Tab):
Expand Down Expand Up @@ -791,7 +796,9 @@ def read(self):
class EditAnsibleRolesView(View):
"""Edit Ansible Roles Modal"""

addAnsibleRole = Text('.//span[contains(text(),"RedHatInsights.insights-client")]')
addAnsibleRole = Text(
'.//span[contains(text(),"RedHatInsights.insights-client") or contains(text(),"theforeman.foreman_scap_client")]'
)
confirm = Button(locator='.//button[@aria-label="submit ansible roles"]')
hostAssignedAnsibleRoles = Text(
'.//button[@class="pf-c-dual-list-selector__item"]/span[1]//span[2]'
Expand Down

0 comments on commit 8441d80

Please sign in to comment.