Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Fix logout, a job test and wrong env variable
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Bergkemper <frank.bergkemper@bareos.com>
  • Loading branch information
[Aron Schueler] authored and fbergkemper committed Mar 15, 2018
1 parent bfbab43 commit d80f296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/selenium/README.md
Expand Up @@ -27,7 +27,7 @@ To run the test you must set certain environment variables:
BAREOS_BASE_URL=http://127.0.0.1/bareos-webui/
BAREOS_USERNAME=admin
BAREOS_PASSWORD=linuxlinux
BAREOS_CLIENT=bareos-fd
BAREOS_CLIENT_NAME=bareos-fd
BAREOS_RESTOREFILE=/etc/passwd
BAREOS_LOG_PATH=/tmp/selenium-logs/
BAREOS_DELAY=1
Expand Down
8 changes: 3 additions & 5 deletions tests/selenium/webui-selenium-test.py
Expand Up @@ -160,7 +160,7 @@ def job_start_configured(self):
self.wait_and_click(By.ID, 'menu-topnavbar-job')
self.wait_and_click(By.LINK_TEXT, 'Run')

Select(driver.find_element_by_id('job')).select_by_visible_text('backup-%s' % self.client)
Select(driver.find_element_by_id('job')).select_by_visible_text('backup-bareos-fd')
Select(driver.find_element_by_id('client')).select_by_visible_text(self.client)
Select(driver.find_element_by_id('level')).select_by_visible_text('Incremental')
# Clears the priority field and enters 5.
Expand All @@ -180,6 +180,7 @@ def job_start_configured(self):
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

Expand Down Expand Up @@ -255,10 +256,7 @@ def login(self):
self.wait_for_spinner_absence()

def logout(self):
if self.browser == 'chrome':
self.wait_and_click(By.CSS_SELECTOR, 'a.dropdown-toggle')
else:
self.wait_and_click(By.LINK_TEXT, self.username)
self.wait_and_click(By.CSS_SELECTOR, 'a.dropdown-toggle')
self.wait_and_click(By.LINK_TEXT, 'Logout')
sleep(self.sleeptime)

Expand Down

0 comments on commit d80f296

Please sign in to comment.