From 0a57c144db6f0cfa4fff33b0bb68ba37147208f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hellebrandt?= Date: Tue, 5 Mar 2024 06:46:36 +0100 Subject: [PATCH] Rex targetting (#1262) --- airgun/entities/job_invocation.py | 12 ++++++++++++ airgun/views/job_invocation.py | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/airgun/entities/job_invocation.py b/airgun/entities/job_invocation.py index ecadb284f..8b77ab8bb 100644 --- a/airgun/entities/job_invocation.py +++ b/airgun/entities/job_invocation.py @@ -69,6 +69,18 @@ def get_targeted_hosts(self): time.sleep(3) return view.target_hosts_and_inputs.read() + def read_hostgroups(self): + """Read host groups in selection""" + view = self.navigate_to(self, 'Run') + view.fill( + { + 'category_and_template.job_category': 'Commands', + 'category_and_template.job_template': 'Run Command - Script Default', + 'target_hosts_and_inputs.targetting_type': 'Host groups', + } + ) + return view.target_hosts_and_inputs.targets.items + @navigator.register(JobInvocationEntity, 'All') class ShowAllJobs(NavigateStep): diff --git a/airgun/views/job_invocation.py b/airgun/views/job_invocation.py index fbd31c305..41e7bb3fe 100644 --- a/airgun/views/job_invocation.py +++ b/airgun/views/job_invocation.py @@ -54,6 +54,12 @@ class target_hosts_and_inputs(WizardStepView): ansible_roles_list = TextInput(id='ansible_roles_list') power_action = OUIASelect('OUIA-Generated-Select-single-34') + targetting_type = Select(locator='//div[button[@aria-haspopup="listbox"]]') + # https://bugzilla.redhat.com/show_bug.cgi?id=2265127 + targets = Select( + locator='//div[contains(@data-ouia-component-id,"OUIA-Generated-Select-typeaheadmulti-")]' + ) + @View.nested class advanced_fields(WizardStepView): expander = Text(".//button[contains(.,'Advanced fields')]")