Skip to content

Commit

Permalink
Fixes needed for some endeavour tests to run correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
LadislavVasina1 authored and pondrejk committed Mar 25, 2024
1 parent fffbe9f commit 3c6ab7f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions airgun/entities/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ def search(self, value):
view = self.navigate_to(self, 'All')
return view.search(value)

def reset_search(self):
"""This function loads a HostsView and clears the searchbox."""
view = HostsView(self.browser)
view.searchbox.clear()

def host_status(self, value):
"""Get Host status"""
view = self.navigate_to(self, 'All')
Expand Down Expand Up @@ -110,6 +115,12 @@ def delete(self, entity_name, cancel=False):
view.flash.assert_no_error()
view.flash.dismiss()

def read_hosts_after_search(self, entity_name):
"""read_hosts_after_search"""
view = self.navigate_to(self, 'All')
view.search(entity_name)
return view.table.read()

def delete_interface(self, entity_name, interface_id):
"""Delete host network interface.
Expand Down Expand Up @@ -249,10 +260,14 @@ def schedule_remote_job(self, entities_list, values, timeout=60, wait_for_result
"""
view = self._select_action('Schedule Remote Job', entities_list)
view.fill(values)
sleep(2)
view.submit.click()
view.flash.assert_no_error()
view.flash.dismiss()
status_view = HostsJobInvocationStatusView(self.browser)
sleep(2)
self.browser.plugin.ensure_page_safe()
status_view.wait_displayed()
if wait_for_results:
status_view.wait_for_result(timeout=timeout)
return status_view.read()
Expand Down
3 changes: 2 additions & 1 deletion airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,12 @@ def remove_host_from_host_collection(
def schedule_job(self, entity_name, values):
"""Schedule a remote execution on selected host"""
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
self.browser.plugin.ensure_page_safe()
view.wait_displayed()
self.browser.wait_for_element(view.schedule_job, exception=False)
view.schedule_job.fill('Schedule a job')
view = JobInvocationCreateView(self.browser)
self.browser.plugin.ensure_page_safe()
view.wait_displayed()
view.fill(values)
view.submit.click()

Expand Down
2 changes: 2 additions & 0 deletions airgun/entities/job_invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def run(self, values):
"""Run specific job"""
view = self.navigate_to(self, 'Run')
view.fill(values)
view.submit.expander.click()
self.browser.wait_for_element(view.submit.submit, exception=False)
view.submit.click()

def search(self, value):
Expand Down

0 comments on commit 3c6ab7f

Please sign in to comment.