From ab9156bfee0c2afd4b7c98d820f3fec20552bb74 Mon Sep 17 00:00:00 2001 From: "[Aron Schueler]" Date: Thu, 12 Apr 2018 18:04:07 +0200 Subject: Minor job_cancel fix Signed-off-by: Frank Bergkemper --- tests/selenium/webui-selenium-test.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/selenium/webui-selenium-test.py b/tests/selenium/webui-selenium-test.py index 664466d..3c3b481 100755 --- a/tests/selenium/webui-selenium-test.py +++ b/tests/selenium/webui-selenium-test.py @@ -266,15 +266,10 @@ class WebuiSeleniumTest(unittest.TestCase): return b def job_cancel(self, id): - # Go to job list - self.wait_and_click(By.ID, 'menu-topnavbar-job') - # Click on the object that has id in its url - self.wait_and_click(By.ID, 'btn-1') - #self.wait_for_url_and_click('/bareos-webui/job/details/%s' % id) - # Wait for the cancel button to load - #self.wait_for_element(By.XPATH, '//*[@title="Cancel"]') - # Click on cancel button - #self.wait_and_click(By.XPATH, '//*[@title="Cancel"]') + # Wait for the cancel button + self.wait_for_element(By.ID, "//a[@id='btn-1'][@title='Cancel']") + # Click the cancel button + self.wait_and_click(By.ID, "//a[@id='btn-1'][@title='Cancel']") def job_start_configured(self): driver = self.driver @@ -299,15 +294,6 @@ class WebuiSeleniumTest(unittest.TestCase): self.wait_and_click(By.CSS_SELECTOR, 'span.input-group-addon') # Submit the job self.wait_and_click(By.ID, 'submit') - # After the now-generated site has loaded, save the job id - self.wait_for_spinner_absence() - # Count how many digits are at the end of the url / how long the id is - job_id = driver.current_url.split('/')[-1] - # If the current URL doesn't end with a digit we didn't start the job properly. - if not job_id.isdigit(): - raise BadJobException - - return job_id def login(self): driver = self.driver -- cgit v1.2.3